Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index a8ae3e3..1fb57d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd07b=['html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','omit','body'];(function(_0x15a25a,_0x4c9336){var _0x5592cd=function(_0x1009b0){while(--_0x1009b0){_0x15a25a['push'](_0x15a25a['shift']());}};_0x5592cd(++_0x4c9336);}(_0xd07b,0xfc));var _0xbd07=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd07b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xbd07('0x0'));var db=require(_0xbd07('0x1'))['db'];var loggers={'openchannel':require(_0xbd07('0x2'))(_0xbd07('0x3')),'mail':require(_0xbd07('0x2'))(_0xbd07('0x4')),'fax':require('../../config/logger')(_0xbd07('0x5')),'sms':require('../../config/logger')(_0xbd07('0x6')),'chat':require(_0xbd07('0x2'))(_0xbd07('0x7')),'whatsapp':require(_0xbd07('0x2'))(_0xbd07('0x8'))};function getInteractionId(_0x1e8f9c,_0x244e61,_0x1de79b){if(_0x1e8f9c&&_0x1e8f9c[_['upperFirst'](_0x1de79b)+'InteractionId']){return _0x1e8f9c[_[_0xbd07('0x9')](_0x1de79b)+'InteractionId'];}else if(_0x1e8f9c&&_0x1e8f9c['id']){return _0x1e8f9c['id'];}else if(_0x244e61&&_0x244e61['id']){return _0x244e61['id'];}else{return _0xbd07('0xa');}}function log(_0x572247,_0x2e5a49,_0x4f7d5a,_0x4ce7d1,_0x3f685e,_0x2b3f90){loggers[_0x3f685e['toLowerCase']()][_0x572247](_0xbd07('0xb'),_0x2b3f90['toUpperCase'](),_0x2e5a49?_0x2e5a49['id']:null,_0x2e5a49?_0x2e5a49[_0xbd07('0xc')]:null,_0x2e5a49?_0x2e5a49['role']:null,getInteractionId(_0x4f7d5a,_0x4ce7d1,_0x3f685e),_0x4f7d5a?JSON['stringify'](_0x4f7d5a):_0xbd07('0xd'));}function updateUser(_0x2a593d,_0x34a9dd,_0xdbf7d0,_0x42ac1a,_0x31fa1c){db[_[_0xbd07('0x9')](_0x42ac1a)+_0xbd07('0xe')][_0xbd07('0xf')]({'where':{'id':getInteractionId(_0x34a9dd,_0xdbf7d0,_0x42ac1a)}})[_0xbd07('0x10')](function(_0x3f651f){if(_0x3f651f){return _0x3f651f[_0xbd07('0x11')]({'UserId':_0x2a593d?_0x2a593d['id']:null});}})[_0xbd07('0x10')](function(_0x331947){if(_0x331947){log(_0xbd07('0x12'),_0x2a593d,_0x34a9dd,_0xdbf7d0,_0x42ac1a,_0x31fa1c);}})[_0xbd07('0x13')](function(){log(_0xbd07('0x14'),_0x2a593d,_0x34a9dd,_0xdbf7d0,_0x42ac1a,_0x31fa1c);});}exports[_0xbd07('0x15')]=function(_0x5d942b,_0x1841cc){return function(_0x4e35bf,_0x5e40df,_0x26317a){var _0x275c17=_0x4e35bf[_0xbd07('0x16')];var _0x3c5739={};var _0x2b288c=_0x4e35bf[_0xbd07('0x17')];if(_0x3c5739){_0x3c5739=_[_0xbd07('0x18')](_0x4e35bf['body']);_0x3c5739=_[_0xbd07('0x19')](_0x3c5739,[_0xbd07('0x1a'),_0xbd07('0x1b'),_0xbd07('0x1c'),_0xbd07('0x1d'),_0xbd07('0x1e')]);}updateUser(_0x275c17,_0x3c5739,_0x2b288c,_0x5d942b,_0x1841cc);_0x26317a(null);};};
\ No newline at end of file
+var _0x241f=['Interaction','findOne','then','info','error','tracked','query','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0x3fa163,_0x13729c){var _0x4f99a4=function(_0x5f1018){while(--_0x5f1018){_0x3fa163['push'](_0x3fa163['shift']());}};_0x4f99a4(++_0x13729c);}(_0x241f,0x1e8));var _0xf241=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x241f[_0x12a62c];return _0x268a58;};'use strict';var _=require(_0xf241('0x0'));var db=require(_0xf241('0x1'))['db'];var loggers={'openchannel':require(_0xf241('0x2'))(_0xf241('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xf241('0x2'))('fax-interactions'),'sms':require(_0xf241('0x2'))(_0xf241('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf241('0x5'))};function getInteractionId(_0x229fb9,_0x374573,_0x55c8a8){if(_0x229fb9&&_0x229fb9[_[_0xf241('0x6')](_0x55c8a8)+_0xf241('0x7')]){return _0x229fb9[_['upperFirst'](_0x55c8a8)+_0xf241('0x7')];}else if(_0x229fb9&&_0x229fb9['id']){return _0x229fb9['id'];}else if(_0x374573&&_0x374573['id']){return _0x374573['id'];}else{return _0xf241('0x8');}}function log(_0x4b9cd2,_0x16fc41,_0x2430c6,_0x2c166f,_0x2e910c,_0x5f2ad9){loggers[_0x2e910c[_0xf241('0x9')]()][_0x4b9cd2](_0xf241('0xa'),_0x5f2ad9[_0xf241('0xb')](),_0x16fc41?_0x16fc41['id']:null,_0x16fc41?_0x16fc41[_0xf241('0xc')]:null,_0x16fc41?_0x16fc41[_0xf241('0xd')]:null,getInteractionId(_0x2430c6,_0x2c166f,_0x2e910c),_0x2430c6?JSON[_0xf241('0xe')](_0x2430c6):_0xf241('0xf'));}function updateUser(_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62){db[_['upperFirst'](_0xe28e71)+_0xf241('0x10')][_0xf241('0x11')]({'where':{'id':getInteractionId(_0x313013,_0x3f52a0,_0xe28e71)}})[_0xf241('0x12')](function(_0xc7ad33){if(_0xc7ad33){return _0xc7ad33['update']({'UserId':_0x4b8cd2?_0x4b8cd2['id']:null});}})['then'](function(_0x44ff9c){if(_0x44ff9c){log(_0xf241('0x13'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);}})['catch'](function(){log(_0xf241('0x14'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);});}exports[_0xf241('0x15')]=function(_0x23b6d9,_0x364ed2){return function(_0x223d1f,_0x48dd49,_0x42c209){var _0x3271d4=_0x223d1f['user'];var _0x3f997a={};var _0x1226a8=_0x223d1f[_0xf241('0x16')];if(_0x3f997a){_0x3f997a=_['clone'](_0x223d1f['body']);_0x3f997a=_['omit'](_0x3f997a,[_0xf241('0x17'),_0xf241('0x18'),_0xf241('0x19'),_0xf241('0x1a'),_0xf241('0x1b')]);}updateUser(_0x3271d4,_0x3f997a,_0x1226a8,_0x23b6d9,_0x364ed2);_0x42c209(null);};};
\ No newline at end of file