Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / services / routing / server / applications / tag.js
index f78002d..7315d36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b38=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','isObject','stringify','validate','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4b38,0x164));var _0x84b3=function(_0x5b25c2,_0x549b6e){_0x5b25c2=_0x5b25c2-0x0;var _0x370787=_0x4b38[_0x5b25c2];return _0x370787;};'use strict';var schema=require(_0x84b3('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x84b3('0x1')),'mailInteraction':require(_0x84b3('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x84b3('0x3'));var tag=schema({'tag':{'type':_0x84b3('0x4'),'required':!![],'message':_0x84b3('0x5')}});exports[_0x84b3('0x6')]=function(_0x2b5351,_0x212b63,_0x3c9ef5,_0x3e793d){return function(_0x334df1){try{var _0x54955c={'tag':_0x212b63[0x0]};var _0x115637=tag['validate'](_0x54955c,{'typecast':!![]});if(_0x115637['length']){logger[_0x84b3('0x7')](_0x84b3('0x8'),_0x2b5351,_[_0x84b3('0x9')](_0x115637,_0x84b3('0xa'))[_0x84b3('0xb')](',\x20'));logger[_0x84b3('0xc')](_0x84b3('0xd'),_0x2b5351);_0x334df1[_0x84b3('0xe')]();}else{var _0x5564ec={'ids':[_0x212b63[0x0]]};if(rpc[_0x3e793d[_0x84b3('0xf')]+_0x84b3('0x10')]){rpc[_0x3e793d[_0x84b3('0xf')]+_0x84b3('0x10')]['addTags'](_0x3e793d[_0x84b3('0x11')]['id'],_0x5564ec)['then'](function(_0x15cc44){logger[_0x84b3('0xc')](_0x84b3('0x12'),_0x2b5351,_0x212b63[0x1],_0x3e793d['channel'],_0x3e793d[_0x84b3('0x11')]['id']);})['catch'](function(_0x149901){logger[_0x84b3('0x7')](_0x84b3('0x8'),_0x2b5351,JSON['stringify'](_0x149901));logger['info'](_0x84b3('0xd'),_0x2b5351);})[_0x84b3('0x13')](function(){_0x334df1[_0x84b3('0xe')]();});}}}catch(_0xf193d9){logger[_0x84b3('0x7')](_0x84b3('0x8'),_0x2b5351,_[_0x84b3('0x14')](_0xf193d9)?JSON[_0x84b3('0x15')](_0xf193d9):_0xf193d9);logger[_0x84b3('0xc')](_0x84b3('0xd'),_0x2b5351);_0x334df1['next']();}};};
\ No newline at end of file
+var _0x2b1d=['number','consequence','length','error','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20%s','stringify','info','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x516eb0,_0x364900){var _0x42f325=function(_0x84fb7){while(--_0x84fb7){_0x516eb0['push'](_0x516eb0['shift']());}};_0x42f325(++_0x364900);}(_0x2b1d,0x87));var _0xd2b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b1d[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xd2b1('0x0'));var _=require(_0xd2b1('0x1'));var rpc={'chatInteraction':require(_0xd2b1('0x2')),'openchannelInteraction':require(_0xd2b1('0x3')),'smsInteraction':require(_0xd2b1('0x4')),'mailInteraction':require(_0xd2b1('0x5')),'faxInteraction':require(_0xd2b1('0x6')),'whatsappInteraction':require(_0xd2b1('0x7'))};var logger=require(_0xd2b1('0x8'))('routing');var tag=schema({'tag':{'type':_0xd2b1('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xd2b1('0xa')]=function(_0x5812e8,_0x30675c,_0x2db14a,_0x289f19){return function(_0x1c064e){try{var _0x49caa8={'tag':_0x30675c[0x0]};var _0x530899=tag['validate'](_0x49caa8,{'typecast':!![]});if(_0x530899[_0xd2b1('0xb')]){logger[_0xd2b1('0xc')]('[%s][TAG]\x20%s',_0x5812e8,_[_0xd2b1('0xd')](_0x530899,'message')[_0xd2b1('0xe')](',\x20'));logger['info'](_0xd2b1('0xf'),_0x5812e8);_0x1c064e[_0xd2b1('0x10')]();}else{var _0x4d694b={'ids':[_0x30675c[0x0]]};if(rpc[_0x289f19[_0xd2b1('0x11')]+_0xd2b1('0x12')]){rpc[_0x289f19[_0xd2b1('0x11')]+'Interaction'][_0xd2b1('0x13')](_0x289f19['interaction']['id'],_0x4d694b)['then'](function(_0x2c7db2){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5812e8,_0x30675c[0x1],_0x289f19[_0xd2b1('0x11')],_0x289f19[_0xd2b1('0x14')]['id']);})['catch'](function(_0x316414){logger['error'](_0xd2b1('0x15'),_0x5812e8,JSON[_0xd2b1('0x16')](_0x316414));logger[_0xd2b1('0x17')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5812e8);})['finally'](function(){_0x1c064e[_0xd2b1('0x10')]();});}}}catch(_0x38e810){logger['error'](_0xd2b1('0x15'),_0x5812e8,_['isObject'](_0x38e810)?JSON[_0xd2b1('0x16')](_0x38e810):_0x38e810);logger[_0xd2b1('0x17')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5812e8);_0x1c064e['next']();}};};
\ No newline at end of file