Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / intFreshdeskAccount / intFreshdeskAccount.rpc.js
index 743766d..d7449c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e4b=['include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit'];(function(_0x2ac845,_0x30e7aa){var _0xdbbd51=function(_0x77d68){while(--_0x77d68){_0x2ac845['push'](_0x2ac845['shift']());}};_0xdbbd51(++_0x30e7aa);}(_0x5e4b,0x136));var _0xb5e4=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x5e4b[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xb5e4('0x0'));var util=require(_0xb5e4('0x1'));var moment=require(_0xb5e4('0x2'));var BPromise=require(_0xb5e4('0x3'));var rs=require(_0xb5e4('0x4'));var fs=require('fs');var Redis=require(_0xb5e4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5e4('0x6'));var logger=require(_0xb5e4('0x7'))(_0xb5e4('0x8'));var config=require(_0xb5e4('0x9'));var jayson=require(_0xb5e4('0xa'));var client=jayson[_0xb5e4('0xb')][_0xb5e4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x357ea7,_0x47ed0c,_0x359787){return new BPromise(function(_0x5cf003,_0x399bdc){return client[_0xb5e4('0xd')](_0x357ea7,_0x359787)[_0xb5e4('0xe')](function(_0x2ca729){logger[_0xb5e4('0xf')](_0xb5e4('0x10'),_0x47ed0c,_0xb5e4('0x11'));logger[_0xb5e4('0x12')](_0xb5e4('0x13'),_0x47ed0c,_0xb5e4('0x11'),JSON[_0xb5e4('0x14')](_0x2ca729));if(_0x2ca729[_0xb5e4('0x15')]){if(_0x2ca729[_0xb5e4('0x15')]['code']===0x1f4){logger[_0xb5e4('0x15')](_0xb5e4('0x10'),_0x47ed0c,_0x2ca729[_0xb5e4('0x15')][_0xb5e4('0x16')]);return _0x399bdc(_0x2ca729[_0xb5e4('0x15')][_0xb5e4('0x16')]);}logger[_0xb5e4('0x15')](_0xb5e4('0x10'),_0x47ed0c,_0x2ca729[_0xb5e4('0x15')]['message']);return _0x5cf003(_0x2ca729[_0xb5e4('0x15')][_0xb5e4('0x16')]);}else{logger[_0xb5e4('0xf')](_0xb5e4('0x10'),_0x47ed0c,_0xb5e4('0x11'));_0x5cf003(_0x2ca729[_0xb5e4('0x17')]['message']);}})[_0xb5e4('0x18')](function(_0x1273fb){logger[_0xb5e4('0x15')](_0xb5e4('0x10'),_0x47ed0c,_0x1273fb);_0x399bdc(_0x1273fb);});});}exports['GetFreshdeskAccount']=function(_0x543fa0){var _0x480e97=this;return new Promise(function(_0x59b767,_0x42b549){return db[_0xb5e4('0x19')][_0xb5e4('0x1a')]({'raw':_0x543fa0[_0xb5e4('0x1b')]?_0x543fa0[_0xb5e4('0x1b')][_0xb5e4('0x1c')]===undefined?!![]:![]:!![],'where':_0x543fa0[_0xb5e4('0x1b')]?_0x543fa0[_0xb5e4('0x1b')][_0xb5e4('0x1d')]||null:null,'attributes':_0x543fa0['options']?_0x543fa0[_0xb5e4('0x1b')][_0xb5e4('0x1e')]||null:null,'limit':_0x543fa0['options']?_0x543fa0[_0xb5e4('0x1b')][_0xb5e4('0x1f')]||null:null,'include':_0x543fa0[_0xb5e4('0x1b')]?_0x543fa0[_0xb5e4('0x1b')][_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x543fa0[_0xb5e4('0x1b')]['include'],function(_0x50f84f){return{'model':db[_0x50f84f[_0xb5e4('0x22')]],'as':_0x50f84f['as'],'attributes':_0x50f84f[_0xb5e4('0x1e')],'include':_0x50f84f[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x50f84f['include'],function(_0x568306){return{'model':db[_0x568306[_0xb5e4('0x22')]],'as':_0x568306['as'],'attributes':_0x568306['attributes'],'include':_0x568306[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x568306[_0xb5e4('0x20')],function(_0x5780cc){return{'model':db[_0x5780cc['model']],'as':_0x5780cc['as'],'attributes':_0x5780cc[_0xb5e4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x201862){logger[_0xb5e4('0xf')](_0xb5e4('0x23'),_0x543fa0);logger['debug'](_0xb5e4('0x23'),_0x543fa0,JSON[_0xb5e4('0x14')](_0x201862));_0x59b767(_0x201862);})[_0xb5e4('0x18')](function(_0x323fc5){logger[_0xb5e4('0x15')](_0xb5e4('0x23'),_0x323fc5['message'],_0x543fa0);_0x42b549(_0x480e97[_0xb5e4('0x15')](0x1f4,_0x323fc5[_0xb5e4('0x16')]));});});};exports[_0xb5e4('0x24')]=function(_0x1a3fa9){var _0x251288=this;return new Promise(function(_0x3906f3,_0x4f4076){return db['FreshdeskAccount'][_0xb5e4('0x25')]({'raw':_0x1a3fa9[_0xb5e4('0x1b')]?_0x1a3fa9[_0xb5e4('0x1b')][_0xb5e4('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a3fa9[_0xb5e4('0x1b')]?_0x1a3fa9[_0xb5e4('0x1b')]['where']||null:null,'attributes':_0x1a3fa9[_0xb5e4('0x1b')]?_0x1a3fa9[_0xb5e4('0x1b')][_0xb5e4('0x1e')]||null:null,'include':_0x1a3fa9[_0xb5e4('0x1b')]?_0x1a3fa9[_0xb5e4('0x1b')][_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x1a3fa9[_0xb5e4('0x1b')][_0xb5e4('0x20')],function(_0xdc14c5){return{'model':db[_0xdc14c5[_0xb5e4('0x22')]],'as':_0xdc14c5['as'],'attributes':_0xdc14c5[_0xb5e4('0x1e')],'include':_0xdc14c5[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0xdc14c5[_0xb5e4('0x20')],function(_0x531550){return{'model':db[_0x531550['model']],'as':_0x531550['as'],'attributes':_0x531550[_0xb5e4('0x1e')],'include':_0x531550[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x531550[_0xb5e4('0x20')],function(_0x39703a){return{'model':db[_0x39703a[_0xb5e4('0x22')]],'as':_0x39703a['as'],'attributes':_0x39703a[_0xb5e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb5e4('0xe')](function(_0x9fada2){logger['info'](_0xb5e4('0x24'),_0x1a3fa9);logger[_0xb5e4('0x12')](_0xb5e4('0x24'),_0x1a3fa9,JSON[_0xb5e4('0x14')](_0x9fada2));_0x3906f3(_0x9fada2);})[_0xb5e4('0x18')](function(_0x5cf9e){logger['error'](_0xb5e4('0x24'),_0x5cf9e[_0xb5e4('0x16')],_0x1a3fa9);_0x4f4076(_0x251288['error'](0x1f4,_0x5cf9e['message']));});});};
\ No newline at end of file
+var _0x3d12=['client','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','include','map','model','attributes','ShowFreshdeskAccount','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3d12,0x1e6));var _0x23d1=function(_0x74e1a8,_0x5d0e49){_0x74e1a8=_0x74e1a8-0x0;var _0x3248dd=_0x3d12[_0x74e1a8];return _0x3248dd;};'use strict';var _=require('lodash');var util=require(_0x23d1('0x0'));var moment=require(_0x23d1('0x1'));var BPromise=require(_0x23d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23d1('0x3'));var db=require(_0x23d1('0x4'))['db'];var utils=require(_0x23d1('0x5'));var logger=require('../../config/logger')(_0x23d1('0x6'));var config=require(_0x23d1('0x7'));var jayson=require(_0x23d1('0x8'));var client=jayson[_0x23d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x371735,_0x26e5bd,_0x325320){return new BPromise(function(_0x3b4c6,_0x136473){return client['request'](_0x371735,_0x325320)[_0x23d1('0xa')](function(_0x2c2593){logger[_0x23d1('0xb')](_0x23d1('0xc'),_0x26e5bd,_0x23d1('0xd'));logger[_0x23d1('0xe')](_0x23d1('0xf'),_0x26e5bd,_0x23d1('0xd'),JSON[_0x23d1('0x10')](_0x2c2593));if(_0x2c2593[_0x23d1('0x11')]){if(_0x2c2593[_0x23d1('0x11')]['code']===0x1f4){logger[_0x23d1('0x11')](_0x23d1('0xc'),_0x26e5bd,_0x2c2593[_0x23d1('0x11')]['message']);return _0x136473(_0x2c2593[_0x23d1('0x11')][_0x23d1('0x12')]);}logger['error'](_0x23d1('0xc'),_0x26e5bd,_0x2c2593[_0x23d1('0x11')][_0x23d1('0x12')]);return _0x3b4c6(_0x2c2593['error'][_0x23d1('0x12')]);}else{logger[_0x23d1('0xb')](_0x23d1('0xc'),_0x26e5bd,'request\x20sent');_0x3b4c6(_0x2c2593[_0x23d1('0x13')][_0x23d1('0x12')]);}})[_0x23d1('0x14')](function(_0x362a86){logger[_0x23d1('0x11')](_0x23d1('0xc'),_0x26e5bd,_0x362a86);_0x136473(_0x362a86);});});}exports[_0x23d1('0x15')]=function(_0x5baebd){var _0x2388b8=this;return new Promise(function(_0x4ba257,_0x3782c9){return db[_0x23d1('0x16')][_0x23d1('0x17')]({'raw':_0x5baebd['options']?_0x5baebd[_0x23d1('0x18')][_0x23d1('0x19')]===undefined?!![]:![]:!![],'where':_0x5baebd[_0x23d1('0x18')]?_0x5baebd[_0x23d1('0x18')]['where']||null:null,'attributes':_0x5baebd[_0x23d1('0x18')]?_0x5baebd['options']['attributes']||null:null,'limit':_0x5baebd['options']?_0x5baebd[_0x23d1('0x18')][_0x23d1('0x1a')]||null:null,'include':_0x5baebd[_0x23d1('0x18')]?_0x5baebd[_0x23d1('0x18')][_0x23d1('0x1b')]?_[_0x23d1('0x1c')](_0x5baebd[_0x23d1('0x18')][_0x23d1('0x1b')],function(_0x41a525){return{'model':db[_0x41a525[_0x23d1('0x1d')]],'as':_0x41a525['as'],'attributes':_0x41a525['attributes'],'include':_0x41a525['include']?_[_0x23d1('0x1c')](_0x41a525[_0x23d1('0x1b')],function(_0x3e53be){return{'model':db[_0x3e53be[_0x23d1('0x1d')]],'as':_0x3e53be['as'],'attributes':_0x3e53be[_0x23d1('0x1e')],'include':_0x3e53be[_0x23d1('0x1b')]?_[_0x23d1('0x1c')](_0x3e53be['include'],function(_0x564aa2){return{'model':db[_0x564aa2[_0x23d1('0x1d')]],'as':_0x564aa2['as'],'attributes':_0x564aa2[_0x23d1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16630b){logger['info'](_0x23d1('0x15'),_0x5baebd);logger[_0x23d1('0xe')](_0x23d1('0x15'),_0x5baebd,JSON[_0x23d1('0x10')](_0x16630b));_0x4ba257(_0x16630b);})[_0x23d1('0x14')](function(_0x1dcb97){logger[_0x23d1('0x11')]('GetFreshdeskAccount',_0x1dcb97[_0x23d1('0x12')],_0x5baebd);_0x3782c9(_0x2388b8['error'](0x1f4,_0x1dcb97[_0x23d1('0x12')]));});});};exports[_0x23d1('0x1f')]=function(_0x22722c){var _0x1d587c=this;return new Promise(function(_0x186b65,_0x4f791f){return db[_0x23d1('0x16')]['find']({'raw':_0x22722c[_0x23d1('0x18')]?_0x22722c[_0x23d1('0x18')][_0x23d1('0x19')]===undefined?!![]:![]:!![],'where':_0x22722c['options']?_0x22722c[_0x23d1('0x18')][_0x23d1('0x20')]||null:null,'attributes':_0x22722c[_0x23d1('0x18')]?_0x22722c[_0x23d1('0x18')][_0x23d1('0x1e')]||null:null,'include':_0x22722c[_0x23d1('0x18')]?_0x22722c[_0x23d1('0x18')][_0x23d1('0x1b')]?_[_0x23d1('0x1c')](_0x22722c['options'][_0x23d1('0x1b')],function(_0x308691){return{'model':db[_0x308691[_0x23d1('0x1d')]],'as':_0x308691['as'],'attributes':_0x308691[_0x23d1('0x1e')],'include':_0x308691[_0x23d1('0x1b')]?_['map'](_0x308691[_0x23d1('0x1b')],function(_0x26f20c){return{'model':db[_0x26f20c[_0x23d1('0x1d')]],'as':_0x26f20c['as'],'attributes':_0x26f20c[_0x23d1('0x1e')],'include':_0x26f20c[_0x23d1('0x1b')]?_[_0x23d1('0x1c')](_0x26f20c['include'],function(_0x47c146){return{'model':db[_0x47c146['model']],'as':_0x47c146['as'],'attributes':_0x47c146[_0x23d1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x23d1('0xa')](function(_0x1fe10f){logger[_0x23d1('0xb')](_0x23d1('0x1f'),_0x22722c);logger['debug'](_0x23d1('0x1f'),_0x22722c,JSON[_0x23d1('0x10')](_0x1fe10f));_0x186b65(_0x1fe10f);})['catch'](function(_0x1380a9){logger['error'](_0x23d1('0x1f'),_0x1380a9['message'],_0x22722c);_0x4f791f(_0x1d587c[_0x23d1('0x11')](0x1f4,_0x1380a9[_0x23d1('0x12')]));});});};
\ No newline at end of file