Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / api / intServicenowAccount / intServicenowAccount.rpc.js
index 37bf31e..dbff268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4db=['stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','include','map','model','then','ShowServicenowAccount','find','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0xc4db,0x76));var _0xbc4d=function(_0x4be6a6,_0x184f2a){_0x4be6a6=_0x4be6a6-0x0;var _0x12100f=_0xc4db[_0x4be6a6];return _0x12100f;};'use strict';var _=require('lodash');var util=require(_0xbc4d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc4d('0x1'));var fs=require('fs');var Redis=require(_0xbc4d('0x2'));var db=require(_0xbc4d('0x3'))['db'];var utils=require(_0xbc4d('0x4'));var logger=require('../../config/logger')(_0xbc4d('0x5'));var config=require(_0xbc4d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbc4d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13c1d1,_0x53b8b4,_0x11cd77){return new BPromise(function(_0x3ed33e,_0x259f50){return client[_0xbc4d('0x8')](_0x13c1d1,_0x11cd77)['then'](function(_0x29fc91){logger[_0xbc4d('0x9')](_0xbc4d('0xa'),_0x53b8b4,'request\x20sent');logger[_0xbc4d('0xb')](_0xbc4d('0xc'),_0x53b8b4,_0xbc4d('0xd'),JSON[_0xbc4d('0xe')](_0x29fc91));if(_0x29fc91[_0xbc4d('0xf')]){if(_0x29fc91[_0xbc4d('0xf')][_0xbc4d('0x10')]===0x1f4){logger[_0xbc4d('0xf')](_0xbc4d('0xa'),_0x53b8b4,_0x29fc91['error'][_0xbc4d('0x11')]);return _0x259f50(_0x29fc91['error'][_0xbc4d('0x11')]);}logger['error'](_0xbc4d('0xa'),_0x53b8b4,_0x29fc91[_0xbc4d('0xf')]['message']);return _0x3ed33e(_0x29fc91[_0xbc4d('0xf')][_0xbc4d('0x11')]);}else{logger[_0xbc4d('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x53b8b4,_0xbc4d('0xd'));_0x3ed33e(_0x29fc91[_0xbc4d('0x12')][_0xbc4d('0x11')]);}})[_0xbc4d('0x13')](function(_0xd78cd4){logger[_0xbc4d('0xf')](_0xbc4d('0xa'),_0x53b8b4,_0xd78cd4);_0x259f50(_0xd78cd4);});});}exports[_0xbc4d('0x14')]=function(_0x5bfa71){var _0x5dc5bb=this;return new Promise(function(_0x2176f0,_0x3cf55d){return db[_0xbc4d('0x15')][_0xbc4d('0x16')]({'raw':_0x5bfa71['options']?_0x5bfa71[_0xbc4d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5bfa71['options']?_0x5bfa71['options'][_0xbc4d('0x18')]||null:null,'attributes':_0x5bfa71[_0xbc4d('0x17')]?_0x5bfa71[_0xbc4d('0x17')][_0xbc4d('0x19')]||null:null,'limit':_0x5bfa71[_0xbc4d('0x17')]?_0x5bfa71[_0xbc4d('0x17')]['limit']||null:null,'include':_0x5bfa71[_0xbc4d('0x17')]?_0x5bfa71[_0xbc4d('0x17')][_0xbc4d('0x1a')]?_[_0xbc4d('0x1b')](_0x5bfa71[_0xbc4d('0x17')][_0xbc4d('0x1a')],function(_0x448283){return{'model':db[_0x448283[_0xbc4d('0x1c')]],'as':_0x448283['as'],'attributes':_0x448283[_0xbc4d('0x19')],'include':_0x448283[_0xbc4d('0x1a')]?_[_0xbc4d('0x1b')](_0x448283[_0xbc4d('0x1a')],function(_0x53c13a){return{'model':db[_0x53c13a[_0xbc4d('0x1c')]],'as':_0x53c13a['as'],'attributes':_0x53c13a[_0xbc4d('0x19')],'include':_0x53c13a[_0xbc4d('0x1a')]?_[_0xbc4d('0x1b')](_0x53c13a[_0xbc4d('0x1a')],function(_0x16c2d9){return{'model':db[_0x16c2d9[_0xbc4d('0x1c')]],'as':_0x16c2d9['as'],'attributes':_0x16c2d9[_0xbc4d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbc4d('0x1d')](function(_0x5f8f5b){logger['info'](_0xbc4d('0x14'),_0x5bfa71);logger['debug'](_0xbc4d('0x14'),_0x5bfa71,JSON['stringify'](_0x5f8f5b));_0x2176f0(_0x5f8f5b);})['catch'](function(_0x3256c8){logger[_0xbc4d('0xf')](_0xbc4d('0x14'),_0x3256c8[_0xbc4d('0x11')],_0x5bfa71);_0x3cf55d(_0x5dc5bb[_0xbc4d('0xf')](0x1f4,_0x3256c8['message']));});});};exports[_0xbc4d('0x1e')]=function(_0xc96ce){var _0xf42ce5=this;return new Promise(function(_0x2a6b75,_0x3bac88){return db['ServicenowAccount'][_0xbc4d('0x1f')]({'raw':_0xc96ce[_0xbc4d('0x17')]?_0xc96ce[_0xbc4d('0x17')][_0xbc4d('0x20')]===undefined?!![]:![]:!![],'where':_0xc96ce[_0xbc4d('0x17')]?_0xc96ce[_0xbc4d('0x17')][_0xbc4d('0x18')]||null:null,'attributes':_0xc96ce[_0xbc4d('0x17')]?_0xc96ce[_0xbc4d('0x17')][_0xbc4d('0x19')]||null:null,'include':_0xc96ce[_0xbc4d('0x17')]?_0xc96ce[_0xbc4d('0x17')]['include']?_[_0xbc4d('0x1b')](_0xc96ce['options'][_0xbc4d('0x1a')],function(_0x980980){return{'model':db[_0x980980[_0xbc4d('0x1c')]],'as':_0x980980['as'],'attributes':_0x980980['attributes'],'include':_0x980980[_0xbc4d('0x1a')]?_['map'](_0x980980[_0xbc4d('0x1a')],function(_0x540a47){return{'model':db[_0x540a47['model']],'as':_0x540a47['as'],'attributes':_0x540a47[_0xbc4d('0x19')],'include':_0x540a47[_0xbc4d('0x1a')]?_[_0xbc4d('0x1b')](_0x540a47[_0xbc4d('0x1a')],function(_0x455a11){return{'model':db[_0x455a11[_0xbc4d('0x1c')]],'as':_0x455a11['as'],'attributes':_0x455a11[_0xbc4d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbc4d('0x1d')](function(_0x363cf5){logger[_0xbc4d('0x9')](_0xbc4d('0x1e'),_0xc96ce);logger['debug'](_0xbc4d('0x1e'),_0xc96ce,JSON[_0xbc4d('0xe')](_0x363cf5));_0x2a6b75(_0x363cf5);})['catch'](function(_0x269ade){logger[_0xbc4d('0xf')](_0xbc4d('0x1e'),_0x269ade[_0xbc4d('0x11')],_0xc96ce);_0x3bac88(_0xf42ce5[_0xbc4d('0xf')](0x1f4,_0x269ade[_0xbc4d('0x11')]));});});};
\ No newline at end of file
+var _0x35d2=['map','then','where','ShowServicenowAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','include','model'];(function(_0x1d236b,_0x250fba){var _0x4d6a06=function(_0x1d4cd1){while(--_0x1d4cd1){_0x1d236b['push'](_0x1d236b['shift']());}};_0x4d6a06(++_0x250fba);}(_0x35d2,0x1e0));var _0x235d=function(_0x24d764,_0x4fb195){_0x24d764=_0x24d764-0x0;var _0x4c5e51=_0x35d2[_0x24d764];return _0x4c5e51;};'use strict';var _=require(_0x235d('0x0'));var util=require(_0x235d('0x1'));var moment=require(_0x235d('0x2'));var BPromise=require('bluebird');var rs=require(_0x235d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x235d('0x4'))['db'];var utils=require(_0x235d('0x5'));var logger=require(_0x235d('0x6'))(_0x235d('0x7'));var config=require(_0x235d('0x8'));var jayson=require(_0x235d('0x9'));var client=jayson[_0x235d('0xa')][_0x235d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9302,_0x41eddd,_0x287143){return new BPromise(function(_0x43dc71,_0x3754ba){return client[_0x235d('0xc')](_0x3f9302,_0x287143)['then'](function(_0x3a98ea){logger[_0x235d('0xd')](_0x235d('0xe'),_0x41eddd,_0x235d('0xf'));logger[_0x235d('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x41eddd,_0x235d('0xf'),JSON[_0x235d('0x11')](_0x3a98ea));if(_0x3a98ea[_0x235d('0x12')]){if(_0x3a98ea[_0x235d('0x12')][_0x235d('0x13')]===0x1f4){logger[_0x235d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x41eddd,_0x3a98ea['error']['message']);return _0x3754ba(_0x3a98ea[_0x235d('0x12')][_0x235d('0x14')]);}logger[_0x235d('0x12')](_0x235d('0xe'),_0x41eddd,_0x3a98ea[_0x235d('0x12')][_0x235d('0x14')]);return _0x43dc71(_0x3a98ea[_0x235d('0x12')][_0x235d('0x14')]);}else{logger[_0x235d('0xd')](_0x235d('0xe'),_0x41eddd,_0x235d('0xf'));_0x43dc71(_0x3a98ea['result'][_0x235d('0x14')]);}})[_0x235d('0x15')](function(_0x4429f1){logger['error'](_0x235d('0xe'),_0x41eddd,_0x4429f1);_0x3754ba(_0x4429f1);});});}exports[_0x235d('0x16')]=function(_0x127f48){var _0x44a5c0=this;return new Promise(function(_0x3c30c7,_0x32a4f4){return db[_0x235d('0x17')][_0x235d('0x18')]({'raw':_0x127f48[_0x235d('0x19')]?_0x127f48[_0x235d('0x19')][_0x235d('0x1a')]===undefined?!![]:![]:!![],'where':_0x127f48[_0x235d('0x19')]?_0x127f48[_0x235d('0x19')]['where']||null:null,'attributes':_0x127f48[_0x235d('0x19')]?_0x127f48[_0x235d('0x19')][_0x235d('0x1b')]||null:null,'limit':_0x127f48['options']?_0x127f48[_0x235d('0x19')]['limit']||null:null,'include':_0x127f48[_0x235d('0x19')]?_0x127f48[_0x235d('0x19')]['include']?_['map'](_0x127f48[_0x235d('0x19')][_0x235d('0x1c')],function(_0x124cb9){return{'model':db[_0x124cb9[_0x235d('0x1d')]],'as':_0x124cb9['as'],'attributes':_0x124cb9[_0x235d('0x1b')],'include':_0x124cb9[_0x235d('0x1c')]?_[_0x235d('0x1e')](_0x124cb9[_0x235d('0x1c')],function(_0x54499d){return{'model':db[_0x54499d[_0x235d('0x1d')]],'as':_0x54499d['as'],'attributes':_0x54499d['attributes'],'include':_0x54499d[_0x235d('0x1c')]?_[_0x235d('0x1e')](_0x54499d[_0x235d('0x1c')],function(_0x5d5af7){return{'model':db[_0x5d5af7[_0x235d('0x1d')]],'as':_0x5d5af7['as'],'attributes':_0x5d5af7[_0x235d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x235d('0x1f')](function(_0x7cf3cc){logger['info']('GetServicenowAccount',_0x127f48);logger['debug'](_0x235d('0x16'),_0x127f48,JSON[_0x235d('0x11')](_0x7cf3cc));_0x3c30c7(_0x7cf3cc);})[_0x235d('0x15')](function(_0xab763e){logger[_0x235d('0x12')]('GetServicenowAccount',_0xab763e[_0x235d('0x14')],_0x127f48);_0x32a4f4(_0x44a5c0['error'](0x1f4,_0xab763e['message']));});});};exports['ShowServicenowAccount']=function(_0x2d2b45){var _0x367894=this;return new Promise(function(_0xb0bdb0,_0x4d91b8){return db[_0x235d('0x17')]['find']({'raw':_0x2d2b45[_0x235d('0x19')]?_0x2d2b45[_0x235d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2d2b45[_0x235d('0x19')]?_0x2d2b45[_0x235d('0x19')][_0x235d('0x20')]||null:null,'attributes':_0x2d2b45['options']?_0x2d2b45[_0x235d('0x19')][_0x235d('0x1b')]||null:null,'include':_0x2d2b45['options']?_0x2d2b45[_0x235d('0x19')]['include']?_['map'](_0x2d2b45['options'][_0x235d('0x1c')],function(_0x269e4a){return{'model':db[_0x269e4a['model']],'as':_0x269e4a['as'],'attributes':_0x269e4a[_0x235d('0x1b')],'include':_0x269e4a[_0x235d('0x1c')]?_['map'](_0x269e4a[_0x235d('0x1c')],function(_0x25f351){return{'model':db[_0x25f351[_0x235d('0x1d')]],'as':_0x25f351['as'],'attributes':_0x25f351['attributes'],'include':_0x25f351[_0x235d('0x1c')]?_[_0x235d('0x1e')](_0x25f351[_0x235d('0x1c')],function(_0x68e483){return{'model':db[_0x68e483[_0x235d('0x1d')]],'as':_0x68e483['as'],'attributes':_0x68e483[_0x235d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x293c9f){logger[_0x235d('0xd')](_0x235d('0x21'),_0x2d2b45);logger[_0x235d('0x10')](_0x235d('0x21'),_0x2d2b45,JSON[_0x235d('0x11')](_0x293c9f));_0xb0bdb0(_0x293c9f);})[_0x235d('0x15')](function(_0x381cd7){logger[_0x235d('0x12')]('ShowServicenowAccount',_0x381cd7['message'],_0x2d2b45);_0x4d91b8(_0x367894[_0x235d('0x12')](0x1f4,_0x381cd7[_0x235d('0x14')]));});});};
\ No newline at end of file