Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / components / interaction / service.js
index 4a22ee6..6cfb507 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfebf=['openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','findOne','update','then','info','error','tracked','user','query','clone','body','omit','html','phone','mobile','../../mysqldb','../../config/logger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xfebf,0x1b1));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var db=require(_0xffeb('0x0'))['db'];var loggers={'openchannel':require(_0xffeb('0x1'))(_0xffeb('0x2')),'mail':require(_0xffeb('0x1'))(_0xffeb('0x3')),'fax':require(_0xffeb('0x1'))(_0xffeb('0x4')),'sms':require(_0xffeb('0x1'))(_0xffeb('0x5')),'chat':require('../../config/logger')(_0xffeb('0x6')),'whatsapp':require('../../config/logger')(_0xffeb('0x7'))};function getInteractionId(_0x439fdc,_0x173487,_0x27597c){if(_0x439fdc&&_0x439fdc[_[_0xffeb('0x8')](_0x27597c)+'InteractionId']){return _0x439fdc[_[_0xffeb('0x8')](_0x27597c)+_0xffeb('0x9')];}else if(_0x439fdc&&_0x439fdc['id']){return _0x439fdc['id'];}else if(_0x173487&&_0x173487['id']){return _0x173487['id'];}else{return _0xffeb('0xa');}}function log(_0x516753,_0x19bea1,_0x170020,_0x598bc0,_0x249af2,_0x32851b){loggers[_0x249af2[_0xffeb('0xb')]()][_0x516753](_0xffeb('0xc'),_0x32851b['toUpperCase'](),_0x19bea1?_0x19bea1['id']:null,_0x19bea1?_0x19bea1['name']:null,_0x19bea1?_0x19bea1[_0xffeb('0xd')]:null,getInteractionId(_0x170020,_0x598bc0,_0x249af2),_0x170020?JSON['stringify'](_0x170020):_0xffeb('0xe'));}function updateUser(_0x178394,_0x4ee125,_0x10b769,_0x5486c4,_0x15674b){db[_['upperFirst'](_0x5486c4)+'Interaction'][_0xffeb('0xf')]({'where':{'id':getInteractionId(_0x4ee125,_0x10b769,_0x5486c4)}})['then'](function(_0x599b96){if(_0x599b96){return _0x599b96[_0xffeb('0x10')]({'UserId':_0x178394?_0x178394['id']:null});}})[_0xffeb('0x11')](function(_0x569a40){if(_0x569a40){log(_0xffeb('0x12'),_0x178394,_0x4ee125,_0x10b769,_0x5486c4,_0x15674b);}})['catch'](function(){log(_0xffeb('0x13'),_0x178394,_0x4ee125,_0x10b769,_0x5486c4,_0x15674b);});}exports[_0xffeb('0x14')]=function(_0x4942f7,_0x346437){return function(_0x2fd6be,_0x356867,_0x37c4da){var _0xae14b1=_0x2fd6be[_0xffeb('0x15')];var _0x844174={};var _0x246482=_0x2fd6be[_0xffeb('0x16')];if(_0x844174){_0x844174=_[_0xffeb('0x17')](_0x2fd6be[_0xffeb('0x18')]);_0x844174=_[_0xffeb('0x19')](_0x844174,[_0xffeb('0x18'),_0xffeb('0x1a'),_0xffeb('0x1b'),'fax',_0xffeb('0x1c')]);}updateUser(_0xae14b1,_0x844174,_0x246482,_0x4942f7,_0x346437);_0x37c4da(null);};};
\ No newline at end of file
+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