Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / components / interaction / service.js
index 8ff131d..eb784dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d1=['clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toUpperCase','name','role','Interaction','findOne','then','update','info','catch','error','tracked','user','query'];(function(_0x5d8444,_0x3547b0){var _0x3801bf=function(_0x206291){while(--_0x206291){_0x5d8444['push'](_0x5d8444['shift']());}};_0x3801bf(++_0x3547b0);}(_0x21d1,0x1c9));var _0x121d=function(_0x156445,_0x26b414){_0x156445=_0x156445-0x0;var _0xdf0bbe=_0x21d1[_0x156445];return _0xdf0bbe;};'use strict';var _=require(_0x121d('0x0'));var db=require(_0x121d('0x1'))['db'];var loggers={'openchannel':require(_0x121d('0x2'))(_0x121d('0x3')),'mail':require(_0x121d('0x2'))(_0x121d('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x121d('0x2'))(_0x121d('0x5')),'chat':require(_0x121d('0x2'))(_0x121d('0x6')),'whatsapp':require(_0x121d('0x2'))('whatsapp-interactions')};function getInteractionId(_0x226625,_0x2bd1e8,_0x47b50b){if(_0x226625&&_0x226625[_[_0x121d('0x7')](_0x47b50b)+_0x121d('0x8')]){return _0x226625[_[_0x121d('0x7')](_0x47b50b)+_0x121d('0x8')];}else if(_0x226625&&_0x226625['id']){return _0x226625['id'];}else if(_0x2bd1e8&&_0x2bd1e8['id']){return _0x2bd1e8['id'];}else{return _0x121d('0x9');}}function log(_0x16cb65,_0xa9dd0e,_0x54c721,_0x1f1201,_0xbcc574,_0x303f33){loggers[_0xbcc574['toLowerCase']()][_0x16cb65]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x303f33[_0x121d('0xa')](),_0xa9dd0e?_0xa9dd0e['id']:null,_0xa9dd0e?_0xa9dd0e[_0x121d('0xb')]:null,_0xa9dd0e?_0xa9dd0e[_0x121d('0xc')]:null,getInteractionId(_0x54c721,_0x1f1201,_0xbcc574),_0x54c721?JSON['stringify'](_0x54c721):'null');}function updateUser(_0x29dd8c,_0x54a257,_0x1bb2cb,_0x580862,_0x280c80){db[_['upperFirst'](_0x580862)+_0x121d('0xd')][_0x121d('0xe')]({'where':{'id':getInteractionId(_0x54a257,_0x1bb2cb,_0x580862)}})[_0x121d('0xf')](function(_0x8dec86){if(_0x8dec86){return _0x8dec86[_0x121d('0x10')]({'UserId':_0x29dd8c?_0x29dd8c['id']:null});}})[_0x121d('0xf')](function(_0xbd872f){if(_0xbd872f){log(_0x121d('0x11'),_0x29dd8c,_0x54a257,_0x1bb2cb,_0x580862,_0x280c80);}})[_0x121d('0x12')](function(){log(_0x121d('0x13'),_0x29dd8c,_0x54a257,_0x1bb2cb,_0x580862,_0x280c80);});}exports[_0x121d('0x14')]=function(_0x15eac4,_0x1f93d){return function(_0x5aee6a,_0x5a0b2d,_0x48e041){var _0x278593=_0x5aee6a[_0x121d('0x15')];var _0x4a8630={};var _0x455041=_0x5aee6a[_0x121d('0x16')];if(_0x4a8630){_0x4a8630=_[_0x121d('0x17')](_0x5aee6a[_0x121d('0x18')]);_0x4a8630=_[_0x121d('0x19')](_0x4a8630,[_0x121d('0x18'),_0x121d('0x1a'),_0x121d('0x1b'),_0x121d('0x1c'),_0x121d('0x1d')]);}updateUser(_0x278593,_0x4a8630,_0x455041,_0x15eac4,_0x1f93d);_0x48e041(null);};};
\ No newline at end of file
+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