Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index d123e03..989cfe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23b=['toUpperCase','role','null','findOne','then','info','catch','error','tracked','user','query','clone','omit','body','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xf23b,0x133));var _0xbf23=function(_0x334701,_0x224871){_0x334701=_0x334701-0x0;var _0x2aa2e9=_0xf23b[_0x334701];return _0x2aa2e9;};'use strict';var _=require(_0xbf23('0x0'));var db=require(_0xbf23('0x1'))['db'];var loggers={'openchannel':require(_0xbf23('0x2'))(_0xbf23('0x3')),'mail':require(_0xbf23('0x2'))('mail-interactions'),'fax':require(_0xbf23('0x2'))(_0xbf23('0x4')),'sms':require(_0xbf23('0x2'))('sms-interactions'),'chat':require(_0xbf23('0x2'))(_0xbf23('0x5')),'whatsapp':require(_0xbf23('0x2'))(_0xbf23('0x6'))};function getInteractionId(_0x18857b,_0x4c0869,_0x4b5e1e){if(_0x18857b&&_0x18857b[_[_0xbf23('0x7')](_0x4b5e1e)+'InteractionId']){return _0x18857b[_[_0xbf23('0x7')](_0x4b5e1e)+_0xbf23('0x8')];}else if(_0x18857b&&_0x18857b['id']){return _0x18857b['id'];}else if(_0x4c0869&&_0x4c0869['id']){return _0x4c0869['id'];}else{return _0xbf23('0x9');}}function log(_0x138c74,_0x16e09c,_0x5dc111,_0x1cfeec,_0x1d372c,_0x2b7ea1){loggers[_0x1d372c[_0xbf23('0xa')]()][_0x138c74](_0xbf23('0xb'),_0x2b7ea1[_0xbf23('0xc')](),_0x16e09c?_0x16e09c['id']:null,_0x16e09c?_0x16e09c['name']:null,_0x16e09c?_0x16e09c[_0xbf23('0xd')]:null,getInteractionId(_0x5dc111,_0x1cfeec,_0x1d372c),_0x5dc111?JSON['stringify'](_0x5dc111):_0xbf23('0xe'));}function updateUser(_0x4aea28,_0xc31cc,_0x2ed737,_0x4deb64,_0xb6880){db[_['upperFirst'](_0x4deb64)+'Interaction'][_0xbf23('0xf')]({'where':{'id':getInteractionId(_0xc31cc,_0x2ed737,_0x4deb64)}})[_0xbf23('0x10')](function(_0x5dd4f9){if(_0x5dd4f9){return _0x5dd4f9['update']({'UserId':_0x4aea28?_0x4aea28['id']:null});}})[_0xbf23('0x10')](function(_0x581f9a){if(_0x581f9a){log(_0xbf23('0x11'),_0x4aea28,_0xc31cc,_0x2ed737,_0x4deb64,_0xb6880);}})[_0xbf23('0x12')](function(){log(_0xbf23('0x13'),_0x4aea28,_0xc31cc,_0x2ed737,_0x4deb64,_0xb6880);});}exports[_0xbf23('0x14')]=function(_0x4c1cca,_0x4d0e9c){return function(_0x58b78f,_0x113c97,_0x39f4f3){var _0x2fea8a=_0x58b78f[_0xbf23('0x15')];var _0x53f82c={};var _0x9259ca=_0x58b78f[_0xbf23('0x16')];if(_0x53f82c){_0x53f82c=_[_0xbf23('0x17')](_0x58b78f['body']);_0x53f82c=_[_0xbf23('0x18')](_0x53f82c,[_0xbf23('0x19'),_0xbf23('0x1a'),_0xbf23('0x1b'),'fax',_0xbf23('0x1c')]);}updateUser(_0x2fea8a,_0x53f82c,_0x9259ca,_0x4c1cca,_0x4d0e9c);_0x39f4f3(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