Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index b67e3c7..1fb57d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7d=['sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','user','query','clone','omit','body','html','phone','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x2e7d,0x1c9));var _0xd2e7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e7d[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var db=require(_0xd2e7('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xd2e7('0x1')),'mail':require(_0xd2e7('0x2'))(_0xd2e7('0x3')),'fax':require('../../config/logger')(_0xd2e7('0x4')),'sms':require(_0xd2e7('0x2'))(_0xd2e7('0x5')),'chat':require(_0xd2e7('0x2'))(_0xd2e7('0x6')),'whatsapp':require('../../config/logger')(_0xd2e7('0x7'))};function getInteractionId(_0x21432e,_0x5ecdb7,_0x34fa5c){if(_0x21432e&&_0x21432e[_[_0xd2e7('0x8')](_0x34fa5c)+'InteractionId']){return _0x21432e[_['upperFirst'](_0x34fa5c)+_0xd2e7('0x9')];}else if(_0x21432e&&_0x21432e['id']){return _0x21432e['id'];}else if(_0x5ecdb7&&_0x5ecdb7['id']){return _0x5ecdb7['id'];}else{return _0xd2e7('0xa');}}function log(_0x18f774,_0x347e8f,_0x1626c2,_0x4f57ae,_0x5d35f4,_0x3a3cb0){loggers[_0x5d35f4[_0xd2e7('0xb')]()][_0x18f774](_0xd2e7('0xc'),_0x3a3cb0['toUpperCase'](),_0x347e8f?_0x347e8f['id']:null,_0x347e8f?_0x347e8f[_0xd2e7('0xd')]:null,_0x347e8f?_0x347e8f[_0xd2e7('0xe')]:null,getInteractionId(_0x1626c2,_0x4f57ae,_0x5d35f4),_0x1626c2?JSON[_0xd2e7('0xf')](_0x1626c2):_0xd2e7('0x10'));}function updateUser(_0xe46dca,_0x504e16,_0x1b6d7f,_0x97b42,_0x4acd62){db[_[_0xd2e7('0x8')](_0x97b42)+_0xd2e7('0x11')][_0xd2e7('0x12')]({'where':{'id':getInteractionId(_0x504e16,_0x1b6d7f,_0x97b42)}})[_0xd2e7('0x13')](function(_0x3e3fff){if(_0x3e3fff){return _0x3e3fff[_0xd2e7('0x14')]({'UserId':_0xe46dca?_0xe46dca['id']:null});}})[_0xd2e7('0x13')](function(_0x313517){if(_0x313517){log(_0xd2e7('0x15'),_0xe46dca,_0x504e16,_0x1b6d7f,_0x97b42,_0x4acd62);}})[_0xd2e7('0x16')](function(){log(_0xd2e7('0x17'),_0xe46dca,_0x504e16,_0x1b6d7f,_0x97b42,_0x4acd62);});}exports['tracked']=function(_0x21bf31,_0x4affc2){return function(_0x560274,_0x34b1eb,_0x2f39d3){var _0xa4f7e2=_0x560274[_0xd2e7('0x18')];var _0xda6057={};var _0x4e4ae0=_0x560274[_0xd2e7('0x19')];if(_0xda6057){_0xda6057=_[_0xd2e7('0x1a')](_0x560274['body']);_0xda6057=_[_0xd2e7('0x1b')](_0xda6057,[_0xd2e7('0x1c'),_0xd2e7('0x1d'),_0xd2e7('0x1e'),_0xd2e7('0x1f'),_0xd2e7('0x20')]);}updateUser(_0xa4f7e2,_0xda6057,_0x4e4ae0,_0x21bf31,_0x4affc2);_0x2f39d3(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