Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index f00034c..989cfe8 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 _0x3280=['fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','null','Interaction','findOne','info','catch','error','tracked','user','query','clone','body','html','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x204575,_0x4011a6){var _0x44825f=function(_0x2bff5a){while(--_0x2bff5a){_0x204575['push'](_0x204575['shift']());}};_0x44825f(++_0x4011a6);}(_0x3280,0x83));var _0x0328=function(_0x234732,_0x2dc38b){_0x234732=_0x234732-0x0;var _0xed5bc7=_0x3280[_0x234732];return _0xed5bc7;};'use strict';var _=require(_0x0328('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0328('0x1'))(_0x0328('0x2')),'mail':require('../../config/logger')(_0x0328('0x3')),'fax':require(_0x0328('0x1'))(_0x0328('0x4')),'sms':require(_0x0328('0x1'))('sms-interactions'),'chat':require(_0x0328('0x1'))(_0x0328('0x5')),'whatsapp':require('../../config/logger')(_0x0328('0x6'))};function getInteractionId(_0x108e1f,_0x2379df,_0x36e11e){if(_0x108e1f&&_0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')]){return _0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')];}else if(_0x108e1f&&_0x108e1f['id']){return _0x108e1f['id'];}else if(_0x2379df&&_0x2379df['id']){return _0x2379df['id'];}else{return'unknown';}}function log(_0xdd8d36,_0x274a02,_0x2335a9,_0x348558,_0x233d18,_0x5a80a0){loggers[_0x233d18[_0x0328('0x9')]()][_0xdd8d36](_0x0328('0xa'),_0x5a80a0['toUpperCase'](),_0x274a02?_0x274a02['id']:null,_0x274a02?_0x274a02[_0x0328('0xb')]:null,_0x274a02?_0x274a02['role']:null,getInteractionId(_0x2335a9,_0x348558,_0x233d18),_0x2335a9?JSON[_0x0328('0xc')](_0x2335a9):_0x0328('0xd'));}function updateUser(_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910){db[_[_0x0328('0x7')](_0x39f542)+_0x0328('0xe')][_0x0328('0xf')]({'where':{'id':getInteractionId(_0x1adcc8,_0x44ce6b,_0x39f542)}})['then'](function(_0x2b9f03){if(_0x2b9f03){return _0x2b9f03['update']({'UserId':_0x1f0f29?_0x1f0f29['id']:null});}})['then'](function(_0x21a897){if(_0x21a897){log(_0x0328('0x10'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);}})[_0x0328('0x11')](function(){log(_0x0328('0x12'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);});}exports[_0x0328('0x13')]=function(_0x490d00,_0x2bbba5){return function(_0xfcef53,_0x3d8c37,_0x257940){var _0x52c85e=_0xfcef53[_0x0328('0x14')];var _0x52312d={};var _0x689fc0=_0xfcef53[_0x0328('0x15')];if(_0x52312d){_0x52312d=_[_0x0328('0x16')](_0xfcef53[_0x0328('0x17')]);_0x52312d=_['omit'](_0x52312d,['body',_0x0328('0x18'),'phone',_0x0328('0x19'),_0x0328('0x1a')]);}updateUser(_0x52c85e,_0x52312d,_0x689fc0,_0x490d00,_0x2bbba5);_0x257940(null);};};
\ No newline at end of file