Built motion from commit (unavailable).|2.5.20
[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 _0x7b3e=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x11b089,_0x3b9882){var _0x431ef4=function(_0xcf20d5){while(--_0xcf20d5){_0x11b089['push'](_0x11b089['shift']());}};_0x431ef4(++_0x3b9882);}(_0x7b3e,0x1e7));var _0xe7b3=function(_0x29d09e,_0x4c89ea){_0x29d09e=_0x29d09e-0x0;var _0x588601=_0x7b3e[_0x29d09e];return _0x588601;};'use strict';var schema=require(_0xe7b3('0x0'));var _=require(_0xe7b3('0x1'));var logger=require(_0xe7b3('0x2'))(_0xe7b3('0x3'));var gotop=schema({'priority':{'type':_0xe7b3('0x4'),'required':!![],'message':_0xe7b3('0x5')}});exports[_0xe7b3('0x6')]=function(_0x455989,_0x2bb77a){return function(_0x50a6e4){try{var _0x698fb6={'priority':_0x2bb77a[0x0]};var _0x4af9e9=gotop['validate'](_0x698fb6,{'typecast':!![]});if(_0x4af9e9[_0xe7b3('0x7')]){logger[_0xe7b3('0x8')](_0xe7b3('0x9'),_0x455989,_[_0xe7b3('0xa')](_0x4af9e9,'message')[_0xe7b3('0xb')](',\x20'));_0x50a6e4['stop']();}else{logger[_0xe7b3('0xc')](_0xe7b3('0xd'),_0x455989,_0x698fb6[_0xe7b3('0xe')]);if(_0x698fb6[_0xe7b3('0xe')]){var _0x5ed08c=_['findIndex'](_0x50a6e4[_0xe7b3('0xf')](),{'p':_0x698fb6[_0xe7b3('0xe')]});if(_0x5ed08c>=0x0){logger['info'](_0xe7b3('0x10'),_0x455989,_0x698fb6[_0xe7b3('0xe')]||'next',_0x5ed08c);_0x50a6e4[_0xe7b3('0x11')](_0x5ed08c);}else{logger['info'](_0xe7b3('0x12'),_0x455989,_0x698fb6[_0xe7b3('0xe')]||'next');_0x50a6e4[_0xe7b3('0x13')]();}}else{_0x50a6e4[_0xe7b3('0x11')]();}}}catch(_0x1b9544){logger[_0xe7b3('0x8')](_0xe7b3('0x9'),_0x455989,JSON[_0xe7b3('0x14')](_0x1b9544));_0x50a6e4[_0xe7b3('0x13')]();}};};