Built motion from commit 14588770.|2.5.38
[motion2.git] / server / components / interaction / service.js
index f00034c..815d45b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f72=['whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','then','update','info','error','tracked','user','query','clone','body','omit','html','phone','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions'];(function(_0x4f7c87,_0x3f526e){var _0x4021b6=function(_0x8e7304){while(--_0x8e7304){_0x4f7c87['push'](_0x4f7c87['shift']());}};_0x4021b6(++_0x3f526e);}(_0x6f72,0xae));var _0x26f7=function(_0x25ead1,_0x53c173){_0x25ead1=_0x25ead1-0x0;var _0x4d899d=_0x6f72[_0x25ead1];return _0x4d899d;};'use strict';var _=require('lodash');var db=require(_0x26f7('0x0'))['db'];var loggers={'openchannel':require(_0x26f7('0x1'))(_0x26f7('0x2')),'mail':require('../../config/logger')(_0x26f7('0x3')),'fax':require(_0x26f7('0x1'))('fax-interactions'),'sms':require(_0x26f7('0x1'))(_0x26f7('0x4')),'chat':require('../../config/logger')(_0x26f7('0x5')),'whatsapp':require('../../config/logger')(_0x26f7('0x6'))};function getInteractionId(_0x529e3f,_0x36ea93,_0x21de0c){if(_0x529e3f&&_0x529e3f[_['upperFirst'](_0x21de0c)+'InteractionId']){return _0x529e3f[_[_0x26f7('0x7')](_0x21de0c)+_0x26f7('0x8')];}else if(_0x529e3f&&_0x529e3f['id']){return _0x529e3f['id'];}else if(_0x36ea93&&_0x36ea93['id']){return _0x36ea93['id'];}else{return _0x26f7('0x9');}}function log(_0x2ffa31,_0x31cec1,_0x10f761,_0x1ade91,_0x212ec7,_0x47cecb){loggers[_0x212ec7[_0x26f7('0xa')]()][_0x2ffa31]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47cecb[_0x26f7('0xb')](),_0x31cec1?_0x31cec1['id']:null,_0x31cec1?_0x31cec1[_0x26f7('0xc')]:null,_0x31cec1?_0x31cec1[_0x26f7('0xd')]:null,getInteractionId(_0x10f761,_0x1ade91,_0x212ec7),_0x10f761?JSON[_0x26f7('0xe')](_0x10f761):_0x26f7('0xf'));}function updateUser(_0x2e1300,_0x157bcc,_0x64b65a,_0x3e3fab,_0x263e02){db[_[_0x26f7('0x7')](_0x3e3fab)+_0x26f7('0x10')]['findOne']({'where':{'id':getInteractionId(_0x157bcc,_0x64b65a,_0x3e3fab)}})[_0x26f7('0x11')](function(_0xe6ba20){if(_0xe6ba20){return _0xe6ba20[_0x26f7('0x12')]({'UserId':_0x2e1300?_0x2e1300['id']:null});}})[_0x26f7('0x11')](function(_0x5014b2){if(_0x5014b2){log(_0x26f7('0x13'),_0x2e1300,_0x157bcc,_0x64b65a,_0x3e3fab,_0x263e02);}})['catch'](function(){log(_0x26f7('0x14'),_0x2e1300,_0x157bcc,_0x64b65a,_0x3e3fab,_0x263e02);});}exports[_0x26f7('0x15')]=function(_0x27d28f,_0x230f21){return function(_0x528786,_0x491518,_0x3b48b6){var _0x49b3de=_0x528786[_0x26f7('0x16')];var _0x3f24f6={};var _0x14f5b0=_0x528786[_0x26f7('0x17')];if(_0x3f24f6){_0x3f24f6=_[_0x26f7('0x18')](_0x528786[_0x26f7('0x19')]);_0x3f24f6=_[_0x26f7('0x1a')](_0x3f24f6,[_0x26f7('0x19'),_0x26f7('0x1b'),_0x26f7('0x1c'),'fax',_0x26f7('0x1d')]);}updateUser(_0x49b3de,_0x3f24f6,_0x14f5b0,_0x27d28f,_0x230f21);_0x3b48b6(null);};};
\ No newline at end of file
+var _0x8282=['null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','body','html','phone','fax','mobile','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify'];(function(_0x525adf,_0x3625d2){var _0x29af8d=function(_0xe16d54){while(--_0xe16d54){_0x525adf['push'](_0x525adf['shift']());}};_0x29af8d(++_0x3625d2);}(_0x8282,0x10c));var _0x2828=function(_0x265564,_0x1a3cdc){_0x265564=_0x265564-0x0;var _0x506d7e=_0x8282[_0x265564];return _0x506d7e;};'use strict';var _=require('lodash');var db=require(_0x2828('0x0'))['db'];var loggers={'openchannel':require(_0x2828('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x2828('0x2')),'fax':require(_0x2828('0x1'))(_0x2828('0x3')),'sms':require(_0x2828('0x1'))('sms-interactions'),'chat':require(_0x2828('0x1'))(_0x2828('0x4')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x1ab06a,_0x5c5285,_0xf18904){if(_0x1ab06a&&_0x1ab06a[_[_0x2828('0x5')](_0xf18904)+_0x2828('0x6')]){return _0x1ab06a[_[_0x2828('0x5')](_0xf18904)+_0x2828('0x6')];}else if(_0x1ab06a&&_0x1ab06a['id']){return _0x1ab06a['id'];}else if(_0x5c5285&&_0x5c5285['id']){return _0x5c5285['id'];}else{return'unknown';}}function log(_0x2a1956,_0x1b57ea,_0x985501,_0x5c897c,_0x1a137e,_0x4e98fc){loggers[_0x1a137e[_0x2828('0x7')]()][_0x2a1956](_0x2828('0x8'),_0x4e98fc['toUpperCase'](),_0x1b57ea?_0x1b57ea['id']:null,_0x1b57ea?_0x1b57ea[_0x2828('0x9')]:null,_0x1b57ea?_0x1b57ea[_0x2828('0xa')]:null,getInteractionId(_0x985501,_0x5c897c,_0x1a137e),_0x985501?JSON[_0x2828('0xb')](_0x985501):_0x2828('0xc'));}function updateUser(_0x16a621,_0x10cbe8,_0x24def3,_0x5799f8,_0x352e69){db[_[_0x2828('0x5')](_0x5799f8)+_0x2828('0xd')][_0x2828('0xe')]({'where':{'id':getInteractionId(_0x10cbe8,_0x24def3,_0x5799f8)}})[_0x2828('0xf')](function(_0x1c9404){if(_0x1c9404){return _0x1c9404[_0x2828('0x10')]({'UserId':_0x16a621?_0x16a621['id']:null});}})[_0x2828('0xf')](function(_0xc0dc6f){if(_0xc0dc6f){log(_0x2828('0x11'),_0x16a621,_0x10cbe8,_0x24def3,_0x5799f8,_0x352e69);}})[_0x2828('0x12')](function(){log(_0x2828('0x13'),_0x16a621,_0x10cbe8,_0x24def3,_0x5799f8,_0x352e69);});}exports[_0x2828('0x14')]=function(_0x1f4ee1,_0x277afc){return function(_0x51b0b8,_0x4e3576,_0x292b8c){var _0x54974d=_0x51b0b8[_0x2828('0x15')];var _0x4a7923={};var _0x57e6c7=_0x51b0b8[_0x2828('0x16')];if(_0x4a7923){_0x4a7923=_['clone'](_0x51b0b8[_0x2828('0x17')]);_0x4a7923=_['omit'](_0x4a7923,[_0x2828('0x17'),_0x2828('0x18'),_0x2828('0x19'),_0x2828('0x1a'),_0x2828('0x1b')]);}updateUser(_0x54974d,_0x4a7923,_0x57e6c7,_0x1f4ee1,_0x277afc);_0x292b8c(null);};};
\ No newline at end of file