Built motion from commit (unavailable).|2.4.11
[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 _0x1df2=['../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','[%s][GOTOP]\x20%s','stringify','validate','lodash'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x1df2,0x18d));var _0x21df=function(_0x4a17fb,_0x3b42a6){_0x4a17fb=_0x4a17fb-0x0;var _0x1d3b7c=_0x1df2[_0x4a17fb];return _0x1d3b7c;};'use strict';var schema=require(_0x21df('0x0'));var _=require(_0x21df('0x1'));var logger=require(_0x21df('0x2'))(_0x21df('0x3'));var gotop=schema({'priority':{'type':_0x21df('0x4'),'required':!![],'message':_0x21df('0x5')}});exports[_0x21df('0x6')]=function(_0x3e6a61,_0x2c99e3){return function(_0x439a13){try{var _0x1366fb={'priority':_0x2c99e3[0x0]};var _0xb2b3d0=gotop[_0x21df('0x0')](_0x1366fb,{'typecast':!![]});if(_0xb2b3d0[_0x21df('0x7')]){logger[_0x21df('0x8')]('[%s][GOTOP]\x20%s',_0x3e6a61,_['map'](_0xb2b3d0,_0x21df('0x9'))[_0x21df('0xa')](',\x20'));_0x439a13['stop']();}else{logger[_0x21df('0xb')](_0x21df('0xc'),_0x3e6a61,_0x1366fb['priority']);if(_0x1366fb[_0x21df('0xd')]){var _0x2b983e=_[_0x21df('0xe')](_0x439a13[_0x21df('0xf')](),{'p':_0x1366fb[_0x21df('0xd')]});if(_0x2b983e>=0x0){logger['info'](_0x21df('0x10'),_0x3e6a61,_0x1366fb[_0x21df('0xd')]||_0x21df('0x11'),_0x2b983e);_0x439a13[_0x21df('0x11')](_0x2b983e);}else{logger[_0x21df('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3e6a61,_0x1366fb[_0x21df('0xd')]||'next');_0x439a13[_0x21df('0x12')]();}}else{_0x439a13[_0x21df('0x11')]();}}}catch(_0x4da228){logger[_0x21df('0x8')](_0x21df('0x13'),_0x3e6a61,JSON[_0x21df('0x14')](_0x4da228));_0x439a13['stop']();}};};