Built motion from commit f67b3b02.|2.6.31
[motion2.git] / server / api / smsInteraction / smsInteraction.rpc.js
index fa7d09e..c4f87e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x159c=['addTags','body','ids','omit','spread','AddTags','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','limit','find'];(function(_0x286b7a,_0x2c27f0){var _0x1a6fe2=function(_0xc1326f){while(--_0xc1326f){_0x286b7a['push'](_0x286b7a['shift']());}};_0x1a6fe2(++_0x2c27f0);}(_0x159c,0x1aa));var _0xc159=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x159c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc159('0x0'));var BPromise=require(_0xc159('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc159('0x2'))(_0xc159('0x3'));var config=require(_0xc159('0x4'));var jayson=require(_0xc159('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xc159('0x6')]=_[_0xc159('0x7')](config['redis'],{'host':_0xc159('0x8'),'port':0x18eb});var socket=require(_0xc159('0x9'))(new Redis(config[_0xc159('0x6')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x53f342,_0x46ec2e,_0x5ab902){return new BPromise(function(_0x35e773,_0xfbb92c){return client['request'](_0x53f342,_0x5ab902)[_0xc159('0xa')](function(_0x549e28){logger[_0xc159('0xb')](_0xc159('0xc'),_0x46ec2e,_0xc159('0xd'));logger[_0xc159('0xe')](_0xc159('0xf'),_0x46ec2e,_0xc159('0xd'),JSON[_0xc159('0x10')](_0x549e28));if(_0x549e28[_0xc159('0x11')]){if(_0x549e28['error']['code']===0x1f4){logger[_0xc159('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x46ec2e,_0x549e28[_0xc159('0x11')][_0xc159('0x12')]);return _0xfbb92c(_0x549e28['error']['message']);}logger['error'](_0xc159('0xc'),_0x46ec2e,_0x549e28['error'][_0xc159('0x12')]);return _0x35e773(_0x549e28[_0xc159('0x11')][_0xc159('0x12')]);}else{logger[_0xc159('0xb')](_0xc159('0xc'),_0x46ec2e,_0xc159('0xd'));_0x35e773(_0x549e28[_0xc159('0x13')][_0xc159('0x12')]);}})[_0xc159('0x14')](function(_0x255bdc){logger[_0xc159('0x11')](_0xc159('0xc'),_0x46ec2e,_0x255bdc);_0xfbb92c(_0x255bdc);});});}exports[_0xc159('0x15')]=function(_0x48cd9c){var _0x25fc87=this;return new Promise(function(_0x44ad47,_0x1b1888){return db[_0xc159('0x16')][_0xc159('0x17')](_0x48cd9c['body'],{'raw':_0x48cd9c[_0xc159('0x18')]?_0x48cd9c['options'][_0xc159('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48cd9c[_0xc159('0x18')]?_0x48cd9c[_0xc159('0x18')][_0xc159('0x1a')]||null:null,'attributes':_0x48cd9c[_0xc159('0x18')]?_0x48cd9c[_0xc159('0x18')]['attributes']||null:null,'limit':_0x48cd9c[_0xc159('0x18')]?_0x48cd9c[_0xc159('0x18')][_0xc159('0x1b')]||null:null})[_0xc159('0xa')](function(_0x4d2289){logger[_0xc159('0xb')](_0xc159('0x15'),_0x48cd9c);logger[_0xc159('0xe')](_0xc159('0x15'),_0x48cd9c,JSON[_0xc159('0x10')](_0x4d2289));_0x44ad47(_0x4d2289);})[_0xc159('0x14')](function(_0x2ca39c){logger[_0xc159('0x11')]('UpdateSmsInteraction',_0x2ca39c['message'],_0x48cd9c);_0x1b1888(_0x25fc87[_0xc159('0x11')](0x1f4,_0x2ca39c[_0xc159('0x12')]));});});};exports['AddTagsToSmsInteraction']=function(_0x38ec01){return new Promise(function(_0x3e5798,_0x373b91){return db['SmsInteraction'][_0xc159('0x1c')]({'where':_0x38ec01[_0xc159('0x18')]?_0x38ec01[_0xc159('0x18')]['where']||null:null})[_0xc159('0xa')](function(_0x3fa1e8){if(_0x3fa1e8){return _0x3fa1e8[_0xc159('0x1d')](_0x38ec01[_0xc159('0x1e')][_0xc159('0x1f')],_[_0xc159('0x20')](_0x38ec01[_0xc159('0x1e')],[_0xc159('0x1f'),'id'])||{});}})[_0xc159('0x21')](function(_0x12f50b){logger[_0xc159('0xb')](_0xc159('0x22'),_0x38ec01);logger[_0xc159('0xe')](_0xc159('0x22'),_0x38ec01,JSON[_0xc159('0x10')](_0x12f50b));_0x3e5798(_0x12f50b);})['catch'](function(_0x51f495){logger['error'](_0xc159('0x22'),_0x51f495[_0xc159('0x12')],_0x38ec01);_0x373b91(_this[_0xc159('0x11')](0x1f4,_0x51f495['message']));});});};
\ No newline at end of file
+var _0x8f9b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../config/utils'];(function(_0x1f9899,_0x418798){var _0x119015=function(_0x44a283){while(--_0x44a283){_0x1f9899['push'](_0x1f9899['shift']());}};_0x119015(++_0x418798);}(_0x8f9b,0x143));var _0xb8f9=function(_0x9509bc,_0x55b276){_0x9509bc=_0x9509bc-0x0;var _0xe1a8ea=_0x8f9b[_0x9509bc];return _0xe1a8ea;};'use strict';var _=require(_0xb8f9('0x0'));var util=require(_0xb8f9('0x1'));var moment=require(_0xb8f9('0x2'));var BPromise=require(_0xb8f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8f9('0x4'));var logger=require(_0xb8f9('0x5'))(_0xb8f9('0x6'));var config=require(_0xb8f9('0x7'));var jayson=require(_0xb8f9('0x8'));var client=jayson[_0xb8f9('0x9')][_0xb8f9('0xa')]({'port':0x232a});config['redis']=_[_0xb8f9('0xb')](config[_0xb8f9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb8f9('0xc')]));require(_0xb8f9('0xd'))['register'](socket);function respondWithRpcPromise(_0x58125d,_0x40859b,_0x4bab0e){return new BPromise(function(_0x2a4556,_0x753764){return client[_0xb8f9('0xe')](_0x58125d,_0x4bab0e)[_0xb8f9('0xf')](function(_0x30eb53){logger[_0xb8f9('0x10')](_0xb8f9('0x11'),_0x40859b,'request\x20sent');logger[_0xb8f9('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x40859b,_0xb8f9('0x13'),JSON[_0xb8f9('0x14')](_0x30eb53));if(_0x30eb53[_0xb8f9('0x15')]){if(_0x30eb53[_0xb8f9('0x15')][_0xb8f9('0x16')]===0x1f4){logger['error'](_0xb8f9('0x11'),_0x40859b,_0x30eb53['error']['message']);return _0x753764(_0x30eb53[_0xb8f9('0x15')]['message']);}logger[_0xb8f9('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x40859b,_0x30eb53[_0xb8f9('0x15')]['message']);return _0x2a4556(_0x30eb53[_0xb8f9('0x15')][_0xb8f9('0x17')]);}else{logger[_0xb8f9('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x40859b,'request\x20sent');_0x2a4556(_0x30eb53[_0xb8f9('0x18')][_0xb8f9('0x17')]);}})['catch'](function(_0x2fa5d3){logger[_0xb8f9('0x15')](_0xb8f9('0x11'),_0x40859b,_0x2fa5d3);_0x753764(_0x2fa5d3);});});}exports[_0xb8f9('0x19')]=function(_0x1c10e2){var _0x363ea9=this;return new Promise(function(_0x211aa4,_0x1afd8f){return db[_0xb8f9('0x1a')][_0xb8f9('0x1b')](_0x1c10e2[_0xb8f9('0x1c')],{'raw':_0x1c10e2[_0xb8f9('0x1d')]?_0x1c10e2[_0xb8f9('0x1d')][_0xb8f9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c10e2[_0xb8f9('0x1d')]?_0x1c10e2[_0xb8f9('0x1d')][_0xb8f9('0x1f')]||null:null,'attributes':_0x1c10e2[_0xb8f9('0x1d')]?_0x1c10e2[_0xb8f9('0x1d')][_0xb8f9('0x20')]||null:null,'limit':_0x1c10e2[_0xb8f9('0x1d')]?_0x1c10e2[_0xb8f9('0x1d')]['limit']||null:null})[_0xb8f9('0xf')](function(_0x28081f){logger[_0xb8f9('0x10')](_0xb8f9('0x19'),_0x1c10e2);logger[_0xb8f9('0x12')](_0xb8f9('0x19'),_0x1c10e2,JSON['stringify'](_0x28081f));_0x211aa4(_0x28081f);})[_0xb8f9('0x21')](function(_0x20b03d){logger[_0xb8f9('0x15')](_0xb8f9('0x19'),_0x20b03d[_0xb8f9('0x17')],_0x1c10e2);_0x1afd8f(_0x363ea9['error'](0x1f4,_0x20b03d[_0xb8f9('0x17')]));});});};exports[_0xb8f9('0x22')]=function(_0x43f1fd){return new Promise(function(_0x59fd86,_0x42b430){return db['SmsInteraction'][_0xb8f9('0x23')]({'where':_0x43f1fd[_0xb8f9('0x1d')]?_0x43f1fd[_0xb8f9('0x1d')][_0xb8f9('0x1f')]||null:null})[_0xb8f9('0xf')](function(_0x381428){if(_0x381428){return _0x381428[_0xb8f9('0x24')](_0x43f1fd[_0xb8f9('0x1c')][_0xb8f9('0x25')],_[_0xb8f9('0x26')](_0x43f1fd[_0xb8f9('0x1c')],[_0xb8f9('0x25'),'id'])||{});}})[_0xb8f9('0x27')](function(_0x4f8814){logger[_0xb8f9('0x10')](_0xb8f9('0x28'),_0x43f1fd);logger[_0xb8f9('0x12')](_0xb8f9('0x28'),_0x43f1fd,JSON[_0xb8f9('0x14')](_0x4f8814));_0x59fd86(_0x4f8814);})[_0xb8f9('0x21')](function(_0x1d4fe0){logger[_0xb8f9('0x15')](_0xb8f9('0x28'),_0x1d4fe0[_0xb8f9('0x17')],_0x43f1fd);_0x42b430(_this[_0xb8f9('0x15')](0x1f4,_0x1d4fe0[_0xb8f9('0x17')]));});});};
\ No newline at end of file