Built motion from commit 25580385.|2.6.2
[motion2.git] / server / services / routing / server / applications / gotop.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xb736=['priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing','number','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s'];(function(_0xe17029,_0x36c395){var _0x5ce796=function(_0x123f12){while(--_0x123f12){_0xe17029['push'](_0xe17029['shift']());}};_0x5ce796(++_0x36c395);}(_0xb736,0x104));var _0x6b73=function(_0x3e3b5c,_0x1733c3){_0x3e3b5c=_0x3e3b5c-0x0;var _0x5009a3=_0xb736[_0x3e3b5c];return _0x5009a3;};'use strict';var schema=require(_0x6b73('0x0'));var _=require(_0x6b73('0x1'));var logger=require(_0x6b73('0x2'))(_0x6b73('0x3'));var gotop=schema({'priority':{'type':_0x6b73('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x587c60,_0x3a21fc){return function(_0xbaadd6){try{var _0x494de6={'priority':_0x3a21fc[0x0]};var _0xd1607d=gotop[_0x6b73('0x0')](_0x494de6,{'typecast':!![]});if(_0xd1607d['length']){logger[_0x6b73('0x5')](_0x6b73('0x6'),_0x587c60,_[_0x6b73('0x7')](_0xd1607d,_0x6b73('0x8'))[_0x6b73('0x9')](',\x20'));_0xbaadd6[_0x6b73('0xa')]();}else{logger['info'](_0x6b73('0xb'),_0x587c60,_0x494de6[_0x6b73('0xc')]);if(_0x494de6['priority']){var _0x2b03f0=_[_0x6b73('0xd')](_0xbaadd6['rules'](),{'p':_0x494de6[_0x6b73('0xc')]});if(_0x2b03f0>=0x0){logger['info'](_0x6b73('0xe'),_0x587c60,_0x494de6[_0x6b73('0xc')]||_0x6b73('0xf'),_0x2b03f0);_0xbaadd6[_0x6b73('0xf')](_0x2b03f0);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x587c60,_0x494de6[_0x6b73('0xc')]||_0x6b73('0xf'));_0xbaadd6[_0x6b73('0xa')]();}}else{_0xbaadd6['next']();}}}catch(_0x45bc9e){logger[_0x6b73('0x5')](_0x6b73('0x6'),_0x587c60,JSON['stringify'](_0x45bc9e));_0xbaadd6[_0x6b73('0xa')]();}};};