Built motion from commit 994c64e1.|2.6.1
[motion2.git] / server / api / intSugarcrmAccount / intSugarcrmAccount.rpc.js
index 0545263..2bdfd62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x00e2=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','attributes','include','map','find','where','model','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x00e2,0x1ac));var _0x200e=function(_0x2e891a,_0xb5a3b5){_0x2e891a=_0x2e891a-0x0;var _0x39f989=_0x00e2[_0x2e891a];return _0x39f989;};'use strict';var _=require(_0x200e('0x0'));var util=require(_0x200e('0x1'));var moment=require(_0x200e('0x2'));var BPromise=require(_0x200e('0x3'));var rs=require(_0x200e('0x4'));var fs=require('fs');var Redis=require(_0x200e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x200e('0x6'));var logger=require(_0x200e('0x7'))(_0x200e('0x8'));var config=require(_0x200e('0x9'));var jayson=require(_0x200e('0xa'));var client=jayson[_0x200e('0xb')][_0x200e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dc31b,_0x378bb1,_0x27d493){return new BPromise(function(_0x18aa9d,_0x21a340){return client[_0x200e('0xd')](_0x2dc31b,_0x27d493)[_0x200e('0xe')](function(_0x53d0dd){logger['info'](_0x200e('0xf'),_0x378bb1,'request\x20sent');logger[_0x200e('0x10')](_0x200e('0x11'),_0x378bb1,'request\x20sent',JSON[_0x200e('0x12')](_0x53d0dd));if(_0x53d0dd[_0x200e('0x13')]){if(_0x53d0dd[_0x200e('0x13')][_0x200e('0x14')]===0x1f4){logger[_0x200e('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x378bb1,_0x53d0dd[_0x200e('0x13')]['message']);return _0x21a340(_0x53d0dd['error'][_0x200e('0x15')]);}logger['error'](_0x200e('0xf'),_0x378bb1,_0x53d0dd[_0x200e('0x13')]['message']);return _0x18aa9d(_0x53d0dd[_0x200e('0x13')][_0x200e('0x15')]);}else{logger[_0x200e('0x16')](_0x200e('0xf'),_0x378bb1,_0x200e('0x17'));_0x18aa9d(_0x53d0dd[_0x200e('0x18')]['message']);}})[_0x200e('0x19')](function(_0x1d481b){logger[_0x200e('0x13')](_0x200e('0xf'),_0x378bb1,_0x1d481b);_0x21a340(_0x1d481b);});});}exports[_0x200e('0x1a')]=function(_0x33708c){var _0x33a5cd=this;return new Promise(function(_0x323b0f,_0x2a28ae){return db[_0x200e('0x1b')]['findAll']({'raw':_0x33708c[_0x200e('0x1c')]?_0x33708c[_0x200e('0x1c')][_0x200e('0x1d')]===undefined?!![]:![]:!![],'where':_0x33708c[_0x200e('0x1c')]?_0x33708c[_0x200e('0x1c')]['where']||null:null,'attributes':_0x33708c[_0x200e('0x1c')]?_0x33708c['options'][_0x200e('0x1e')]||null:null,'limit':_0x33708c[_0x200e('0x1c')]?_0x33708c[_0x200e('0x1c')]['limit']||null:null,'include':_0x33708c[_0x200e('0x1c')]?_0x33708c[_0x200e('0x1c')][_0x200e('0x1f')]?_[_0x200e('0x20')](_0x33708c[_0x200e('0x1c')]['include'],function(_0x356375){return{'model':db[_0x356375['model']],'as':_0x356375['as'],'attributes':_0x356375['attributes'],'include':_0x356375[_0x200e('0x1f')]?_[_0x200e('0x20')](_0x356375['include'],function(_0x250a80){return{'model':db[_0x250a80['model']],'as':_0x250a80['as'],'attributes':_0x250a80[_0x200e('0x1e')],'include':_0x250a80[_0x200e('0x1f')]?_[_0x200e('0x20')](_0x250a80[_0x200e('0x1f')],function(_0x179113){return{'model':db[_0x179113['model']],'as':_0x179113['as'],'attributes':_0x179113[_0x200e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x200e('0xe')](function(_0x4ce3ad){logger[_0x200e('0x16')]('GetSugarcrmAccount',_0x33708c);logger[_0x200e('0x10')](_0x200e('0x1a'),_0x33708c,JSON[_0x200e('0x12')](_0x4ce3ad));_0x323b0f(_0x4ce3ad);})[_0x200e('0x19')](function(_0x1d8476){logger['error'](_0x200e('0x1a'),_0x1d8476['message'],_0x33708c);_0x2a28ae(_0x33a5cd[_0x200e('0x13')](0x1f4,_0x1d8476[_0x200e('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0x5a2843){var _0x3da406=this;return new Promise(function(_0x30c68c,_0x96ddb2){return db[_0x200e('0x1b')][_0x200e('0x21')]({'raw':_0x5a2843[_0x200e('0x1c')]?_0x5a2843[_0x200e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5a2843[_0x200e('0x1c')]?_0x5a2843[_0x200e('0x1c')][_0x200e('0x22')]||null:null,'attributes':_0x5a2843[_0x200e('0x1c')]?_0x5a2843[_0x200e('0x1c')][_0x200e('0x1e')]||null:null,'include':_0x5a2843[_0x200e('0x1c')]?_0x5a2843['options'][_0x200e('0x1f')]?_[_0x200e('0x20')](_0x5a2843['options'][_0x200e('0x1f')],function(_0x168554){return{'model':db[_0x168554[_0x200e('0x23')]],'as':_0x168554['as'],'attributes':_0x168554[_0x200e('0x1e')],'include':_0x168554[_0x200e('0x1f')]?_[_0x200e('0x20')](_0x168554[_0x200e('0x1f')],function(_0xbb127d){return{'model':db[_0xbb127d[_0x200e('0x23')]],'as':_0xbb127d['as'],'attributes':_0xbb127d[_0x200e('0x1e')],'include':_0xbb127d[_0x200e('0x1f')]?_[_0x200e('0x20')](_0xbb127d[_0x200e('0x1f')],function(_0x1fc398){return{'model':db[_0x1fc398[_0x200e('0x23')]],'as':_0x1fc398['as'],'attributes':_0x1fc398[_0x200e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x200e('0xe')](function(_0x337420){logger[_0x200e('0x16')]('ShowSugarcrmAccount',_0x5a2843);logger['debug']('ShowSugarcrmAccount',_0x5a2843,JSON[_0x200e('0x12')](_0x337420));_0x30c68c(_0x337420);})[_0x200e('0x19')](function(_0x545250){logger[_0x200e('0x13')](_0x200e('0x24'),_0x545250[_0x200e('0x15')],_0x5a2843);_0x96ddb2(_0x3da406[_0x200e('0x13')](0x1f4,_0x545250[_0x200e('0x15')]));});});};
\ No newline at end of file