Built motion from commit dbf3a7e2.|2.6.30
[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 _0x8dfb=['priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','consequence','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0xc703ef,_0x45177c){var _0x5147b3=function(_0x456242){while(--_0x456242){_0xc703ef['push'](_0xc703ef['shift']());}};_0x5147b3(++_0x45177c);}(_0x8dfb,0x75));var _0xb8df=function(_0x21bf22,_0x16172a){_0x21bf22=_0x21bf22-0x0;var _0x144ee9=_0x8dfb[_0x21bf22];return _0x144ee9;};'use strict';var schema=require(_0xb8df('0x0'));var _=require(_0xb8df('0x1'));var logger=require(_0xb8df('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xb8df('0x3')]=function(_0x43f240,_0x7eba77){return function(_0x1fb8c6){try{var _0x51ec57={'priority':_0x7eba77[0x0]};var _0x1eeb96=gotop[_0xb8df('0x0')](_0x51ec57,{'typecast':!![]});if(_0x1eeb96['length']){logger[_0xb8df('0x4')](_0xb8df('0x5'),_0x43f240,_['map'](_0x1eeb96,_0xb8df('0x6'))[_0xb8df('0x7')](',\x20'));_0x1fb8c6[_0xb8df('0x8')]();}else{logger[_0xb8df('0x9')](_0xb8df('0xa'),_0x43f240,_0x51ec57[_0xb8df('0xb')]);if(_0x51ec57[_0xb8df('0xb')]){var _0x48a7c8=_['findIndex'](_0x1fb8c6['rules'](),{'p':_0x51ec57[_0xb8df('0xb')]});if(_0x48a7c8>=0x0){logger[_0xb8df('0x9')](_0xb8df('0xc'),_0x43f240,_0x51ec57[_0xb8df('0xb')]||_0xb8df('0xd'),_0x48a7c8);_0x1fb8c6['next'](_0x48a7c8);}else{logger[_0xb8df('0x9')](_0xb8df('0xe'),_0x43f240,_0x51ec57[_0xb8df('0xb')]||_0xb8df('0xd'));_0x1fb8c6[_0xb8df('0x8')]();}}else{_0x1fb8c6[_0xb8df('0xd')]();}}}catch(_0x18f8fb){logger[_0xb8df('0x4')]('[%s][GOTOP]\x20%s',_0x43f240,JSON[_0xb8df('0xf')](_0x18f8fb));_0x1fb8c6[_0xb8df('0x8')]();}};};