Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / smsInteraction / smsInteraction.rpc.js
index 2f7b34e..4ee7b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95c8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x95c8,0xa3));var _0x895c=function(_0x5634e2,_0xcbc3d6){_0x5634e2=_0x5634e2-0x0;var _0x50b5f2=_0x95c8[_0x5634e2];return _0x50b5f2;};'use strict';var _=require(_0x895c('0x0'));var util=require(_0x895c('0x1'));var moment=require(_0x895c('0x2'));var BPromise=require(_0x895c('0x3'));var rs=require(_0x895c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x895c('0x5'))['db'];var utils=require(_0x895c('0x6'));var logger=require(_0x895c('0x7'))(_0x895c('0x8'));var config=require(_0x895c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x895c('0xa')][_0x895c('0xb')]({'port':0x232a});config['redis']=_[_0x895c('0xc')](config['redis'],{'host':_0x895c('0xd'),'port':0x18eb});var socket=require(_0x895c('0xe'))(new Redis(config['redis']));require(_0x895c('0xf'))[_0x895c('0x10')](socket);function respondWithRpcPromise(_0x1d61d7,_0xe7dd8b,_0x30d7d8){return new BPromise(function(_0x532535,_0x1900a2){return client[_0x895c('0x11')](_0x1d61d7,_0x30d7d8)[_0x895c('0x12')](function(_0x1cf6b3){logger[_0x895c('0x13')](_0x895c('0x14'),_0xe7dd8b,_0x895c('0x15'));logger[_0x895c('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xe7dd8b,_0x895c('0x15'),JSON[_0x895c('0x17')](_0x1cf6b3));if(_0x1cf6b3['error']){if(_0x1cf6b3[_0x895c('0x18')]['code']===0x1f4){logger[_0x895c('0x18')]('SmsInteraction,\x20%s,\x20%s',_0xe7dd8b,_0x1cf6b3[_0x895c('0x18')]['message']);return _0x1900a2(_0x1cf6b3[_0x895c('0x18')][_0x895c('0x19')]);}logger[_0x895c('0x18')]('SmsInteraction,\x20%s,\x20%s',_0xe7dd8b,_0x1cf6b3['error'][_0x895c('0x19')]);return _0x532535(_0x1cf6b3[_0x895c('0x18')][_0x895c('0x19')]);}else{logger[_0x895c('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xe7dd8b,_0x895c('0x15'));_0x532535(_0x1cf6b3[_0x895c('0x1a')]['message']);}})[_0x895c('0x1b')](function(_0x206a8a){logger[_0x895c('0x18')](_0x895c('0x14'),_0xe7dd8b,_0x206a8a);_0x1900a2(_0x206a8a);});});}exports[_0x895c('0x1c')]=function(_0x1ff4b2){var _0x14281e=this;return new Promise(function(_0x13892d,_0xc016ad){return db[_0x895c('0x1d')][_0x895c('0x1e')](_0x1ff4b2[_0x895c('0x1f')],{'raw':_0x1ff4b2[_0x895c('0x20')]?_0x1ff4b2[_0x895c('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff4b2[_0x895c('0x20')]?_0x1ff4b2[_0x895c('0x20')][_0x895c('0x21')]||null:null,'attributes':_0x1ff4b2[_0x895c('0x20')]?_0x1ff4b2[_0x895c('0x20')][_0x895c('0x22')]||null:null,'limit':_0x1ff4b2['options']?_0x1ff4b2['options'][_0x895c('0x23')]||null:null})[_0x895c('0x12')](function(_0x969ed6){logger[_0x895c('0x13')](_0x895c('0x1c'),_0x1ff4b2);logger[_0x895c('0x16')](_0x895c('0x1c'),_0x1ff4b2,JSON[_0x895c('0x17')](_0x969ed6));_0x13892d(_0x969ed6);})[_0x895c('0x1b')](function(_0x1d21f3){logger[_0x895c('0x18')](_0x895c('0x1c'),_0x1d21f3[_0x895c('0x19')],_0x1ff4b2);_0xc016ad(_0x14281e['error'](0x1f4,_0x1d21f3[_0x895c('0x19')]));});});};exports[_0x895c('0x24')]=function(_0x3ffb31){return new Promise(function(_0x3260c1,_0x2a7907){return db[_0x895c('0x1d')][_0x895c('0x25')]({'where':_0x3ffb31['options']?_0x3ffb31[_0x895c('0x20')][_0x895c('0x21')]||null:null})[_0x895c('0x12')](function(_0x446094){if(_0x446094){return _0x446094[_0x895c('0x26')](_0x3ffb31[_0x895c('0x1f')][_0x895c('0x27')],_[_0x895c('0x28')](_0x3ffb31[_0x895c('0x1f')],[_0x895c('0x27'),'id'])||{});}})['spread'](function(_0xc8de5b){logger[_0x895c('0x13')]('AddTags',_0x3ffb31);logger[_0x895c('0x16')](_0x895c('0x29'),_0x3ffb31,JSON[_0x895c('0x17')](_0xc8de5b));_0x3260c1(_0xc8de5b);})[_0x895c('0x1b')](function(_0x13aa15){logger['error'](_0x895c('0x29'),_0x13aa15[_0x895c('0x19')],_0x3ffb31);_0x2a7907(_this[_0x895c('0x18')](0x1f4,_0x13aa15[_0x895c('0x19')]));});});};
\ No newline at end of file
+var _0xc97a=['SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateSmsInteraction','update','raw','options','where','attributes','catch','AddTagsToSmsInteraction','SmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info'];(function(_0x38de9a,_0x135855){var _0x210c33=function(_0x5d3aa4){while(--_0x5d3aa4){_0x38de9a['push'](_0x38de9a['shift']());}};_0x210c33(++_0x135855);}(_0xc97a,0xcd));var _0xac97=function(_0x507ea9,_0x5894e9){_0x507ea9=_0x507ea9-0x0;var _0x8abb72=_0xc97a[_0x507ea9];return _0x8abb72;};'use strict';var _=require(_0xac97('0x0'));var util=require(_0xac97('0x1'));var moment=require(_0xac97('0x2'));var BPromise=require(_0xac97('0x3'));var rs=require(_0xac97('0x4'));var fs=require('fs');var Redis=require(_0xac97('0x5'));var db=require(_0xac97('0x6'))['db'];var utils=require(_0xac97('0x7'));var logger=require(_0xac97('0x8'))(_0xac97('0x9'));var config=require(_0xac97('0xa'));var jayson=require(_0xac97('0xb'));var client=jayson[_0xac97('0xc')][_0xac97('0xd')]({'port':0x232a});config[_0xac97('0xe')]=_['defaults'](config[_0xac97('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xac97('0xf'))(new Redis(config[_0xac97('0xe')]));require('./smsInteraction.socket')[_0xac97('0x10')](socket);function respondWithRpcPromise(_0x2abe95,_0x73c1b9,_0x3c2638){return new BPromise(function(_0x457eef,_0x29d688){return client[_0xac97('0x11')](_0x2abe95,_0x3c2638)[_0xac97('0x12')](function(_0x54d68d){logger[_0xac97('0x13')](_0xac97('0x14'),_0x73c1b9,_0xac97('0x15'));logger[_0xac97('0x16')](_0xac97('0x17'),_0x73c1b9,'request\x20sent',JSON[_0xac97('0x18')](_0x54d68d));if(_0x54d68d['error']){if(_0x54d68d[_0xac97('0x19')][_0xac97('0x1a')]===0x1f4){logger[_0xac97('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x73c1b9,_0x54d68d[_0xac97('0x19')][_0xac97('0x1b')]);return _0x29d688(_0x54d68d[_0xac97('0x19')][_0xac97('0x1b')]);}logger['error'](_0xac97('0x14'),_0x73c1b9,_0x54d68d['error'][_0xac97('0x1b')]);return _0x457eef(_0x54d68d['error'][_0xac97('0x1b')]);}else{logger[_0xac97('0x13')](_0xac97('0x14'),_0x73c1b9,_0xac97('0x15'));_0x457eef(_0x54d68d[_0xac97('0x1c')][_0xac97('0x1b')]);}})['catch'](function(_0x4b99bc){logger[_0xac97('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x73c1b9,_0x4b99bc);_0x29d688(_0x4b99bc);});});}exports[_0xac97('0x1d')]=function(_0xd55787){var _0xe86bda=this;return new Promise(function(_0x2a9987,_0x1b4fbd){return db['SmsInteraction'][_0xac97('0x1e')](_0xd55787['body'],{'raw':_0xd55787['options']?_0xd55787['options'][_0xac97('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd55787['options']?_0xd55787[_0xac97('0x20')][_0xac97('0x21')]||null:null,'attributes':_0xd55787[_0xac97('0x20')]?_0xd55787['options'][_0xac97('0x22')]||null:null,'limit':_0xd55787['options']?_0xd55787[_0xac97('0x20')]['limit']||null:null})[_0xac97('0x12')](function(_0x12b21d){logger[_0xac97('0x13')](_0xac97('0x1d'),_0xd55787);logger[_0xac97('0x16')](_0xac97('0x1d'),_0xd55787,JSON[_0xac97('0x18')](_0x12b21d));_0x2a9987(_0x12b21d);})[_0xac97('0x23')](function(_0x48c9d4){logger[_0xac97('0x19')]('UpdateSmsInteraction',_0x48c9d4['message'],_0xd55787);_0x1b4fbd(_0xe86bda[_0xac97('0x19')](0x1f4,_0x48c9d4[_0xac97('0x1b')]));});});};exports[_0xac97('0x24')]=function(_0x17efa6){return new Promise(function(_0x31b145,_0x5f439f){return db[_0xac97('0x25')][_0xac97('0x26')]({'where':_0x17efa6[_0xac97('0x20')]?_0x17efa6[_0xac97('0x20')][_0xac97('0x21')]||null:null})[_0xac97('0x12')](function(_0xb9a71e){if(_0xb9a71e){return _0xb9a71e[_0xac97('0x27')](_0x17efa6[_0xac97('0x28')][_0xac97('0x29')],_[_0xac97('0x2a')](_0x17efa6[_0xac97('0x28')],[_0xac97('0x29'),'id'])||{});}})[_0xac97('0x2b')](function(_0x3c94fb){logger[_0xac97('0x13')](_0xac97('0x2c'),_0x17efa6);logger[_0xac97('0x16')]('AddTags',_0x17efa6,JSON[_0xac97('0x18')](_0x3c94fb));_0x31b145(_0x3c94fb);})[_0xac97('0x23')](function(_0x1eefe4){logger['error'](_0xac97('0x2c'),_0x1eefe4[_0xac97('0x1b')],_0x17efa6);_0x5f439f(_this[_0xac97('0x19')](0x1f4,_0x1eefe4[_0xac97('0x1b')]));});});};
\ No newline at end of file