Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / faxMessage / faxMessage.rpc.js
index 3787efb..e8b6967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa862=['update','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa862,0x175));var _0x2a86=function(_0x46369a,_0x141daa){_0x46369a=_0x46369a-0x0;var _0x59e91d=_0xa862[_0x46369a];return _0x59e91d;};'use strict';var _=require('lodash');var util=require(_0x2a86('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a86('0x1'));var fs=require('fs');var Redis=require(_0x2a86('0x2'));var db=require(_0x2a86('0x3'))['db'];var utils=require(_0x2a86('0x4'));var logger=require(_0x2a86('0x5'))('rpc');var config=require(_0x2a86('0x6'));var jayson=require(_0x2a86('0x7'));var client=jayson[_0x2a86('0x8')][_0x2a86('0x9')]({'port':0x232a});config[_0x2a86('0xa')]=_[_0x2a86('0xb')](config[_0x2a86('0xa')],{'host':_0x2a86('0xc'),'port':0x18eb});var socket=require(_0x2a86('0xd'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x2a86('0xe')](socket);function respondWithRpcPromise(_0x5c40bd,_0x2b19c6,_0x1abd58){return new BPromise(function(_0x102441,_0x5d6eab){return client[_0x2a86('0xf')](_0x5c40bd,_0x1abd58)[_0x2a86('0x10')](function(_0x188410){logger[_0x2a86('0x11')](_0x2a86('0x12'),_0x2b19c6,_0x2a86('0x13'));logger['debug'](_0x2a86('0x14'),_0x2b19c6,_0x2a86('0x13'),JSON[_0x2a86('0x15')](_0x188410));if(_0x188410[_0x2a86('0x16')]){if(_0x188410[_0x2a86('0x16')][_0x2a86('0x17')]===0x1f4){logger[_0x2a86('0x16')](_0x2a86('0x12'),_0x2b19c6,_0x188410[_0x2a86('0x16')][_0x2a86('0x18')]);return _0x5d6eab(_0x188410[_0x2a86('0x16')][_0x2a86('0x18')]);}logger[_0x2a86('0x16')](_0x2a86('0x12'),_0x2b19c6,_0x188410[_0x2a86('0x16')]['message']);return _0x102441(_0x188410[_0x2a86('0x16')][_0x2a86('0x18')]);}else{logger[_0x2a86('0x11')](_0x2a86('0x12'),_0x2b19c6,_0x2a86('0x13'));_0x102441(_0x188410[_0x2a86('0x19')][_0x2a86('0x18')]);}})[_0x2a86('0x1a')](function(_0x40735c){logger[_0x2a86('0x16')](_0x2a86('0x12'),_0x2b19c6,_0x40735c);_0x5d6eab(_0x40735c);});});}exports[_0x2a86('0x1b')]=function(_0x34b592){var _0x28f9dc=this;return new Promise(function(_0x274220,_0x18bc69){return db[_0x2a86('0x1c')][_0x2a86('0x1d')](_0x34b592[_0x2a86('0x1e')],{'raw':_0x34b592[_0x2a86('0x1f')]?_0x34b592[_0x2a86('0x1f')][_0x2a86('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x39d6e6){logger['info'](_0x2a86('0x1b'),_0x34b592);logger['debug'](_0x2a86('0x1b'),_0x34b592,JSON[_0x2a86('0x15')](_0x39d6e6));_0x274220(_0x39d6e6);})[_0x2a86('0x1a')](function(_0x521241){logger[_0x2a86('0x16')](_0x2a86('0x1b'),_0x521241['message'],_0x34b592);_0x18bc69(_0x28f9dc[_0x2a86('0x16')](0x1f4,_0x521241[_0x2a86('0x18')]));});});};exports[_0x2a86('0x21')]=function(_0x272d48){var _0x44fe5b=this;return new Promise(function(_0x1c83b6,_0x27be08){return db['FaxMessage'][_0x2a86('0x22')](_0x272d48[_0x2a86('0x1e')],{'raw':_0x272d48['options']?_0x272d48[_0x2a86('0x1f')][_0x2a86('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272d48['options']?_0x272d48[_0x2a86('0x1f')]['where']||null:null,'attributes':_0x272d48[_0x2a86('0x1f')]?_0x272d48['options'][_0x2a86('0x23')]||null:null,'limit':_0x272d48['options']?_0x272d48[_0x2a86('0x1f')][_0x2a86('0x24')]||null:null})['then'](function(_0x475f66){logger[_0x2a86('0x11')](_0x2a86('0x21'),_0x272d48);logger['debug']('UpdateFaxMessage',_0x272d48,JSON[_0x2a86('0x15')](_0x475f66));_0x1c83b6(_0x475f66);})[_0x2a86('0x1a')](function(_0x22d278){logger['error'](_0x2a86('0x21'),_0x22d278['message'],_0x272d48);_0x27be08(_0x44fe5b['error'](0x1f4,_0x22d278['message']));});});};
\ No newline at end of file
+var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x102174,_0x5c5944){_0x102174=_0x102174-0x0;var _0x23934f=_0x5fd1[_0x102174];return _0x23934f;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});};
\ No newline at end of file