Built motion from commit 497d3d92.|2.5.43
[motion2.git] / server / components / interaction / service.js
index 89ac603..ef3faf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ed=['findOne','update','then','info','catch','user','query','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction'];(function(_0x3e1e54,_0x5080b3){var _0x191e48=function(_0x596441){while(--_0x596441){_0x3e1e54['push'](_0x3e1e54['shift']());}};_0x191e48(++_0x5080b3);}(_0xf7ed,0x1a1));var _0xdf7e=function(_0x2a0c43,_0x2e8169){_0x2a0c43=_0x2a0c43-0x0;var _0xc9de8a=_0xf7ed[_0x2a0c43];return _0xc9de8a;};'use strict';var _=require('lodash');var db=require(_0xdf7e('0x0'))['db'];var loggers={'openchannel':require(_0xdf7e('0x1'))('openchannel-interactions'),'mail':require(_0xdf7e('0x1'))(_0xdf7e('0x2')),'fax':require('../../config/logger')(_0xdf7e('0x3')),'sms':require(_0xdf7e('0x1'))('sms-interactions'),'chat':require(_0xdf7e('0x1'))(_0xdf7e('0x4')),'whatsapp':require(_0xdf7e('0x1'))('whatsapp-interactions')};function getInteractionId(_0x1d5a38,_0x381f27,_0x196ef8){if(_0x1d5a38&&_0x1d5a38[_[_0xdf7e('0x5')](_0x196ef8)+'InteractionId']){return _0x1d5a38[_[_0xdf7e('0x5')](_0x196ef8)+_0xdf7e('0x6')];}else if(_0x1d5a38&&_0x1d5a38['id']){return _0x1d5a38['id'];}else if(_0x381f27&&_0x381f27['id']){return _0x381f27['id'];}else{return _0xdf7e('0x7');}}function log(_0x40a442,_0x475633,_0x3c0032,_0x3d1560,_0x19eb7e,_0x4614f1){loggers[_0x19eb7e[_0xdf7e('0x8')]()][_0x40a442](_0xdf7e('0x9'),_0x4614f1[_0xdf7e('0xa')](),_0x475633?_0x475633['id']:null,_0x475633?_0x475633[_0xdf7e('0xb')]:null,_0x475633?_0x475633[_0xdf7e('0xc')]:null,getInteractionId(_0x3c0032,_0x3d1560,_0x19eb7e),_0x3c0032?JSON[_0xdf7e('0xd')](_0x3c0032):'null');}function updateUser(_0x2a592c,_0x536927,_0x22e411,_0xe0068a,_0x500475){db[_[_0xdf7e('0x5')](_0xe0068a)+_0xdf7e('0xe')][_0xdf7e('0xf')]({'where':{'id':getInteractionId(_0x536927,_0x22e411,_0xe0068a)}})['then'](function(_0x280380){if(_0x280380){return _0x280380[_0xdf7e('0x10')]({'UserId':_0x2a592c?_0x2a592c['id']:null});}})[_0xdf7e('0x11')](function(_0x39212f){if(_0x39212f){log(_0xdf7e('0x12'),_0x2a592c,_0x536927,_0x22e411,_0xe0068a,_0x500475);}})[_0xdf7e('0x13')](function(){log('error',_0x2a592c,_0x536927,_0x22e411,_0xe0068a,_0x500475);});}exports['tracked']=function(_0x3a7405,_0x3dfef7){return function(_0x45b762,_0x56e101,_0x18645b){var _0x1050c0=_0x45b762[_0xdf7e('0x14')];var _0x25c9a4={};var _0x41083d=_0x45b762[_0xdf7e('0x15')];if(_0x25c9a4){_0x25c9a4=_['clone'](_0x45b762['body']);_0x25c9a4=_[_0xdf7e('0x16')](_0x25c9a4,['body',_0xdf7e('0x17'),_0xdf7e('0x18'),_0xdf7e('0x19'),_0xdf7e('0x1a')]);}updateUser(_0x1050c0,_0x25c9a4,_0x41083d,_0x3a7405,_0x3dfef7);_0x18645b(null);};};
\ No newline at end of file
+var _0x5065=['../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','findOne','update','info','error','user','query','clone','body','omit','phone','fax','../../mysqldb','openchannel-interactions'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5065,0x1ae));var _0x5506=function(_0xc3508c,_0x20d636){_0xc3508c=_0xc3508c-0x0;var _0x24680d=_0x5065[_0xc3508c];return _0x24680d;};'use strict';var _=require('lodash');var db=require(_0x5506('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x5506('0x1')),'mail':require(_0x5506('0x2'))(_0x5506('0x3')),'fax':require(_0x5506('0x2'))(_0x5506('0x4')),'sms':require(_0x5506('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x5506('0x5')),'whatsapp':require(_0x5506('0x2'))('whatsapp-interactions')};function getInteractionId(_0x1ba04c,_0x29d1d0,_0xeac0ec){if(_0x1ba04c&&_0x1ba04c[_[_0x5506('0x6')](_0xeac0ec)+_0x5506('0x7')]){return _0x1ba04c[_[_0x5506('0x6')](_0xeac0ec)+_0x5506('0x7')];}else if(_0x1ba04c&&_0x1ba04c['id']){return _0x1ba04c['id'];}else if(_0x29d1d0&&_0x29d1d0['id']){return _0x29d1d0['id'];}else{return'unknown';}}function log(_0x4ee3a6,_0x57d20f,_0x9405e0,_0x59f599,_0x42b347,_0xa783bc){loggers[_0x42b347['toLowerCase']()][_0x4ee3a6](_0x5506('0x8'),_0xa783bc['toUpperCase'](),_0x57d20f?_0x57d20f['id']:null,_0x57d20f?_0x57d20f['name']:null,_0x57d20f?_0x57d20f[_0x5506('0x9')]:null,getInteractionId(_0x9405e0,_0x59f599,_0x42b347),_0x9405e0?JSON[_0x5506('0xa')](_0x9405e0):_0x5506('0xb'));}function updateUser(_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f){db[_['upperFirst'](_0x564b1d)+_0x5506('0xc')][_0x5506('0xd')]({'where':{'id':getInteractionId(_0x9ff9d,_0x5240d4,_0x564b1d)}})['then'](function(_0x11091c){if(_0x11091c){return _0x11091c[_0x5506('0xe')]({'UserId':_0xfebb94?_0xfebb94['id']:null});}})['then'](function(_0x2794bd){if(_0x2794bd){log(_0x5506('0xf'),_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f);}})['catch'](function(){log(_0x5506('0x10'),_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f);});}exports['tracked']=function(_0x38fa73,_0x3bd93b){return function(_0x1ac386,_0x380cc6,_0x30aea2){var _0x5e2f88=_0x1ac386[_0x5506('0x11')];var _0xb86c62={};var _0x15f440=_0x1ac386[_0x5506('0x12')];if(_0xb86c62){_0xb86c62=_[_0x5506('0x13')](_0x1ac386[_0x5506('0x14')]);_0xb86c62=_[_0x5506('0x15')](_0xb86c62,['body','html',_0x5506('0x16'),_0x5506('0x17'),'mobile']);}updateUser(_0x5e2f88,_0xb86c62,_0x15f440,_0x38fa73,_0x3bd93b);_0x30aea2(null);};};
\ No newline at end of file