Built motion from commit (unavailable).|2.0.73
[motion2.git] / server / api / smsInteraction / smsInteraction.rpc.js
index 96b4f66..98af931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9885=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','stringify','ids','spread','AddTags','lodash','util'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9885,0x1ba));var _0x5988=function(_0x142fd9,_0x4b90e2){_0x142fd9=_0x142fd9-0x0;var _0x1ce1f0=_0x9885[_0x142fd9];return _0x1ce1f0;};'use strict';var _=require(_0x5988('0x0'));var util=require(_0x5988('0x1'));var moment=require('moment');var BPromise=require(_0x5988('0x2'));var rs=require(_0x5988('0x3'));var fs=require('fs');var db=require(_0x5988('0x4'))['db'];var utils=require(_0x5988('0x5'));var logger=require('../../config/logger')(_0x5988('0x6'));var config=require(_0x5988('0x7'));var jayson=require(_0x5988('0x8'));var client=jayson[_0x5988('0x9')][_0x5988('0xa')]({'port':0x232a});var socket=require('socket.io-emitter')({'host':'localhost','port':0x18eb});require(_0x5988('0xb'))[_0x5988('0xc')](socket);function respondWithRpcPromise(_0x4cea70,_0x1afffb,_0x21edbf){return new BPromise(function(_0x58b2c5,_0x1482ff){return client[_0x5988('0xd')](_0x4cea70,_0x21edbf)[_0x5988('0xe')](function(_0x8684a5){logger[_0x5988('0xf')](_0x5988('0x10'),_0x1afffb,_0x5988('0x11'));logger[_0x5988('0x12')](_0x5988('0x13'),_0x1afffb,'request\x20sent',JSON['stringify'](_0x8684a5));if(_0x8684a5[_0x5988('0x14')]){if(_0x8684a5['error'][_0x5988('0x15')]===0x1f4){logger[_0x5988('0x14')](_0x5988('0x10'),_0x1afffb,_0x8684a5['error'][_0x5988('0x16')]);return _0x1482ff(_0x8684a5[_0x5988('0x14')][_0x5988('0x16')]);}logger['error'](_0x5988('0x10'),_0x1afffb,_0x8684a5[_0x5988('0x14')][_0x5988('0x16')]);return _0x58b2c5(_0x8684a5[_0x5988('0x14')][_0x5988('0x16')]);}else{logger[_0x5988('0xf')](_0x5988('0x10'),_0x1afffb,_0x5988('0x11'));_0x58b2c5(_0x8684a5[_0x5988('0x17')]['message']);}})[_0x5988('0x18')](function(_0x1e4c35){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1afffb,_0x1e4c35);_0x1482ff(_0x1e4c35);});});}exports[_0x5988('0x19')]=function(_0x18e1cf){var _0x48a5eb=this;return new Promise(function(_0x35aa44,_0xd73110){return db[_0x5988('0x1a')][_0x5988('0x1b')](_0x18e1cf[_0x5988('0x1c')],{'raw':_0x18e1cf[_0x5988('0x1d')]?_0x18e1cf[_0x5988('0x1d')][_0x5988('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18e1cf['options']?_0x18e1cf['options'][_0x5988('0x1f')]||null:null,'attributes':_0x18e1cf[_0x5988('0x1d')]?_0x18e1cf[_0x5988('0x1d')][_0x5988('0x20')]||null:null,'limit':_0x18e1cf[_0x5988('0x1d')]?_0x18e1cf['options']['limit']||null:null})[_0x5988('0xe')](function(_0x27b9e7){logger[_0x5988('0xf')](_0x5988('0x19'),_0x18e1cf);logger[_0x5988('0x12')](_0x5988('0x19'),_0x18e1cf,JSON[_0x5988('0x21')](_0x27b9e7));_0x35aa44(_0x27b9e7);})['catch'](function(_0x6c2942){logger[_0x5988('0x14')](_0x5988('0x19'),_0x6c2942[_0x5988('0x16')],_0x18e1cf);_0xd73110(_0x48a5eb[_0x5988('0x14')](0x1f4,_0x6c2942[_0x5988('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x395c09){return new Promise(function(_0x4d2c22,_0x17e680){return db[_0x5988('0x1a')]['find']({'where':_0x395c09['options']?_0x395c09['options'][_0x5988('0x1f')]||null:null})[_0x5988('0xe')](function(_0xeb3a9f){if(_0xeb3a9f){return _0xeb3a9f['addTags'](_0x395c09[_0x5988('0x1c')][_0x5988('0x22')],_['omit'](_0x395c09[_0x5988('0x1c')],['ids','id'])||{});}})[_0x5988('0x23')](function(_0xbc495d){logger[_0x5988('0xf')](_0x5988('0x24'),_0x395c09);logger[_0x5988('0x12')](_0x5988('0x24'),_0x395c09,JSON[_0x5988('0x21')](_0xbc495d));_0x4d2c22(_0xbc495d);})[_0x5988('0x18')](function(_0x449ed7){logger[_0x5988('0x14')](_0x5988('0x24'),_0x449ed7[_0x5988('0x16')],_0x395c09);_0x17e680(_this[_0x5988('0x14')](0x1f4,_0x449ed7[_0x5988('0x16')]));});});};
\ No newline at end of file
+var _0x6f91=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','localhost','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','then','debug','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2bac06,_0xe7cc4c){var _0xde9d11=function(_0x245088){while(--_0x245088){_0x2bac06['push'](_0x2bac06['shift']());}};_0xde9d11(++_0xe7cc4c);}(_0x6f91,0xc8));var _0x16f9=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x6f91[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require('lodash');var util=require(_0x16f9('0x0'));var moment=require(_0x16f9('0x1'));var BPromise=require(_0x16f9('0x2'));var rs=require(_0x16f9('0x3'));var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x16f9('0x4'));var logger=require(_0x16f9('0x5'))(_0x16f9('0x6'));var config=require(_0x16f9('0x7'));var jayson=require(_0x16f9('0x8'));var client=jayson[_0x16f9('0x9')][_0x16f9('0xa')]({'port':0x232a});var socket=require(_0x16f9('0xb'))({'host':_0x16f9('0xc'),'port':0x18eb});require('./smsInteraction.socket')[_0x16f9('0xd')](socket);function respondWithRpcPromise(_0x13f441,_0x5cd6e9,_0x400e3c){return new BPromise(function(_0xb66ac0,_0x4a2713){return client[_0x16f9('0xe')](_0x13f441,_0x400e3c)['then'](function(_0xbfeab){logger[_0x16f9('0xf')](_0x16f9('0x10'),_0x5cd6e9,_0x16f9('0x11'));logger['debug'](_0x16f9('0x12'),_0x5cd6e9,'request\x20sent',JSON['stringify'](_0xbfeab));if(_0xbfeab['error']){if(_0xbfeab[_0x16f9('0x13')]['code']===0x1f4){logger[_0x16f9('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5cd6e9,_0xbfeab[_0x16f9('0x13')][_0x16f9('0x14')]);return _0x4a2713(_0xbfeab['error'][_0x16f9('0x14')]);}logger[_0x16f9('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5cd6e9,_0xbfeab['error'][_0x16f9('0x14')]);return _0xb66ac0(_0xbfeab[_0x16f9('0x13')]['message']);}else{logger[_0x16f9('0xf')](_0x16f9('0x10'),_0x5cd6e9,_0x16f9('0x11'));_0xb66ac0(_0xbfeab['result'][_0x16f9('0x14')]);}})[_0x16f9('0x15')](function(_0x408a97){logger[_0x16f9('0x13')](_0x16f9('0x10'),_0x5cd6e9,_0x408a97);_0x4a2713(_0x408a97);});});}exports[_0x16f9('0x16')]=function(_0x326a45){var _0x20d197=this;return new Promise(function(_0x2c7299,_0x32d34c){return db[_0x16f9('0x17')][_0x16f9('0x18')](_0x326a45[_0x16f9('0x19')],{'raw':_0x326a45[_0x16f9('0x1a')]?_0x326a45[_0x16f9('0x1a')][_0x16f9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x326a45[_0x16f9('0x1a')]?_0x326a45[_0x16f9('0x1a')][_0x16f9('0x1c')]||null:null,'attributes':_0x326a45[_0x16f9('0x1a')]?_0x326a45[_0x16f9('0x1a')]['attributes']||null:null,'limit':_0x326a45[_0x16f9('0x1a')]?_0x326a45[_0x16f9('0x1a')][_0x16f9('0x1d')]||null:null})[_0x16f9('0x1e')](function(_0x37a2f6){logger[_0x16f9('0xf')](_0x16f9('0x16'),_0x326a45);logger[_0x16f9('0x1f')](_0x16f9('0x16'),_0x326a45,JSON[_0x16f9('0x20')](_0x37a2f6));_0x2c7299(_0x37a2f6);})[_0x16f9('0x15')](function(_0x2cc209){logger[_0x16f9('0x13')](_0x16f9('0x16'),_0x2cc209['message'],_0x326a45);_0x32d34c(_0x20d197[_0x16f9('0x13')](0x1f4,_0x2cc209[_0x16f9('0x14')]));});});};exports[_0x16f9('0x21')]=function(_0x4cef36){return new Promise(function(_0x17358d,_0x2b1fc2){return db['SmsInteraction'][_0x16f9('0x22')]({'where':_0x4cef36['options']?_0x4cef36['options'][_0x16f9('0x1c')]||null:null})[_0x16f9('0x1e')](function(_0x2f6944){if(_0x2f6944){return _0x2f6944[_0x16f9('0x23')](_0x4cef36[_0x16f9('0x19')][_0x16f9('0x24')],_[_0x16f9('0x25')](_0x4cef36[_0x16f9('0x19')],[_0x16f9('0x24'),'id'])||{});}})[_0x16f9('0x26')](function(_0x3183d8){logger['info'](_0x16f9('0x27'),_0x4cef36);logger[_0x16f9('0x1f')](_0x16f9('0x27'),_0x4cef36,JSON['stringify'](_0x3183d8));_0x17358d(_0x3183d8);})[_0x16f9('0x15')](function(_0x2b0972){logger[_0x16f9('0x13')](_0x16f9('0x27'),_0x2b0972[_0x16f9('0x14')],_0x4cef36);_0x2b1fc2(_this[_0x16f9('0x13')](0x1f4,_0x2b0972[_0x16f9('0x14')]));});});};
\ No newline at end of file