9b8d147c341424fb872c36cc8f3b71ee3fc24ee8
[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 _0x936d=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','length','error','[%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'];(function(_0x799164,_0x52b8c2){var _0x404f7e=function(_0x5e26a8){while(--_0x5e26a8){_0x799164['push'](_0x799164['shift']());}};_0x404f7e(++_0x52b8c2);}(_0x936d,0x1cf));var _0xd936=function(_0x5b82eb,_0x13484a){_0x5b82eb=_0x5b82eb-0x0;var _0x4e27f6=_0x936d[_0x5b82eb];return _0x4e27f6;};'use strict';var schema=require(_0xd936('0x0'));var _=require('lodash');var logger=require(_0xd936('0x1'))(_0xd936('0x2'));var gotop=schema({'priority':{'type':_0xd936('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x17e3c3,_0x3fe5d1){return function(_0x4da902){try{var _0x4e0ad8={'priority':_0x3fe5d1[0x0]};var _0x56f0da=gotop[_0xd936('0x0')](_0x4e0ad8,{'typecast':!![]});if(_0x56f0da[_0xd936('0x4')]){logger[_0xd936('0x5')](_0xd936('0x6'),_0x17e3c3,_[_0xd936('0x7')](_0x56f0da,_0xd936('0x8'))[_0xd936('0x9')](',\x20'));_0x4da902[_0xd936('0xa')]();}else{logger[_0xd936('0xb')](_0xd936('0xc'),_0x17e3c3,_0x4e0ad8['priority']);if(_0x4e0ad8[_0xd936('0xd')]){var _0xe2acf0=_[_0xd936('0xe')](_0x4da902[_0xd936('0xf')](),{'p':_0x4e0ad8[_0xd936('0xd')]});if(_0xe2acf0>=0x0){logger[_0xd936('0xb')](_0xd936('0x10'),_0x17e3c3,_0x4e0ad8[_0xd936('0xd')]||_0xd936('0x11'),_0xe2acf0);_0x4da902['next'](_0xe2acf0);}else{logger[_0xd936('0xb')](_0xd936('0x12'),_0x17e3c3,_0x4e0ad8[_0xd936('0xd')]||_0xd936('0x11'));_0x4da902['stop']();}}else{_0x4da902[_0xd936('0x11')]();}}}catch(_0xa60b78){logger['error'](_0xd936('0x6'),_0x17e3c3,JSON[_0xd936('0x13')](_0xa60b78));_0x4da902[_0xd936('0xa')]();}};};