Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index eb784dc..989cfe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf569=['../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','name','stringify','Interaction','findOne','then','update','info','catch','error','tracked','query','clone','body','html','phone','fax','mobile'];(function(_0x5b46d5,_0x1947de){var _0x181371=function(_0x15696d){while(--_0x15696d){_0x5b46d5['push'](_0x5b46d5['shift']());}};_0x181371(++_0x1947de);}(_0xf569,0xd0));var _0x9f56=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xf569[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var db=require(_0x9f56('0x0'))['db'];var loggers={'openchannel':require(_0x9f56('0x1'))(_0x9f56('0x2')),'mail':require(_0x9f56('0x1'))(_0x9f56('0x3')),'fax':require(_0x9f56('0x1'))(_0x9f56('0x4')),'sms':require(_0x9f56('0x1'))('sms-interactions'),'chat':require(_0x9f56('0x1'))('chat-interactions'),'whatsapp':require(_0x9f56('0x1'))(_0x9f56('0x5'))};function getInteractionId(_0x5c5e5f,_0x1bcede,_0x73c3b4){if(_0x5c5e5f&&_0x5c5e5f[_['upperFirst'](_0x73c3b4)+_0x9f56('0x6')]){return _0x5c5e5f[_[_0x9f56('0x7')](_0x73c3b4)+_0x9f56('0x6')];}else if(_0x5c5e5f&&_0x5c5e5f['id']){return _0x5c5e5f['id'];}else if(_0x1bcede&&_0x1bcede['id']){return _0x1bcede['id'];}else{return'unknown';}}function log(_0x4a4569,_0x3172a3,_0x1fb07e,_0x4bfa64,_0x1ae262,_0x67f679){loggers[_0x1ae262[_0x9f56('0x8')]()][_0x4a4569]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x67f679['toUpperCase'](),_0x3172a3?_0x3172a3['id']:null,_0x3172a3?_0x3172a3[_0x9f56('0x9')]:null,_0x3172a3?_0x3172a3['role']:null,getInteractionId(_0x1fb07e,_0x4bfa64,_0x1ae262),_0x1fb07e?JSON[_0x9f56('0xa')](_0x1fb07e):'null');}function updateUser(_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587){db[_[_0x9f56('0x7')](_0x5af8ab)+_0x9f56('0xb')][_0x9f56('0xc')]({'where':{'id':getInteractionId(_0x293687,_0x4230ea,_0x5af8ab)}})[_0x9f56('0xd')](function(_0x8e3485){if(_0x8e3485){return _0x8e3485[_0x9f56('0xe')]({'UserId':_0x4dfeb3?_0x4dfeb3['id']:null});}})[_0x9f56('0xd')](function(_0x4228f5){if(_0x4228f5){log(_0x9f56('0xf'),_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587);}})[_0x9f56('0x10')](function(){log(_0x9f56('0x11'),_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587);});}exports[_0x9f56('0x12')]=function(_0x9c39ec,_0x131130){return function(_0x21808b,_0x1bbbae,_0x175dbe){var _0x5bd236=_0x21808b['user'];var _0x2d01d8={};var _0x2294aa=_0x21808b[_0x9f56('0x13')];if(_0x2d01d8){_0x2d01d8=_[_0x9f56('0x14')](_0x21808b[_0x9f56('0x15')]);_0x2d01d8=_['omit'](_0x2d01d8,[_0x9f56('0x15'),_0x9f56('0x16'),_0x9f56('0x17'),_0x9f56('0x18'),_0x9f56('0x19')]);}updateUser(_0x5bd236,_0x2d01d8,_0x2294aa,_0x9c39ec,_0x131130);_0x175dbe(null);};};
\ No newline at end of file
+var _0x3280=['fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','null','Interaction','findOne','info','catch','error','tracked','user','query','clone','body','html','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x204575,_0x4011a6){var _0x44825f=function(_0x2bff5a){while(--_0x2bff5a){_0x204575['push'](_0x204575['shift']());}};_0x44825f(++_0x4011a6);}(_0x3280,0x83));var _0x0328=function(_0x234732,_0x2dc38b){_0x234732=_0x234732-0x0;var _0xed5bc7=_0x3280[_0x234732];return _0xed5bc7;};'use strict';var _=require(_0x0328('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0328('0x1'))(_0x0328('0x2')),'mail':require('../../config/logger')(_0x0328('0x3')),'fax':require(_0x0328('0x1'))(_0x0328('0x4')),'sms':require(_0x0328('0x1'))('sms-interactions'),'chat':require(_0x0328('0x1'))(_0x0328('0x5')),'whatsapp':require('../../config/logger')(_0x0328('0x6'))};function getInteractionId(_0x108e1f,_0x2379df,_0x36e11e){if(_0x108e1f&&_0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')]){return _0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')];}else if(_0x108e1f&&_0x108e1f['id']){return _0x108e1f['id'];}else if(_0x2379df&&_0x2379df['id']){return _0x2379df['id'];}else{return'unknown';}}function log(_0xdd8d36,_0x274a02,_0x2335a9,_0x348558,_0x233d18,_0x5a80a0){loggers[_0x233d18[_0x0328('0x9')]()][_0xdd8d36](_0x0328('0xa'),_0x5a80a0['toUpperCase'](),_0x274a02?_0x274a02['id']:null,_0x274a02?_0x274a02[_0x0328('0xb')]:null,_0x274a02?_0x274a02['role']:null,getInteractionId(_0x2335a9,_0x348558,_0x233d18),_0x2335a9?JSON[_0x0328('0xc')](_0x2335a9):_0x0328('0xd'));}function updateUser(_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910){db[_[_0x0328('0x7')](_0x39f542)+_0x0328('0xe')][_0x0328('0xf')]({'where':{'id':getInteractionId(_0x1adcc8,_0x44ce6b,_0x39f542)}})['then'](function(_0x2b9f03){if(_0x2b9f03){return _0x2b9f03['update']({'UserId':_0x1f0f29?_0x1f0f29['id']:null});}})['then'](function(_0x21a897){if(_0x21a897){log(_0x0328('0x10'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);}})[_0x0328('0x11')](function(){log(_0x0328('0x12'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);});}exports[_0x0328('0x13')]=function(_0x490d00,_0x2bbba5){return function(_0xfcef53,_0x3d8c37,_0x257940){var _0x52c85e=_0xfcef53[_0x0328('0x14')];var _0x52312d={};var _0x689fc0=_0xfcef53[_0x0328('0x15')];if(_0x52312d){_0x52312d=_[_0x0328('0x16')](_0xfcef53[_0x0328('0x17')]);_0x52312d=_['omit'](_0x52312d,['body',_0x0328('0x18'),'phone',_0x0328('0x19'),_0x0328('0x1a')]);}updateUser(_0x52c85e,_0x52312d,_0x689fc0,_0x490d00,_0x2bbba5);_0x257940(null);};};
\ No newline at end of file