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 _0xeac3=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','message','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xeac3,0x1f3));var _0x3eac=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeac3[_0x2641f9];return _0x585741;};'use strict';var schema=require(_0x3eac('0x0'));var _=require('lodash');var logger=require(_0x3eac('0x1'))('routing');var gotop=schema({'priority':{'type':_0x3eac('0x2'),'required':!![],'message':_0x3eac('0x3')}});exports[_0x3eac('0x4')]=function(_0xec023c,_0x77f43e){return function(_0x26a12d){try{var _0x1ebdc4={'priority':_0x77f43e[0x0]};var _0x37184c=gotop[_0x3eac('0x0')](_0x1ebdc4,{'typecast':!![]});if(_0x37184c[_0x3eac('0x5')]){logger['error'](_0x3eac('0x6'),_0xec023c,_['map'](_0x37184c,_0x3eac('0x7'))['join'](',\x20'));_0x26a12d['stop']();}else{logger[_0x3eac('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0xec023c,_0x1ebdc4['priority']);if(_0x1ebdc4[_0x3eac('0x9')]){var _0x1fb78e=_[_0x3eac('0xa')](_0x26a12d['rules'](),{'p':_0x1ebdc4['priority']});if(_0x1fb78e>=0x0){logger[_0x3eac('0x8')](_0x3eac('0xb'),_0xec023c,_0x1ebdc4[_0x3eac('0x9')]||_0x3eac('0xc'),_0x1fb78e);_0x26a12d[_0x3eac('0xc')](_0x1fb78e);}else{logger[_0x3eac('0x8')](_0x3eac('0xd'),_0xec023c,_0x1ebdc4[_0x3eac('0x9')]||_0x3eac('0xc'));_0x26a12d[_0x3eac('0xe')]();}}else{_0x26a12d[_0x3eac('0xc')]();}}}catch(_0x544eea){logger['error']('[%s][GOTOP]\x20%s',_0xec023c,JSON[_0x3eac('0xf')](_0x544eea));_0x26a12d['stop']();}};};