Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index c53974b..1fb57d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95cc=['fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','unknown','toLowerCase','toUpperCase','role','stringify','null','Interaction','findOne','update','then','info','catch','error','tracked','clone','omit','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x16cdc9,_0x3177bf){var _0x26a641=function(_0x50b544){while(--_0x50b544){_0x16cdc9['push'](_0x16cdc9['shift']());}};_0x26a641(++_0x3177bf);}(_0x95cc,0x163));var _0xc95c=function(_0x17d45b,_0x41abad){_0x17d45b=_0x17d45b-0x0;var _0x2755ca=_0x95cc[_0x17d45b];return _0x2755ca;};'use strict';var _=require(_0xc95c('0x0'));var db=require(_0xc95c('0x1'))['db'];var loggers={'openchannel':require(_0xc95c('0x2'))(_0xc95c('0x3')),'mail':require('../../config/logger')(_0xc95c('0x4')),'fax':require(_0xc95c('0x2'))(_0xc95c('0x5')),'sms':require(_0xc95c('0x2'))(_0xc95c('0x6')),'chat':require(_0xc95c('0x2'))(_0xc95c('0x7')),'whatsapp':require(_0xc95c('0x2'))('whatsapp-interactions')};function getInteractionId(_0x343744,_0x18023b,_0x4a0735){if(_0x343744&&_0x343744[_['upperFirst'](_0x4a0735)+_0xc95c('0x8')]){return _0x343744[_[_0xc95c('0x9')](_0x4a0735)+_0xc95c('0x8')];}else if(_0x343744&&_0x343744['id']){return _0x343744['id'];}else if(_0x18023b&&_0x18023b['id']){return _0x18023b['id'];}else{return _0xc95c('0xa');}}function log(_0x2f338c,_0x48ab11,_0x1598f9,_0x5b2134,_0x2f4af5,_0x25228a){loggers[_0x2f4af5[_0xc95c('0xb')]()][_0x2f338c]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25228a[_0xc95c('0xc')](),_0x48ab11?_0x48ab11['id']:null,_0x48ab11?_0x48ab11['name']:null,_0x48ab11?_0x48ab11[_0xc95c('0xd')]:null,getInteractionId(_0x1598f9,_0x5b2134,_0x2f4af5),_0x1598f9?JSON[_0xc95c('0xe')](_0x1598f9):_0xc95c('0xf'));}function updateUser(_0x2d79da,_0x5b2a4e,_0x4c1eb6,_0x472f5d,_0x5edde9){db[_[_0xc95c('0x9')](_0x472f5d)+_0xc95c('0x10')][_0xc95c('0x11')]({'where':{'id':getInteractionId(_0x5b2a4e,_0x4c1eb6,_0x472f5d)}})['then'](function(_0x4223c1){if(_0x4223c1){return _0x4223c1[_0xc95c('0x12')]({'UserId':_0x2d79da?_0x2d79da['id']:null});}})[_0xc95c('0x13')](function(_0x228ecd){if(_0x228ecd){log(_0xc95c('0x14'),_0x2d79da,_0x5b2a4e,_0x4c1eb6,_0x472f5d,_0x5edde9);}})[_0xc95c('0x15')](function(){log(_0xc95c('0x16'),_0x2d79da,_0x5b2a4e,_0x4c1eb6,_0x472f5d,_0x5edde9);});}exports[_0xc95c('0x17')]=function(_0x3e31aa,_0x57e067){return function(_0x31a7e7,_0x1262bc,_0x5d843f){var _0x5d3497=_0x31a7e7['user'];var _0x236d33={};var _0x93ac44=_0x31a7e7['query'];if(_0x236d33){_0x236d33=_[_0xc95c('0x18')](_0x31a7e7['body']);_0x236d33=_[_0xc95c('0x19')](_0x236d33,[_0xc95c('0x1a'),_0xc95c('0x1b'),_0xc95c('0x1c'),'fax',_0xc95c('0x1d')]);}updateUser(_0x5d3497,_0x236d33,_0x93ac44,_0x3e31aa,_0x57e067);_0x5d843f(null);};};
\ No newline at end of file
+var _0x241f=['Interaction','findOne','then','info','error','tracked','query','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0x3fa163,_0x13729c){var _0x4f99a4=function(_0x5f1018){while(--_0x5f1018){_0x3fa163['push'](_0x3fa163['shift']());}};_0x4f99a4(++_0x13729c);}(_0x241f,0x1e8));var _0xf241=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x241f[_0x12a62c];return _0x268a58;};'use strict';var _=require(_0xf241('0x0'));var db=require(_0xf241('0x1'))['db'];var loggers={'openchannel':require(_0xf241('0x2'))(_0xf241('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xf241('0x2'))('fax-interactions'),'sms':require(_0xf241('0x2'))(_0xf241('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf241('0x5'))};function getInteractionId(_0x229fb9,_0x374573,_0x55c8a8){if(_0x229fb9&&_0x229fb9[_[_0xf241('0x6')](_0x55c8a8)+_0xf241('0x7')]){return _0x229fb9[_['upperFirst'](_0x55c8a8)+_0xf241('0x7')];}else if(_0x229fb9&&_0x229fb9['id']){return _0x229fb9['id'];}else if(_0x374573&&_0x374573['id']){return _0x374573['id'];}else{return _0xf241('0x8');}}function log(_0x4b9cd2,_0x16fc41,_0x2430c6,_0x2c166f,_0x2e910c,_0x5f2ad9){loggers[_0x2e910c[_0xf241('0x9')]()][_0x4b9cd2](_0xf241('0xa'),_0x5f2ad9[_0xf241('0xb')](),_0x16fc41?_0x16fc41['id']:null,_0x16fc41?_0x16fc41[_0xf241('0xc')]:null,_0x16fc41?_0x16fc41[_0xf241('0xd')]:null,getInteractionId(_0x2430c6,_0x2c166f,_0x2e910c),_0x2430c6?JSON[_0xf241('0xe')](_0x2430c6):_0xf241('0xf'));}function updateUser(_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62){db[_['upperFirst'](_0xe28e71)+_0xf241('0x10')][_0xf241('0x11')]({'where':{'id':getInteractionId(_0x313013,_0x3f52a0,_0xe28e71)}})[_0xf241('0x12')](function(_0xc7ad33){if(_0xc7ad33){return _0xc7ad33['update']({'UserId':_0x4b8cd2?_0x4b8cd2['id']:null});}})['then'](function(_0x44ff9c){if(_0x44ff9c){log(_0xf241('0x13'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);}})['catch'](function(){log(_0xf241('0x14'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);});}exports[_0xf241('0x15')]=function(_0x23b6d9,_0x364ed2){return function(_0x223d1f,_0x48dd49,_0x42c209){var _0x3271d4=_0x223d1f['user'];var _0x3f997a={};var _0x1226a8=_0x223d1f[_0xf241('0x16')];if(_0x3f997a){_0x3f997a=_['clone'](_0x223d1f['body']);_0x3f997a=_['omit'](_0x3f997a,[_0xf241('0x17'),_0xf241('0x18'),_0xf241('0x19'),_0xf241('0x1a'),_0xf241('0x1b')]);}updateUser(_0x3271d4,_0x3f997a,_0x1226a8,_0x23b6d9,_0x364ed2);_0x42c209(null);};};
\ No newline at end of file