Built motion from commit 9d7072cc.|2.5.39
[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 _0xc48a=['[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xc48a,0xd4));var _0xac48=function(_0x4347c1,_0x5bc766){_0x4347c1=_0x4347c1-0x0;var _0x565689=_0xc48a[_0x4347c1];return _0x565689;};'use strict';var schema=require(_0xac48('0x0'));var _=require(_0xac48('0x1'));var logger=require(_0xac48('0x2'))(_0xac48('0x3'));var gotop=schema({'priority':{'type':_0xac48('0x4'),'required':!![],'message':_0xac48('0x5')}});exports[_0xac48('0x6')]=function(_0x4a8e6d,_0x432f20){return function(_0x3d0ff6){try{var _0x5c1b01={'priority':_0x432f20[0x0]};var _0x4f5df3=gotop[_0xac48('0x0')](_0x5c1b01,{'typecast':!![]});if(_0x4f5df3['length']){logger[_0xac48('0x7')](_0xac48('0x8'),_0x4a8e6d,_[_0xac48('0x9')](_0x4f5df3,_0xac48('0xa'))[_0xac48('0xb')](',\x20'));_0x3d0ff6[_0xac48('0xc')]();}else{logger[_0xac48('0xd')](_0xac48('0xe'),_0x4a8e6d,_0x5c1b01[_0xac48('0xf')]);if(_0x5c1b01[_0xac48('0xf')]){var _0x361f2c=_[_0xac48('0x10')](_0x3d0ff6[_0xac48('0x11')](),{'p':_0x5c1b01[_0xac48('0xf')]});if(_0x361f2c>=0x0){logger[_0xac48('0xd')](_0xac48('0x12'),_0x4a8e6d,_0x5c1b01[_0xac48('0xf')]||_0xac48('0x13'),_0x361f2c);_0x3d0ff6[_0xac48('0x13')](_0x361f2c);}else{logger['info'](_0xac48('0x14'),_0x4a8e6d,_0x5c1b01[_0xac48('0xf')]||'next');_0x3d0ff6[_0xac48('0xc')]();}}else{_0x3d0ff6['next']();}}}catch(_0x43d35f){logger[_0xac48('0x7')]('[%s][GOTOP]\x20%s',_0x4a8e6d,JSON[_0xac48('0x15')](_0x43d35f));_0x3d0ff6[_0xac48('0xc')]();}};};