Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index 0330baf..dec5124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4523=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','debug','ShowZendeskAccount','find','lodash','util','moment'];(function(_0x356870,_0x3a1d32){var _0x2cc847=function(_0x4114cd){while(--_0x4114cd){_0x356870['push'](_0x356870['shift']());}};_0x2cc847(++_0x3a1d32);}(_0x4523,0x165));var _0x3452=function(_0x2794ca,_0x3678f7){_0x2794ca=_0x2794ca-0x0;var _0x282278=_0x4523[_0x2794ca];return _0x282278;};'use strict';var _=require(_0x3452('0x0'));var util=require(_0x3452('0x1'));var moment=require(_0x3452('0x2'));var BPromise=require('bluebird');var rs=require(_0x3452('0x3'));var fs=require('fs');var Redis=require(_0x3452('0x4'));var db=require(_0x3452('0x5'))['db'];var utils=require(_0x3452('0x6'));var logger=require(_0x3452('0x7'))(_0x3452('0x8'));var config=require(_0x3452('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3452('0xa')][_0x3452('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d1675,_0x5e66e9,_0x5604a5){return new BPromise(function(_0xb3e186,_0x1b80b7){return client['request'](_0x2d1675,_0x5604a5)['then'](function(_0x3fe0f3){logger[_0x3452('0xc')](_0x3452('0xd'),_0x5e66e9,_0x3452('0xe'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5e66e9,_0x3452('0xe'),JSON[_0x3452('0xf')](_0x3fe0f3));if(_0x3fe0f3['error']){if(_0x3fe0f3[_0x3452('0x10')][_0x3452('0x11')]===0x1f4){logger['error'](_0x3452('0xd'),_0x5e66e9,_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);return _0x1b80b7(_0x3fe0f3['error'][_0x3452('0x12')]);}logger[_0x3452('0x10')](_0x3452('0xd'),_0x5e66e9,_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);return _0xb3e186(_0x3fe0f3[_0x3452('0x10')][_0x3452('0x12')]);}else{logger[_0x3452('0xc')](_0x3452('0xd'),_0x5e66e9,_0x3452('0xe'));_0xb3e186(_0x3fe0f3[_0x3452('0x13')][_0x3452('0x12')]);}})[_0x3452('0x14')](function(_0x79488c){logger[_0x3452('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x5e66e9,_0x79488c);_0x1b80b7(_0x79488c);});});}exports[_0x3452('0x15')]=function(_0x12f23d){var _0x3becf2=this;return new Promise(function(_0x574750,_0x5b3013){return db[_0x3452('0x16')][_0x3452('0x17')]({'raw':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x19')]===undefined?!![]:![]:!![],'where':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1a')]||null:null,'attributes':_0x12f23d[_0x3452('0x18')]?_0x12f23d['options']['attributes']||null:null,'limit':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1b')]||null:null,'include':_0x12f23d[_0x3452('0x18')]?_0x12f23d[_0x3452('0x18')][_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x12f23d[_0x3452('0x18')]['include'],function(_0x2ad2fd){return{'model':db[_0x2ad2fd[_0x3452('0x1e')]],'as':_0x2ad2fd['as'],'attributes':_0x2ad2fd[_0x3452('0x1f')],'include':_0x2ad2fd['include']?_[_0x3452('0x1d')](_0x2ad2fd[_0x3452('0x1c')],function(_0x2d1c8d){return{'model':db[_0x2d1c8d[_0x3452('0x1e')]],'as':_0x2d1c8d['as'],'attributes':_0x2d1c8d[_0x3452('0x1f')],'include':_0x2d1c8d[_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x2d1c8d[_0x3452('0x1c')],function(_0x552fa5){return{'model':db[_0x552fa5['model']],'as':_0x552fa5['as'],'attributes':_0x552fa5[_0x3452('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3452('0x20')](function(_0x54ada8){logger[_0x3452('0xc')](_0x3452('0x15'),_0x12f23d);logger[_0x3452('0x21')](_0x3452('0x15'),_0x12f23d,JSON[_0x3452('0xf')](_0x54ada8));_0x574750(_0x54ada8);})[_0x3452('0x14')](function(_0x1ffdde){logger[_0x3452('0x10')](_0x3452('0x15'),_0x1ffdde[_0x3452('0x12')],_0x12f23d);_0x5b3013(_0x3becf2['error'](0x1f4,_0x1ffdde[_0x3452('0x12')]));});});};exports[_0x3452('0x22')]=function(_0x48924c){var _0x24a358=this;return new Promise(function(_0x252709,_0x24a340){return db[_0x3452('0x16')][_0x3452('0x23')]({'raw':_0x48924c['options']?_0x48924c['options']['raw']===undefined?!![]:![]:!![],'where':_0x48924c[_0x3452('0x18')]?_0x48924c['options'][_0x3452('0x1a')]||null:null,'attributes':_0x48924c[_0x3452('0x18')]?_0x48924c['options'][_0x3452('0x1f')]||null:null,'include':_0x48924c[_0x3452('0x18')]?_0x48924c[_0x3452('0x18')][_0x3452('0x1c')]?_[_0x3452('0x1d')](_0x48924c[_0x3452('0x18')][_0x3452('0x1c')],function(_0x1c70d5){return{'model':db[_0x1c70d5[_0x3452('0x1e')]],'as':_0x1c70d5['as'],'attributes':_0x1c70d5[_0x3452('0x1f')],'include':_0x1c70d5['include']?_[_0x3452('0x1d')](_0x1c70d5[_0x3452('0x1c')],function(_0x29b333){return{'model':db[_0x29b333[_0x3452('0x1e')]],'as':_0x29b333['as'],'attributes':_0x29b333['attributes'],'include':_0x29b333['include']?_[_0x3452('0x1d')](_0x29b333[_0x3452('0x1c')],function(_0x4762fa){return{'model':db[_0x4762fa[_0x3452('0x1e')]],'as':_0x4762fa['as'],'attributes':_0x4762fa[_0x3452('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3452('0x20')](function(_0x86e278){logger[_0x3452('0xc')](_0x3452('0x22'),_0x48924c);logger[_0x3452('0x21')](_0x3452('0x22'),_0x48924c,JSON['stringify'](_0x86e278));_0x252709(_0x86e278);})[_0x3452('0x14')](function(_0x5a1008){logger[_0x3452('0x10')](_0x3452('0x22'),_0x5a1008[_0x3452('0x12')],_0x48924c);_0x24a340(_0x24a358[_0x3452('0x10')](0x1f4,_0x5a1008['message']));});});};
\ No newline at end of file
+var _0x5a93=['limit','include','model','stringify','ShowZendeskAccount','find','raw','map','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x5a93,0xf6));var _0x35a9=function(_0x357b0d,_0x10aeaa){_0x357b0d=_0x357b0d-0x0;var _0x3c48e9=_0x5a93[_0x357b0d];return _0x3c48e9;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var moment=require('moment');var BPromise=require(_0x35a9('0x1'));var rs=require(_0x35a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35a9('0x3'));var logger=require(_0x35a9('0x4'))(_0x35a9('0x5'));var config=require('../../config/environment');var jayson=require(_0x35a9('0x6'));var client=jayson[_0x35a9('0x7')][_0x35a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354490,_0x271228,_0x45e6f7){return new BPromise(function(_0x71d143,_0x22d770){return client[_0x35a9('0x9')](_0x354490,_0x45e6f7)[_0x35a9('0xa')](function(_0x5b4f25){logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));logger[_0x35a9('0xe')](_0x35a9('0xf'),_0x271228,_0x35a9('0xd'),JSON['stringify'](_0x5b4f25));if(_0x5b4f25[_0x35a9('0x10')]){if(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x11')]===0x1f4){logger[_0x35a9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x22d770(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);}logger['error'](_0x35a9('0xc'),_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x71d143(_0x5b4f25[_0x35a9('0x10')]['message']);}else{logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));_0x71d143(_0x5b4f25['result'][_0x35a9('0x12')]);}})[_0x35a9('0x13')](function(_0x14eeb5){logger[_0x35a9('0x10')](_0x35a9('0xc'),_0x271228,_0x14eeb5);_0x22d770(_0x14eeb5);});});}exports[_0x35a9('0x14')]=function(_0x56f31f){var _0x152086=this;return new Promise(function(_0x4490d5,_0x36f0fe){return db[_0x35a9('0x15')][_0x35a9('0x16')]({'raw':_0x56f31f['options']?_0x56f31f[_0x35a9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x56f31f[_0x35a9('0x17')]?_0x56f31f[_0x35a9('0x17')][_0x35a9('0x18')]||null:null,'attributes':_0x56f31f[_0x35a9('0x17')]?_0x56f31f[_0x35a9('0x17')][_0x35a9('0x19')]||null:null,'limit':_0x56f31f[_0x35a9('0x17')]?_0x56f31f[_0x35a9('0x17')][_0x35a9('0x1a')]||null:null,'include':_0x56f31f['options']?_0x56f31f[_0x35a9('0x17')][_0x35a9('0x1b')]?_['map'](_0x56f31f['options'][_0x35a9('0x1b')],function(_0x1dd1ab){return{'model':db[_0x1dd1ab[_0x35a9('0x1c')]],'as':_0x1dd1ab['as'],'attributes':_0x1dd1ab[_0x35a9('0x19')],'include':_0x1dd1ab[_0x35a9('0x1b')]?_['map'](_0x1dd1ab[_0x35a9('0x1b')],function(_0xc31cd1){return{'model':db[_0xc31cd1[_0x35a9('0x1c')]],'as':_0xc31cd1['as'],'attributes':_0xc31cd1[_0x35a9('0x19')],'include':_0xc31cd1[_0x35a9('0x1b')]?_['map'](_0xc31cd1['include'],function(_0x5dfc9f){return{'model':db[_0x5dfc9f[_0x35a9('0x1c')]],'as':_0x5dfc9f['as'],'attributes':_0x5dfc9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x35a9('0xa')](function(_0x15eada){logger['info'](_0x35a9('0x14'),_0x56f31f);logger['debug'](_0x35a9('0x14'),_0x56f31f,JSON[_0x35a9('0x1d')](_0x15eada));_0x4490d5(_0x15eada);})['catch'](function(_0x534455){logger[_0x35a9('0x10')](_0x35a9('0x14'),_0x534455[_0x35a9('0x12')],_0x56f31f);_0x36f0fe(_0x152086[_0x35a9('0x10')](0x1f4,_0x534455[_0x35a9('0x12')]));});});};exports[_0x35a9('0x1e')]=function(_0x145cc6){var _0x246316=this;return new Promise(function(_0x52c9c9,_0x39fa5a){return db[_0x35a9('0x15')][_0x35a9('0x1f')]({'raw':_0x145cc6[_0x35a9('0x17')]?_0x145cc6[_0x35a9('0x17')][_0x35a9('0x20')]===undefined?!![]:![]:!![],'where':_0x145cc6['options']?_0x145cc6[_0x35a9('0x17')][_0x35a9('0x18')]||null:null,'attributes':_0x145cc6[_0x35a9('0x17')]?_0x145cc6['options'][_0x35a9('0x19')]||null:null,'include':_0x145cc6['options']?_0x145cc6[_0x35a9('0x17')][_0x35a9('0x1b')]?_[_0x35a9('0x21')](_0x145cc6[_0x35a9('0x17')][_0x35a9('0x1b')],function(_0x28e8c8){return{'model':db[_0x28e8c8['model']],'as':_0x28e8c8['as'],'attributes':_0x28e8c8['attributes'],'include':_0x28e8c8[_0x35a9('0x1b')]?_[_0x35a9('0x21')](_0x28e8c8['include'],function(_0x5771ed){return{'model':db[_0x5771ed[_0x35a9('0x1c')]],'as':_0x5771ed['as'],'attributes':_0x5771ed['attributes'],'include':_0x5771ed['include']?_['map'](_0x5771ed[_0x35a9('0x1b')],function(_0x37f2fb){return{'model':db[_0x37f2fb['model']],'as':_0x37f2fb['as'],'attributes':_0x37f2fb[_0x35a9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x35a9('0xa')](function(_0x3695f1){logger[_0x35a9('0xb')]('ShowZendeskAccount',_0x145cc6);logger[_0x35a9('0xe')](_0x35a9('0x1e'),_0x145cc6,JSON[_0x35a9('0x1d')](_0x3695f1));_0x52c9c9(_0x3695f1);})[_0x35a9('0x13')](function(_0x4710ac){logger['error']('ShowZendeskAccount',_0x4710ac[_0x35a9('0x12')],_0x145cc6);_0x39fa5a(_0x246316['error'](0x1f4,_0x4710ac[_0x35a9('0x12')]));});});};
\ No newline at end of file