Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / services / routing / server / applications / tag.js
index ef7551f..7315d36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0940=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','isObject','validate','../../rpc/chatInteraction'];(function(_0x19fa0c,_0x35682c){var _0x21c902=function(_0x554d6a){while(--_0x554d6a){_0x19fa0c['push'](_0x19fa0c['shift']());}};_0x21c902(++_0x35682c);}(_0x0940,0x15c));var _0x0094=function(_0x48cc3c,_0x1b32d1){_0x48cc3c=_0x48cc3c-0x0;var _0x5c11cd=_0x0940[_0x48cc3c];return _0x5c11cd;};'use strict';var schema=require(_0x0094('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0094('0x1')),'openchannelInteraction':require(_0x0094('0x2')),'smsInteraction':require(_0x0094('0x3')),'mailInteraction':require(_0x0094('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0094('0x5'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x0094('0x6'),'required':!![],'message':_0x0094('0x7')}});exports[_0x0094('0x8')]=function(_0x4cbac9,_0x1bb4fe,_0x2ba9a6,_0x4b4c3d){return function(_0x1762eb){try{var _0x12b848={'tag':_0x1bb4fe[0x0]};var _0x2c3c8f=tag[_0x0094('0x0')](_0x12b848,{'typecast':!![]});if(_0x2c3c8f[_0x0094('0x9')]){logger[_0x0094('0xa')]('[%s][TAG]\x20%s',_0x4cbac9,_['map'](_0x2c3c8f,_0x0094('0xb'))[_0x0094('0xc')](',\x20'));logger[_0x0094('0xd')](_0x0094('0xe'),_0x4cbac9);_0x1762eb[_0x0094('0xf')]();}else{var _0x3b4b79={'ids':[_0x1bb4fe[0x0]]};if(rpc[_0x4b4c3d[_0x0094('0x10')]+'Interaction']){rpc[_0x4b4c3d[_0x0094('0x10')]+_0x0094('0x11')][_0x0094('0x12')](_0x4b4c3d[_0x0094('0x13')]['id'],_0x3b4b79)['then'](function(_0x605689){logger[_0x0094('0xd')](_0x0094('0x14'),_0x4cbac9,_0x1bb4fe[0x1],_0x4b4c3d[_0x0094('0x10')],_0x4b4c3d['interaction']['id']);})[_0x0094('0x15')](function(_0xf4e63c){logger['error'](_0x0094('0x16'),_0x4cbac9,JSON[_0x0094('0x17')](_0xf4e63c));logger[_0x0094('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4cbac9);})['finally'](function(){_0x1762eb[_0x0094('0xf')]();});}}}catch(_0x2f65b2){logger[_0x0094('0xa')](_0x0094('0x16'),_0x4cbac9,_[_0x0094('0x18')](_0x2f65b2)?JSON[_0x0094('0x17')](_0x2f65b2):_0x2f65b2);logger[_0x0094('0xd')](_0x0094('0xe'),_0x4cbac9);_0x1762eb['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