Built motion from commit 71df090e.|2.6.31
[motion2.git] / server / api / intZendeskAccount / intZendeskAccount.rpc.js
index ad58ab1..75d7f1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b66=['model','map','then','catch','ShowZendeskAccount','find','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','ZendeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x352d45,_0x698471){var _0x549ff7=function(_0x19c0f2){while(--_0x19c0f2){_0x352d45['push'](_0x352d45['shift']());}};_0x549ff7(++_0x698471);}(_0x7b66,0x1aa));var _0x67b6=function(_0x51eddc,_0x5a44b1){_0x51eddc=_0x51eddc-0x0;var _0x639ec0=_0x7b66[_0x51eddc];return _0x639ec0;};'use strict';var _=require('lodash');var util=require(_0x67b6('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x67b6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67b6('0x2'))['db'];var utils=require(_0x67b6('0x3'));var logger=require(_0x67b6('0x4'))(_0x67b6('0x5'));var config=require('../../config/environment');var jayson=require(_0x67b6('0x6'));var client=jayson[_0x67b6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1240e6,_0x1cf9be,_0x4ada2d){return new BPromise(function(_0x3fac82,_0x24c2f3){return client['request'](_0x1240e6,_0x4ada2d)['then'](function(_0x3735ed){logger['info'](_0x67b6('0x8'),_0x1cf9be,_0x67b6('0x9'));logger[_0x67b6('0xa')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1cf9be,'request\x20sent',JSON[_0x67b6('0xb')](_0x3735ed));if(_0x3735ed['error']){if(_0x3735ed[_0x67b6('0xc')]['code']===0x1f4){logger['error'](_0x67b6('0x8'),_0x1cf9be,_0x3735ed[_0x67b6('0xc')][_0x67b6('0xd')]);return _0x24c2f3(_0x3735ed['error'][_0x67b6('0xd')]);}logger[_0x67b6('0xc')](_0x67b6('0x8'),_0x1cf9be,_0x3735ed[_0x67b6('0xc')]['message']);return _0x3fac82(_0x3735ed[_0x67b6('0xc')][_0x67b6('0xd')]);}else{logger[_0x67b6('0xe')](_0x67b6('0x8'),_0x1cf9be,_0x67b6('0x9'));_0x3fac82(_0x3735ed[_0x67b6('0xf')][_0x67b6('0xd')]);}})['catch'](function(_0x5c650a){logger[_0x67b6('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x1cf9be,_0x5c650a);_0x24c2f3(_0x5c650a);});});}exports['GetZendeskAccount']=function(_0x40464d){var _0x2700d1=this;return new Promise(function(_0x18d612,_0x2f1d85){return db[_0x67b6('0x10')][_0x67b6('0x11')]({'raw':_0x40464d['options']?_0x40464d[_0x67b6('0x12')][_0x67b6('0x13')]===undefined?!![]:![]:!![],'where':_0x40464d['options']?_0x40464d['options'][_0x67b6('0x14')]||null:null,'attributes':_0x40464d[_0x67b6('0x12')]?_0x40464d[_0x67b6('0x12')][_0x67b6('0x15')]||null:null,'limit':_0x40464d[_0x67b6('0x12')]?_0x40464d['options'][_0x67b6('0x16')]||null:null,'include':_0x40464d[_0x67b6('0x12')]?_0x40464d[_0x67b6('0x12')][_0x67b6('0x17')]?_['map'](_0x40464d[_0x67b6('0x12')][_0x67b6('0x17')],function(_0x277148){return{'model':db[_0x277148[_0x67b6('0x18')]],'as':_0x277148['as'],'attributes':_0x277148[_0x67b6('0x15')],'include':_0x277148[_0x67b6('0x17')]?_['map'](_0x277148[_0x67b6('0x17')],function(_0x3f0e31){return{'model':db[_0x3f0e31[_0x67b6('0x18')]],'as':_0x3f0e31['as'],'attributes':_0x3f0e31[_0x67b6('0x15')],'include':_0x3f0e31[_0x67b6('0x17')]?_[_0x67b6('0x19')](_0x3f0e31[_0x67b6('0x17')],function(_0x553b2b){return{'model':db[_0x553b2b[_0x67b6('0x18')]],'as':_0x553b2b['as'],'attributes':_0x553b2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x67b6('0x1a')](function(_0x949074){logger[_0x67b6('0xe')]('GetZendeskAccount',_0x40464d);logger[_0x67b6('0xa')]('GetZendeskAccount',_0x40464d,JSON[_0x67b6('0xb')](_0x949074));_0x18d612(_0x949074);})[_0x67b6('0x1b')](function(_0x58523){logger['error']('GetZendeskAccount',_0x58523[_0x67b6('0xd')],_0x40464d);_0x2f1d85(_0x2700d1[_0x67b6('0xc')](0x1f4,_0x58523[_0x67b6('0xd')]));});});};exports[_0x67b6('0x1c')]=function(_0x632816){var _0x2bd70e=this;return new Promise(function(_0x4a3e16,_0x415e99){return db[_0x67b6('0x10')][_0x67b6('0x1d')]({'raw':_0x632816[_0x67b6('0x12')]?_0x632816[_0x67b6('0x12')][_0x67b6('0x13')]===undefined?!![]:![]:!![],'where':_0x632816[_0x67b6('0x12')]?_0x632816[_0x67b6('0x12')]['where']||null:null,'attributes':_0x632816['options']?_0x632816[_0x67b6('0x12')][_0x67b6('0x15')]||null:null,'include':_0x632816[_0x67b6('0x12')]?_0x632816[_0x67b6('0x12')][_0x67b6('0x17')]?_[_0x67b6('0x19')](_0x632816['options']['include'],function(_0xc5159d){return{'model':db[_0xc5159d[_0x67b6('0x18')]],'as':_0xc5159d['as'],'attributes':_0xc5159d[_0x67b6('0x15')],'include':_0xc5159d['include']?_['map'](_0xc5159d[_0x67b6('0x17')],function(_0x4ed27e){return{'model':db[_0x4ed27e[_0x67b6('0x18')]],'as':_0x4ed27e['as'],'attributes':_0x4ed27e[_0x67b6('0x15')],'include':_0x4ed27e['include']?_[_0x67b6('0x19')](_0x4ed27e[_0x67b6('0x17')],function(_0x6bd1fe){return{'model':db[_0x6bd1fe['model']],'as':_0x6bd1fe['as'],'attributes':_0x6bd1fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x67b6('0x1a')](function(_0x50bbb2){logger[_0x67b6('0xe')](_0x67b6('0x1c'),_0x632816);logger['debug'](_0x67b6('0x1c'),_0x632816,JSON[_0x67b6('0xb')](_0x50bbb2));_0x4a3e16(_0x50bbb2);})[_0x67b6('0x1b')](function(_0x1b6750){logger[_0x67b6('0xc')](_0x67b6('0x1c'),_0x1b6750[_0x67b6('0xd')],_0x632816);_0x415e99(_0x2bd70e[_0x67b6('0xc')](0x1f4,_0x1b6750[_0x67b6('0xd')]));});});};
\ No newline at end of file
+var _0x78fb=['stringify','error','code','message','info','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','ShowZendeskAccount','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5ab191,_0x3048f5){var _0x3926b3=function(_0x444bb7){while(--_0x444bb7){_0x5ab191['push'](_0x5ab191['shift']());}};_0x3926b3(++_0x3048f5);}(_0x78fb,0x1c1));var _0xb78f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x78fb[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xb78f('0x0'));var util=require(_0xb78f('0x1'));var moment=require('moment');var BPromise=require(_0xb78f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb78f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb78f('0x4'))('rpc');var config=require(_0xb78f('0x5'));var jayson=require(_0xb78f('0x6'));var client=jayson[_0xb78f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3473af,_0x58dca6,_0x39954b){return new BPromise(function(_0x391cee,_0x1a5aac){return client['request'](_0x3473af,_0x39954b)[_0xb78f('0x8')](function(_0x5a5e12){logger['info'](_0xb78f('0x9'),_0x58dca6,_0xb78f('0xa'));logger[_0xb78f('0xb')](_0xb78f('0xc'),_0x58dca6,_0xb78f('0xa'),JSON[_0xb78f('0xd')](_0x5a5e12));if(_0x5a5e12[_0xb78f('0xe')]){if(_0x5a5e12[_0xb78f('0xe')][_0xb78f('0xf')]===0x1f4){logger[_0xb78f('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x58dca6,_0x5a5e12['error']['message']);return _0x1a5aac(_0x5a5e12['error'][_0xb78f('0x10')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x58dca6,_0x5a5e12[_0xb78f('0xe')][_0xb78f('0x10')]);return _0x391cee(_0x5a5e12[_0xb78f('0xe')][_0xb78f('0x10')]);}else{logger[_0xb78f('0x11')](_0xb78f('0x9'),_0x58dca6,_0xb78f('0xa'));_0x391cee(_0x5a5e12[_0xb78f('0x12')][_0xb78f('0x10')]);}})['catch'](function(_0x38b6b1){logger[_0xb78f('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x58dca6,_0x38b6b1);_0x1a5aac(_0x38b6b1);});});}exports[_0xb78f('0x13')]=function(_0x5a3aa4){var _0x281681=this;return new Promise(function(_0x54ced5,_0xbcdb01){return db[_0xb78f('0x14')][_0xb78f('0x15')]({'raw':_0x5a3aa4[_0xb78f('0x16')]?_0x5a3aa4[_0xb78f('0x16')][_0xb78f('0x17')]===undefined?!![]:![]:!![],'where':_0x5a3aa4[_0xb78f('0x16')]?_0x5a3aa4['options'][_0xb78f('0x18')]||null:null,'attributes':_0x5a3aa4[_0xb78f('0x16')]?_0x5a3aa4['options'][_0xb78f('0x19')]||null:null,'limit':_0x5a3aa4[_0xb78f('0x16')]?_0x5a3aa4['options'][_0xb78f('0x1a')]||null:null,'include':_0x5a3aa4['options']?_0x5a3aa4[_0xb78f('0x16')][_0xb78f('0x1b')]?_[_0xb78f('0x1c')](_0x5a3aa4[_0xb78f('0x16')][_0xb78f('0x1b')],function(_0x1d70b1){return{'model':db[_0x1d70b1[_0xb78f('0x1d')]],'as':_0x1d70b1['as'],'attributes':_0x1d70b1[_0xb78f('0x19')],'include':_0x1d70b1['include']?_[_0xb78f('0x1c')](_0x1d70b1[_0xb78f('0x1b')],function(_0x259e2d){return{'model':db[_0x259e2d[_0xb78f('0x1d')]],'as':_0x259e2d['as'],'attributes':_0x259e2d['attributes'],'include':_0x259e2d[_0xb78f('0x1b')]?_[_0xb78f('0x1c')](_0x259e2d[_0xb78f('0x1b')],function(_0x4867bc){return{'model':db[_0x4867bc[_0xb78f('0x1d')]],'as':_0x4867bc['as'],'attributes':_0x4867bc['attributes']};}):[]};}):[]};}):[]:[]})[_0xb78f('0x8')](function(_0x4c3116){logger[_0xb78f('0x11')]('GetZendeskAccount',_0x5a3aa4);logger['debug'](_0xb78f('0x13'),_0x5a3aa4,JSON['stringify'](_0x4c3116));_0x54ced5(_0x4c3116);})[_0xb78f('0x1e')](function(_0x43c9e2){logger[_0xb78f('0xe')](_0xb78f('0x13'),_0x43c9e2[_0xb78f('0x10')],_0x5a3aa4);_0xbcdb01(_0x281681[_0xb78f('0xe')](0x1f4,_0x43c9e2[_0xb78f('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x504386){var _0x436602=this;return new Promise(function(_0x482fc2,_0x57703b){return db[_0xb78f('0x14')][_0xb78f('0x1f')]({'raw':_0x504386[_0xb78f('0x16')]?_0x504386[_0xb78f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x504386['options']?_0x504386[_0xb78f('0x16')]['where']||null:null,'attributes':_0x504386[_0xb78f('0x16')]?_0x504386[_0xb78f('0x16')]['attributes']||null:null,'include':_0x504386['options']?_0x504386[_0xb78f('0x16')][_0xb78f('0x1b')]?_[_0xb78f('0x1c')](_0x504386[_0xb78f('0x16')][_0xb78f('0x1b')],function(_0x4bcbfd){return{'model':db[_0x4bcbfd[_0xb78f('0x1d')]],'as':_0x4bcbfd['as'],'attributes':_0x4bcbfd['attributes'],'include':_0x4bcbfd[_0xb78f('0x1b')]?_[_0xb78f('0x1c')](_0x4bcbfd[_0xb78f('0x1b')],function(_0x42a718){return{'model':db[_0x42a718[_0xb78f('0x1d')]],'as':_0x42a718['as'],'attributes':_0x42a718['attributes'],'include':_0x42a718['include']?_[_0xb78f('0x1c')](_0x42a718['include'],function(_0x16a074){return{'model':db[_0x16a074[_0xb78f('0x1d')]],'as':_0x16a074['as'],'attributes':_0x16a074[_0xb78f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x81e46b){logger[_0xb78f('0x11')](_0xb78f('0x20'),_0x504386);logger['debug']('ShowZendeskAccount',_0x504386,JSON['stringify'](_0x81e46b));_0x482fc2(_0x81e46b);})[_0xb78f('0x1e')](function(_0xde6e90){logger['error'](_0xb78f('0x20'),_0xde6e90['message'],_0x504386);_0x57703b(_0x436602[_0xb78f('0xe')](0x1f4,_0xde6e90[_0xb78f('0x10')]));});});};
\ No newline at end of file