Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / smsInteraction / smsInteraction.rpc.js
index bf12734..bedd866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x903f=['body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags'];(function(_0x5a5b3c,_0x35ba42){var _0x463b09=function(_0x3d1cd9){while(--_0x3d1cd9){_0x5a5b3c['push'](_0x5a5b3c['shift']());}};_0x463b09(++_0x35ba42);}(_0x903f,0x8f));var _0xf903=function(_0xcd3dfc,_0x5710f0){_0xcd3dfc=_0xcd3dfc-0x0;var _0x41013e=_0x903f[_0xcd3dfc];return _0x41013e;};'use strict';var _=require(_0xf903('0x0'));var util=require(_0xf903('0x1'));var moment=require(_0xf903('0x2'));var BPromise=require(_0xf903('0x3'));var rs=require(_0xf903('0x4'));var fs=require('fs');var Redis=require(_0xf903('0x5'));var db=require(_0xf903('0x6'))['db'];var utils=require(_0xf903('0x7'));var logger=require(_0xf903('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf903('0x9'));var client=jayson['client'][_0xf903('0xa')]({'port':0x232a});config[_0xf903('0xb')]=_[_0xf903('0xc')](config[_0xf903('0xb')],{'host':_0xf903('0xd'),'port':0x18eb});var socket=require(_0xf903('0xe'))(new Redis(config['redis']));require(_0xf903('0xf'))[_0xf903('0x10')](socket);function respondWithRpcPromise(_0x529896,_0xf79aa4,_0x437298){return new BPromise(function(_0x27b772,_0x1a5967){return client[_0xf903('0x11')](_0x529896,_0x437298)[_0xf903('0x12')](function(_0x385aaf){logger[_0xf903('0x13')](_0xf903('0x14'),_0xf79aa4,_0xf903('0x15'));logger[_0xf903('0x16')](_0xf903('0x17'),_0xf79aa4,'request\x20sent',JSON[_0xf903('0x18')](_0x385aaf));if(_0x385aaf[_0xf903('0x19')]){if(_0x385aaf['error'][_0xf903('0x1a')]===0x1f4){logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);return _0x1a5967(_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);}logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x385aaf[_0xf903('0x19')][_0xf903('0x1b')]);return _0x27b772(_0x385aaf[_0xf903('0x19')]['message']);}else{logger[_0xf903('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xf79aa4,_0xf903('0x15'));_0x27b772(_0x385aaf[_0xf903('0x1c')][_0xf903('0x1b')]);}})[_0xf903('0x1d')](function(_0x4077f6){logger[_0xf903('0x19')](_0xf903('0x14'),_0xf79aa4,_0x4077f6);_0x1a5967(_0x4077f6);});});}exports[_0xf903('0x1e')]=function(_0x4e5fc){var _0x5a146a=this;return new Promise(function(_0x24e93b,_0x18ad74){return db[_0xf903('0x1f')][_0xf903('0x20')](_0x4e5fc['body'],{'raw':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc['options'][_0xf903('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc['options'][_0xf903('0x23')]||null:null,'attributes':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc[_0xf903('0x21')][_0xf903('0x24')]||null:null,'limit':_0x4e5fc[_0xf903('0x21')]?_0x4e5fc[_0xf903('0x21')][_0xf903('0x25')]||null:null})[_0xf903('0x12')](function(_0xf65c48){logger[_0xf903('0x13')]('UpdateSmsInteraction',_0x4e5fc);logger[_0xf903('0x16')](_0xf903('0x1e'),_0x4e5fc,JSON[_0xf903('0x18')](_0xf65c48));_0x24e93b(_0xf65c48);})[_0xf903('0x1d')](function(_0x142e06){logger[_0xf903('0x19')](_0xf903('0x1e'),_0x142e06[_0xf903('0x1b')],_0x4e5fc);_0x18ad74(_0x5a146a[_0xf903('0x19')](0x1f4,_0x142e06['message']));});});};exports[_0xf903('0x26')]=function(_0x2c97c7){return new Promise(function(_0x4c6ce8,_0x34a093){return db[_0xf903('0x1f')][_0xf903('0x27')]({'where':_0x2c97c7[_0xf903('0x21')]?_0x2c97c7[_0xf903('0x21')][_0xf903('0x23')]||null:null})['then'](function(_0x2847bb){if(_0x2847bb){return _0x2847bb[_0xf903('0x28')](_0x2c97c7[_0xf903('0x29')][_0xf903('0x2a')],_[_0xf903('0x2b')](_0x2c97c7[_0xf903('0x29')],[_0xf903('0x2a'),'id'])||{});}})[_0xf903('0x2c')](function(_0x5699a9){logger[_0xf903('0x13')]('AddTags',_0x2c97c7);logger['debug']('AddTags',_0x2c97c7,JSON[_0xf903('0x18')](_0x5699a9));_0x4c6ce8(_0x5699a9);})[_0xf903('0x1d')](function(_0x5b6f61){logger[_0xf903('0x19')](_0xf903('0x2d'),_0x5b6f61['message'],_0x2c97c7);_0x34a093(_this[_0xf903('0x19')](0x1f4,_0x5b6f61[_0xf903('0x1b')]));});});};
\ No newline at end of file
+var _0xdb68=['SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb68,0xc2));var _0x8db6=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xdb68[_0x3c59fc];return _0x2b78d4;};'use strict';var _=require(_0x8db6('0x0'));var util=require(_0x8db6('0x1'));var moment=require(_0x8db6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db6('0x3'));var db=require(_0x8db6('0x4'))['db'];var utils=require(_0x8db6('0x5'));var logger=require(_0x8db6('0x6'))(_0x8db6('0x7'));var config=require(_0x8db6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8db6('0x9')][_0x8db6('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8db6('0xb')],{'host':_0x8db6('0xc'),'port':0x18eb});var socket=require(_0x8db6('0xd'))(new Redis(config[_0x8db6('0xb')]));require(_0x8db6('0xe'))[_0x8db6('0xf')](socket);function respondWithRpcPromise(_0x3c7838,_0x36c3a7,_0x1cd254){return new BPromise(function(_0x1bf8ff,_0x151290){return client[_0x8db6('0x10')](_0x3c7838,_0x1cd254)['then'](function(_0x4af7a4){logger[_0x8db6('0x11')](_0x8db6('0x12'),_0x36c3a7,_0x8db6('0x13'));logger[_0x8db6('0x14')](_0x8db6('0x15'),_0x36c3a7,_0x8db6('0x13'),JSON['stringify'](_0x4af7a4));if(_0x4af7a4[_0x8db6('0x16')]){if(_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x17')]===0x1f4){logger[_0x8db6('0x16')](_0x8db6('0x12'),_0x36c3a7,_0x4af7a4[_0x8db6('0x16')]['message']);return _0x151290(_0x4af7a4['error'][_0x8db6('0x18')]);}logger[_0x8db6('0x16')](_0x8db6('0x12'),_0x36c3a7,_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x18')]);return _0x1bf8ff(_0x4af7a4[_0x8db6('0x16')][_0x8db6('0x18')]);}else{logger[_0x8db6('0x11')](_0x8db6('0x12'),_0x36c3a7,_0x8db6('0x13'));_0x1bf8ff(_0x4af7a4['result'][_0x8db6('0x18')]);}})['catch'](function(_0x70faa1){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x36c3a7,_0x70faa1);_0x151290(_0x70faa1);});});}exports[_0x8db6('0x19')]=function(_0x414bc3){var _0x4050a4=this;return new Promise(function(_0x312527,_0x3b528e){return db[_0x8db6('0x1a')][_0x8db6('0x1b')](_0x414bc3[_0x8db6('0x1c')],{'raw':_0x414bc3[_0x8db6('0x1d')]?_0x414bc3[_0x8db6('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414bc3[_0x8db6('0x1d')]?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x1e')]||null:null,'attributes':_0x414bc3['options']?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x1f')]||null:null,'limit':_0x414bc3['options']?_0x414bc3[_0x8db6('0x1d')][_0x8db6('0x20')]||null:null})['then'](function(_0xde23f7){logger['info'](_0x8db6('0x19'),_0x414bc3);logger[_0x8db6('0x14')](_0x8db6('0x19'),_0x414bc3,JSON[_0x8db6('0x21')](_0xde23f7));_0x312527(_0xde23f7);})[_0x8db6('0x22')](function(_0x4a88a5){logger[_0x8db6('0x16')](_0x8db6('0x19'),_0x4a88a5[_0x8db6('0x18')],_0x414bc3);_0x3b528e(_0x4050a4[_0x8db6('0x16')](0x1f4,_0x4a88a5[_0x8db6('0x18')]));});});};exports[_0x8db6('0x23')]=function(_0x3f3360){return new Promise(function(_0x3a6829,_0x49de37){return db[_0x8db6('0x1a')][_0x8db6('0x24')]({'where':_0x3f3360[_0x8db6('0x1d')]?_0x3f3360['options'][_0x8db6('0x1e')]||null:null})[_0x8db6('0x25')](function(_0x24fb3a){if(_0x24fb3a){return _0x24fb3a[_0x8db6('0x26')](_0x3f3360[_0x8db6('0x1c')][_0x8db6('0x27')],_[_0x8db6('0x28')](_0x3f3360[_0x8db6('0x1c')],[_0x8db6('0x27'),'id'])||{});}})[_0x8db6('0x29')](function(_0x54e4f4){logger[_0x8db6('0x11')]('AddTags',_0x3f3360);logger[_0x8db6('0x14')](_0x8db6('0x2a'),_0x3f3360,JSON[_0x8db6('0x21')](_0x54e4f4));_0x3a6829(_0x54e4f4);})['catch'](function(_0x2bf1e2){logger[_0x8db6('0x16')]('AddTags',_0x2bf1e2[_0x8db6('0x18')],_0x3f3360);_0x49de37(_this[_0x8db6('0x16')](0x1f4,_0x2bf1e2[_0x8db6('0x18')]));});});};
\ No newline at end of file