Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / components / interaction / service.js
index e7a5bcb..eb784dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fc4=['info','catch','error','tracked','user','query','body','omit','html','mobile','lodash','../../mysqldb','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update'];(function(_0x3aa3a4,_0x23407d){var _0x155625=function(_0x54aa10){while(--_0x54aa10){_0x3aa3a4['push'](_0x3aa3a4['shift']());}};_0x155625(++_0x23407d);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x6fc4[_0x14e27a];return _0x288688;};'use strict';var _=require(_0x46fc('0x0'));var db=require(_0x46fc('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x46fc('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x46fc('0x2'))(_0x46fc('0x3')),'chat':require(_0x46fc('0x2'))(_0x46fc('0x4')),'whatsapp':require(_0x46fc('0x2'))(_0x46fc('0x5'))};function getInteractionId(_0x3c4f75,_0x3951e9,_0x5ca981){if(_0x3c4f75&&_0x3c4f75[_['upperFirst'](_0x5ca981)+_0x46fc('0x6')]){return _0x3c4f75[_[_0x46fc('0x7')](_0x5ca981)+_0x46fc('0x6')];}else if(_0x3c4f75&&_0x3c4f75['id']){return _0x3c4f75['id'];}else if(_0x3951e9&&_0x3951e9['id']){return _0x3951e9['id'];}else{return _0x46fc('0x8');}}function log(_0x5ef080,_0x51d875,_0x1fbb9b,_0xa1283a,_0x5431e8,_0x5b7bf8){loggers[_0x5431e8['toLowerCase']()][_0x5ef080](_0x46fc('0x9'),_0x5b7bf8[_0x46fc('0xa')](),_0x51d875?_0x51d875['id']:null,_0x51d875?_0x51d875[_0x46fc('0xb')]:null,_0x51d875?_0x51d875[_0x46fc('0xc')]:null,getInteractionId(_0x1fbb9b,_0xa1283a,_0x5431e8),_0x1fbb9b?JSON[_0x46fc('0xd')](_0x1fbb9b):_0x46fc('0xe'));}function updateUser(_0x1013ae,_0x25ee84,_0x10ba21,_0x139971,_0x34a019){db[_[_0x46fc('0x7')](_0x139971)+_0x46fc('0xf')][_0x46fc('0x10')]({'where':{'id':getInteractionId(_0x25ee84,_0x10ba21,_0x139971)}})[_0x46fc('0x11')](function(_0x39aa74){if(_0x39aa74){return _0x39aa74[_0x46fc('0x12')]({'UserId':_0x1013ae?_0x1013ae['id']:null});}})[_0x46fc('0x11')](function(_0x51ab37){if(_0x51ab37){log(_0x46fc('0x13'),_0x1013ae,_0x25ee84,_0x10ba21,_0x139971,_0x34a019);}})[_0x46fc('0x14')](function(){log(_0x46fc('0x15'),_0x1013ae,_0x25ee84,_0x10ba21,_0x139971,_0x34a019);});}exports[_0x46fc('0x16')]=function(_0xd40ad2,_0x5baa81){return function(_0x23b041,_0xf7a2ed,_0x2ebd06){var _0x39fc89=_0x23b041[_0x46fc('0x17')];var _0x21aea4={};var _0x5d168a=_0x23b041[_0x46fc('0x18')];if(_0x21aea4){_0x21aea4=_['clone'](_0x23b041[_0x46fc('0x19')]);_0x21aea4=_[_0x46fc('0x1a')](_0x21aea4,[_0x46fc('0x19'),_0x46fc('0x1b'),'phone','fax',_0x46fc('0x1c')]);}updateUser(_0x39fc89,_0x21aea4,_0x5d168a,_0xd40ad2,_0x5baa81);_0x2ebd06(null);};};
\ No newline at end of file
+var _0xf569=['../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','name','stringify','Interaction','findOne','then','update','info','catch','error','tracked','query','clone','body','html','phone','fax','mobile'];(function(_0x5b46d5,_0x1947de){var _0x181371=function(_0x15696d){while(--_0x15696d){_0x5b46d5['push'](_0x5b46d5['shift']());}};_0x181371(++_0x1947de);}(_0xf569,0xd0));var _0x9f56=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xf569[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var db=require(_0x9f56('0x0'))['db'];var loggers={'openchannel':require(_0x9f56('0x1'))(_0x9f56('0x2')),'mail':require(_0x9f56('0x1'))(_0x9f56('0x3')),'fax':require(_0x9f56('0x1'))(_0x9f56('0x4')),'sms':require(_0x9f56('0x1'))('sms-interactions'),'chat':require(_0x9f56('0x1'))('chat-interactions'),'whatsapp':require(_0x9f56('0x1'))(_0x9f56('0x5'))};function getInteractionId(_0x5c5e5f,_0x1bcede,_0x73c3b4){if(_0x5c5e5f&&_0x5c5e5f[_['upperFirst'](_0x73c3b4)+_0x9f56('0x6')]){return _0x5c5e5f[_[_0x9f56('0x7')](_0x73c3b4)+_0x9f56('0x6')];}else if(_0x5c5e5f&&_0x5c5e5f['id']){return _0x5c5e5f['id'];}else if(_0x1bcede&&_0x1bcede['id']){return _0x1bcede['id'];}else{return'unknown';}}function log(_0x4a4569,_0x3172a3,_0x1fb07e,_0x4bfa64,_0x1ae262,_0x67f679){loggers[_0x1ae262[_0x9f56('0x8')]()][_0x4a4569]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x67f679['toUpperCase'](),_0x3172a3?_0x3172a3['id']:null,_0x3172a3?_0x3172a3[_0x9f56('0x9')]:null,_0x3172a3?_0x3172a3['role']:null,getInteractionId(_0x1fb07e,_0x4bfa64,_0x1ae262),_0x1fb07e?JSON[_0x9f56('0xa')](_0x1fb07e):'null');}function updateUser(_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587){db[_[_0x9f56('0x7')](_0x5af8ab)+_0x9f56('0xb')][_0x9f56('0xc')]({'where':{'id':getInteractionId(_0x293687,_0x4230ea,_0x5af8ab)}})[_0x9f56('0xd')](function(_0x8e3485){if(_0x8e3485){return _0x8e3485[_0x9f56('0xe')]({'UserId':_0x4dfeb3?_0x4dfeb3['id']:null});}})[_0x9f56('0xd')](function(_0x4228f5){if(_0x4228f5){log(_0x9f56('0xf'),_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587);}})[_0x9f56('0x10')](function(){log(_0x9f56('0x11'),_0x4dfeb3,_0x293687,_0x4230ea,_0x5af8ab,_0x227587);});}exports[_0x9f56('0x12')]=function(_0x9c39ec,_0x131130){return function(_0x21808b,_0x1bbbae,_0x175dbe){var _0x5bd236=_0x21808b['user'];var _0x2d01d8={};var _0x2294aa=_0x21808b[_0x9f56('0x13')];if(_0x2d01d8){_0x2d01d8=_[_0x9f56('0x14')](_0x21808b[_0x9f56('0x15')]);_0x2d01d8=_['omit'](_0x2d01d8,[_0x9f56('0x15'),_0x9f56('0x16'),_0x9f56('0x17'),_0x9f56('0x18'),_0x9f56('0x19')]);}updateUser(_0x5bd236,_0x2d01d8,_0x2294aa,_0x9c39ec,_0x131130);_0x175dbe(null);};};
\ No newline at end of file