Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / components / interaction / service.js
index b30b739..e42d09e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa63f=['html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-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','Interaction','then','info','catch','error','tracked','query','clone','body'];(function(_0x2d0e38,_0x5b99d0){var _0x40f588=function(_0x498b31){while(--_0x498b31){_0x2d0e38['push'](_0x2d0e38['shift']());}};_0x40f588(++_0x5b99d0);}(_0xa63f,0x1b6));var _0xfa63=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0xa63f[_0x2ca616];return _0x53155f;};'use strict';var _=require(_0xfa63('0x0'));var db=require(_0xfa63('0x1'))['db'];var loggers={'openchannel':require(_0xfa63('0x2'))(_0xfa63('0x3')),'mail':require(_0xfa63('0x2'))(_0xfa63('0x4')),'fax':require(_0xfa63('0x2'))(_0xfa63('0x5')),'sms':require(_0xfa63('0x2'))(_0xfa63('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xfa63('0x2'))(_0xfa63('0x7'))};function getInteractionId(_0xb35bc5,_0x2dcf48,_0x486050){if(_0xb35bc5&&_0xb35bc5[_['upperFirst'](_0x486050)+'InteractionId']){return _0xb35bc5[_[_0xfa63('0x8')](_0x486050)+_0xfa63('0x9')];}else if(_0xb35bc5&&_0xb35bc5['id']){return _0xb35bc5['id'];}else if(_0x2dcf48&&_0x2dcf48['id']){return _0x2dcf48['id'];}else{return _0xfa63('0xa');}}function log(_0x47d90d,_0x181fec,_0x57faed,_0xfcb3d1,_0x4b1959,_0x294bfc){loggers[_0x4b1959[_0xfa63('0xb')]()][_0x47d90d](_0xfa63('0xc'),_0x294bfc[_0xfa63('0xd')](),_0x181fec?_0x181fec['id']:null,_0x181fec?_0x181fec[_0xfa63('0xe')]:null,_0x181fec?_0x181fec[_0xfa63('0xf')]:null,getInteractionId(_0x57faed,_0xfcb3d1,_0x4b1959),_0x57faed?JSON[_0xfa63('0x10')](_0x57faed):_0xfa63('0x11'));}function updateUser(_0x4b1037,_0x4ac166,_0x3cf87d,_0x451359,_0x179377){db[_['upperFirst'](_0x451359)+_0xfa63('0x12')]['findOne']({'where':{'id':getInteractionId(_0x4ac166,_0x3cf87d,_0x451359)}})[_0xfa63('0x13')](function(_0x1093da){if(_0x1093da){return _0x1093da['update']({'UserId':_0x4b1037?_0x4b1037['id']:null});}})[_0xfa63('0x13')](function(_0xca0a31){if(_0xca0a31){log(_0xfa63('0x14'),_0x4b1037,_0x4ac166,_0x3cf87d,_0x451359,_0x179377);}})[_0xfa63('0x15')](function(){log(_0xfa63('0x16'),_0x4b1037,_0x4ac166,_0x3cf87d,_0x451359,_0x179377);});}exports[_0xfa63('0x17')]=function(_0x53aec2,_0x9d9f69){return function(_0x381d7a,_0x29e345,_0xb597f2){var _0x5d6e0a=_0x381d7a['user'];var _0x34cc86={};var _0x90e6a8=_0x381d7a[_0xfa63('0x18')];if(_0x34cc86){_0x34cc86=_[_0xfa63('0x19')](_0x381d7a['body']);_0x34cc86=_['omit'](_0x34cc86,[_0xfa63('0x1a'),_0xfa63('0x1b'),_0xfa63('0x1c'),_0xfa63('0x1d'),_0xfa63('0x1e')]);}updateUser(_0x5d6e0a,_0x34cc86,_0x90e6a8,_0x53aec2,_0x9d9f69);_0xb597f2(null);};};
\ No newline at end of file
+var _0xf808=['findOne','then','update','info','error','user','body','omit','phone','fax','mobile','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','unknown','toLowerCase','name','role','null'];(function(_0x507f9e,_0x308d20){var _0x250f7e=function(_0x144202){while(--_0x144202){_0x507f9e['push'](_0x507f9e['shift']());}};_0x250f7e(++_0x308d20);}(_0xf808,0x83));var _0x8f80=function(_0x5d48b0,_0xff27bd){_0x5d48b0=_0x5d48b0-0x0;var _0x486a3f=_0xf808[_0x5d48b0];return _0x486a3f;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x8f80('0x0'))(_0x8f80('0x1')),'mail':require(_0x8f80('0x0'))('mail-interactions'),'fax':require(_0x8f80('0x0'))(_0x8f80('0x2')),'sms':require(_0x8f80('0x0'))(_0x8f80('0x3')),'chat':require('../../config/logger')(_0x8f80('0x4')),'whatsapp':require('../../config/logger')(_0x8f80('0x5'))};function getInteractionId(_0x4e2e35,_0xf7be4c,_0x456dd6){if(_0x4e2e35&&_0x4e2e35[_['upperFirst'](_0x456dd6)+_0x8f80('0x6')]){return _0x4e2e35[_[_0x8f80('0x7')](_0x456dd6)+_0x8f80('0x6')];}else if(_0x4e2e35&&_0x4e2e35['id']){return _0x4e2e35['id'];}else if(_0xf7be4c&&_0xf7be4c['id']){return _0xf7be4c['id'];}else{return _0x8f80('0x8');}}function log(_0x1f982a,_0x28d9ac,_0x1899a8,_0x5a3530,_0x2f0939,_0xa42eaf){loggers[_0x2f0939[_0x8f80('0x9')]()][_0x1f982a]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa42eaf['toUpperCase'](),_0x28d9ac?_0x28d9ac['id']:null,_0x28d9ac?_0x28d9ac[_0x8f80('0xa')]:null,_0x28d9ac?_0x28d9ac[_0x8f80('0xb')]:null,getInteractionId(_0x1899a8,_0x5a3530,_0x2f0939),_0x1899a8?JSON['stringify'](_0x1899a8):_0x8f80('0xc'));}function updateUser(_0x335bb8,_0x34096d,_0x127c89,_0xa95119,_0xb69cc){db[_[_0x8f80('0x7')](_0xa95119)+'Interaction'][_0x8f80('0xd')]({'where':{'id':getInteractionId(_0x34096d,_0x127c89,_0xa95119)}})[_0x8f80('0xe')](function(_0x53bbf0){if(_0x53bbf0){return _0x53bbf0[_0x8f80('0xf')]({'UserId':_0x335bb8?_0x335bb8['id']:null});}})[_0x8f80('0xe')](function(_0x2280c8){if(_0x2280c8){log(_0x8f80('0x10'),_0x335bb8,_0x34096d,_0x127c89,_0xa95119,_0xb69cc);}})['catch'](function(){log(_0x8f80('0x11'),_0x335bb8,_0x34096d,_0x127c89,_0xa95119,_0xb69cc);});}exports['tracked']=function(_0x1ffac1,_0x16187d){return function(_0x1fba32,_0x586e3c,_0x329f9b){var _0x2306de=_0x1fba32[_0x8f80('0x12')];var _0x2d0a8c={};var _0x1a245d=_0x1fba32['query'];if(_0x2d0a8c){_0x2d0a8c=_['clone'](_0x1fba32[_0x8f80('0x13')]);_0x2d0a8c=_[_0x8f80('0x14')](_0x2d0a8c,[_0x8f80('0x13'),'html',_0x8f80('0x15'),_0x8f80('0x16'),_0x8f80('0x17')]);}updateUser(_0x2306de,_0x2d0a8c,_0x1a245d,_0x1ffac1,_0x16187d);_0x329f9b(null);};};
\ No newline at end of file