Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / components / interaction / service.js
index 6cfb507..ee7b936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc66=['../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','name','role','stringify','null','Interaction','findOne','then','info','error','tracked','user','query','clone','body','html','fax','mobile','lodash','../../mysqldb','openchannel-interactions','mail-interactions'];(function(_0x6ec16,_0x2e8212){var _0x2b62ac=function(_0x3aa462){while(--_0x3aa462){_0x6ec16['push'](_0x6ec16['shift']());}};_0x2b62ac(++_0x2e8212);}(_0xfc66,0x140));var _0x6fc6=function(_0x1174ca,_0x4964c3){_0x1174ca=_0x1174ca-0x0;var _0x3570c7=_0xfc66[_0x1174ca];return _0x3570c7;};'use strict';var _=require(_0x6fc6('0x0'));var db=require(_0x6fc6('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x6fc6('0x2')),'mail':require('../../config/logger')(_0x6fc6('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x6fc6('0x4'))(_0x6fc6('0x5')),'chat':require('../../config/logger')(_0x6fc6('0x6')),'whatsapp':require(_0x6fc6('0x4'))(_0x6fc6('0x7'))};function getInteractionId(_0xcc210a,_0x261e13,_0x421bb7){if(_0xcc210a&&_0xcc210a[_['upperFirst'](_0x421bb7)+_0x6fc6('0x8')]){return _0xcc210a[_[_0x6fc6('0x9')](_0x421bb7)+_0x6fc6('0x8')];}else if(_0xcc210a&&_0xcc210a['id']){return _0xcc210a['id'];}else if(_0x261e13&&_0x261e13['id']){return _0x261e13['id'];}else{return'unknown';}}function log(_0xd7e97e,_0x3b0fa0,_0x1acbe0,_0x23c4eb,_0x35401a,_0x5bf191){loggers[_0x35401a['toLowerCase']()][_0xd7e97e]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bf191['toUpperCase'](),_0x3b0fa0?_0x3b0fa0['id']:null,_0x3b0fa0?_0x3b0fa0[_0x6fc6('0xa')]:null,_0x3b0fa0?_0x3b0fa0[_0x6fc6('0xb')]:null,getInteractionId(_0x1acbe0,_0x23c4eb,_0x35401a),_0x1acbe0?JSON[_0x6fc6('0xc')](_0x1acbe0):_0x6fc6('0xd'));}function updateUser(_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7){db[_[_0x6fc6('0x9')](_0x2e339d)+_0x6fc6('0xe')][_0x6fc6('0xf')]({'where':{'id':getInteractionId(_0x5f5bdc,_0x36bb8f,_0x2e339d)}})[_0x6fc6('0x10')](function(_0x123bd8){if(_0x123bd8){return _0x123bd8['update']({'UserId':_0x3ed30b?_0x3ed30b['id']:null});}})[_0x6fc6('0x10')](function(_0x2c0772){if(_0x2c0772){log(_0x6fc6('0x11'),_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7);}})['catch'](function(){log(_0x6fc6('0x12'),_0x3ed30b,_0x5f5bdc,_0x36bb8f,_0x2e339d,_0x3af1c7);});}exports[_0x6fc6('0x13')]=function(_0x129ce7,_0x504763){return function(_0x2125c0,_0xa80c14,_0x3f1ade){var _0x4f7bb1=_0x2125c0[_0x6fc6('0x14')];var _0x37674a={};var _0x3cf742=_0x2125c0[_0x6fc6('0x15')];if(_0x37674a){_0x37674a=_[_0x6fc6('0x16')](_0x2125c0[_0x6fc6('0x17')]);_0x37674a=_['omit'](_0x37674a,['body',_0x6fc6('0x18'),'phone',_0x6fc6('0x19'),_0x6fc6('0x1a')]);}updateUser(_0x4f7bb1,_0x37674a,_0x3cf742,_0x129ce7,_0x504763);_0x3f1ade(null);};};
\ No newline at end of file
+var _0x2e71=['omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','Interaction','then','update','info','catch','error','user','query','body'];(function(_0x327c38,_0x18cf68){var _0x5502ae=function(_0x2c3e37){while(--_0x2c3e37){_0x327c38['push'](_0x327c38['shift']());}};_0x5502ae(++_0x18cf68);}(_0x2e71,0x12d));var _0x12e7=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x2e71[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0x12e7('0x0'));var db=require(_0x12e7('0x1'))['db'];var loggers={'openchannel':require(_0x12e7('0x2'))(_0x12e7('0x3')),'mail':require('../../config/logger')(_0x12e7('0x4')),'fax':require(_0x12e7('0x2'))(_0x12e7('0x5')),'sms':require(_0x12e7('0x2'))('sms-interactions'),'chat':require(_0x12e7('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x2cce1b,_0x5115e8,_0x173c81){if(_0x2cce1b&&_0x2cce1b[_[_0x12e7('0x6')](_0x173c81)+'InteractionId']){return _0x2cce1b[_['upperFirst'](_0x173c81)+_0x12e7('0x7')];}else if(_0x2cce1b&&_0x2cce1b['id']){return _0x2cce1b['id'];}else if(_0x5115e8&&_0x5115e8['id']){return _0x5115e8['id'];}else{return _0x12e7('0x8');}}function log(_0xa2f7f3,_0x422a6c,_0x16788b,_0x738d69,_0x529d35,_0x691b62){loggers[_0x529d35[_0x12e7('0x9')]()][_0xa2f7f3](_0x12e7('0xa'),_0x691b62[_0x12e7('0xb')](),_0x422a6c?_0x422a6c['id']:null,_0x422a6c?_0x422a6c[_0x12e7('0xc')]:null,_0x422a6c?_0x422a6c['role']:null,getInteractionId(_0x16788b,_0x738d69,_0x529d35),_0x16788b?JSON['stringify'](_0x16788b):_0x12e7('0xd'));}function updateUser(_0x56eab2,_0x13e1a0,_0x367470,_0x56cf80,_0x3fec2c){db[_[_0x12e7('0x6')](_0x56cf80)+_0x12e7('0xe')]['findOne']({'where':{'id':getInteractionId(_0x13e1a0,_0x367470,_0x56cf80)}})[_0x12e7('0xf')](function(_0x15d712){if(_0x15d712){return _0x15d712[_0x12e7('0x10')]({'UserId':_0x56eab2?_0x56eab2['id']:null});}})[_0x12e7('0xf')](function(_0x2a4e99){if(_0x2a4e99){log(_0x12e7('0x11'),_0x56eab2,_0x13e1a0,_0x367470,_0x56cf80,_0x3fec2c);}})[_0x12e7('0x12')](function(){log(_0x12e7('0x13'),_0x56eab2,_0x13e1a0,_0x367470,_0x56cf80,_0x3fec2c);});}exports['tracked']=function(_0x41d40d,_0x4dec91){return function(_0x318dc3,_0x2567d2,_0x4b1d54){var _0x36e2fa=_0x318dc3[_0x12e7('0x14')];var _0x158ab1={};var _0xa33681=_0x318dc3[_0x12e7('0x15')];if(_0x158ab1){_0x158ab1=_['clone'](_0x318dc3[_0x12e7('0x16')]);_0x158ab1=_[_0x12e7('0x17')](_0x158ab1,['body','html',_0x12e7('0x18'),_0x12e7('0x19'),_0x12e7('0x1a')]);}updateUser(_0x36e2fa,_0x158ab1,_0xa33681,_0x41d40d,_0x4dec91);_0x4b1d54(null);};};
\ No newline at end of file