Built motion from commit (unavailable).|2.4.10
[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 _0x4c67=['priority','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','join','[%s][GOTOP]\x20priority\x20%s'];(function(_0xd676ab,_0x591b80){var _0x48d978=function(_0x5af949){while(--_0x5af949){_0xd676ab['push'](_0xd676ab['shift']());}};_0x48d978(++_0x591b80);}(_0x4c67,0x170));var _0x74c6=function(_0xa3c669,_0x55650f){_0xa3c669=_0xa3c669-0x0;var _0x219746=_0x4c67[_0xa3c669];return _0x219746;};'use strict';var schema=require(_0x74c6('0x0'));var _=require(_0x74c6('0x1'));var logger=require(_0x74c6('0x2'))(_0x74c6('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x74c6('0x4')}});exports[_0x74c6('0x5')]=function(_0x3b4a3a,_0x44667c){return function(_0x10233f){try{var _0x193a07={'priority':_0x44667c[0x0]};var _0x127875=gotop['validate'](_0x193a07,{'typecast':!![]});if(_0x127875['length']){logger['error'](_0x74c6('0x6'),_0x3b4a3a,_[_0x74c6('0x7')](_0x127875,'message')[_0x74c6('0x8')](',\x20'));_0x10233f['stop']();}else{logger['info'](_0x74c6('0x9'),_0x3b4a3a,_0x193a07[_0x74c6('0xa')]);if(_0x193a07[_0x74c6('0xa')]){var _0x205045=_['findIndex'](_0x10233f[_0x74c6('0xb')](),{'p':_0x193a07[_0x74c6('0xa')]});if(_0x205045>=0x0){logger[_0x74c6('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3b4a3a,_0x193a07['priority']||_0x74c6('0xd'),_0x205045);_0x10233f[_0x74c6('0xd')](_0x205045);}else{logger[_0x74c6('0xc')](_0x74c6('0xe'),_0x3b4a3a,_0x193a07['priority']||_0x74c6('0xd'));_0x10233f[_0x74c6('0xf')]();}}else{_0x10233f['next']();}}}catch(_0x253931){logger[_0x74c6('0x10')]('[%s][GOTOP]\x20%s',_0x3b4a3a,JSON[_0x74c6('0x11')](_0x253931));_0x10233f['stop']();}};};