Built motion from commit (unavailable).|2.5.4
[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 _0x44af=['../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','validate','lodash'];(function(_0x5384ae,_0x32e603){var _0x4bcf2d=function(_0x5c8e1b){while(--_0x5c8e1b){_0x5384ae['push'](_0x5384ae['shift']());}};_0x4bcf2d(++_0x32e603);}(_0x44af,0x96));var _0xf44a=function(_0x4d7df6,_0x3f6139){_0x4d7df6=_0x4d7df6-0x0;var _0x4c0d29=_0x44af[_0x4d7df6];return _0x4c0d29;};'use strict';var schema=require(_0xf44a('0x0'));var _=require(_0xf44a('0x1'));var logger=require(_0xf44a('0x2'))(_0xf44a('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xf44a('0x4')}});exports['consequence']=function(_0x3084ff,_0xfcab17){return function(_0x34046f){try{var _0x11c93e={'priority':_0xfcab17[0x0]};var _0x3fe6ad=gotop[_0xf44a('0x0')](_0x11c93e,{'typecast':!![]});if(_0x3fe6ad[_0xf44a('0x5')]){logger[_0xf44a('0x6')](_0xf44a('0x7'),_0x3084ff,_[_0xf44a('0x8')](_0x3fe6ad,'message')[_0xf44a('0x9')](',\x20'));_0x34046f[_0xf44a('0xa')]();}else{logger[_0xf44a('0xb')](_0xf44a('0xc'),_0x3084ff,_0x11c93e['priority']);if(_0x11c93e[_0xf44a('0xd')]){var _0x1aabcf=_['findIndex'](_0x34046f[_0xf44a('0xe')](),{'p':_0x11c93e[_0xf44a('0xd')]});if(_0x1aabcf>=0x0){logger[_0xf44a('0xb')](_0xf44a('0xf'),_0x3084ff,_0x11c93e[_0xf44a('0xd')]||'next',_0x1aabcf);_0x34046f['next'](_0x1aabcf);}else{logger[_0xf44a('0xb')](_0xf44a('0x10'),_0x3084ff,_0x11c93e[_0xf44a('0xd')]||'next');_0x34046f[_0xf44a('0xa')]();}}else{_0x34046f[_0xf44a('0x11')]();}}}catch(_0x4278c4){logger['error'](_0xf44a('0x7'),_0x3084ff,JSON[_0xf44a('0x12')](_0x4278c4));_0x34046f[_0xf44a('0xa')]();}};};