Built motion from commit f7863d46.|2.5.41
[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 _0xb6b5=['error','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','../../../../config/logger','routing','number','consequence'];(function(_0x4d2020,_0x4b6ee3){var _0x17863b=function(_0x31f1c7){while(--_0x31f1c7){_0x4d2020['push'](_0x4d2020['shift']());}};_0x17863b(++_0x4b6ee3);}(_0xb6b5,0x1a3));var _0x5b6b=function(_0x177e14,_0x401d6b){_0x177e14=_0x177e14-0x0;var _0x4dcdfe=_0xb6b5[_0x177e14];return _0x4dcdfe;};'use strict';var schema=require(_0x5b6b('0x0'));var _=require(_0x5b6b('0x1'));var logger=require(_0x5b6b('0x2'))(_0x5b6b('0x3'));var gotop=schema({'priority':{'type':_0x5b6b('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x5b6b('0x5')]=function(_0x4077ed,_0x3544bd){return function(_0x534eac){try{var _0x4ad08a={'priority':_0x3544bd[0x0]};var _0x290cdd=gotop[_0x5b6b('0x0')](_0x4ad08a,{'typecast':!![]});if(_0x290cdd['length']){logger[_0x5b6b('0x6')]('[%s][GOTOP]\x20%s',_0x4077ed,_['map'](_0x290cdd,_0x5b6b('0x7'))[_0x5b6b('0x8')](',\x20'));_0x534eac['stop']();}else{logger[_0x5b6b('0x9')](_0x5b6b('0xa'),_0x4077ed,_0x4ad08a[_0x5b6b('0xb')]);if(_0x4ad08a['priority']){var _0x240804=_[_0x5b6b('0xc')](_0x534eac['rules'](),{'p':_0x4ad08a[_0x5b6b('0xb')]});if(_0x240804>=0x0){logger[_0x5b6b('0x9')](_0x5b6b('0xd'),_0x4077ed,_0x4ad08a['priority']||_0x5b6b('0xe'),_0x240804);_0x534eac['next'](_0x240804);}else{logger[_0x5b6b('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x4077ed,_0x4ad08a[_0x5b6b('0xb')]||_0x5b6b('0xe'));_0x534eac[_0x5b6b('0xf')]();}}else{_0x534eac[_0x5b6b('0xe')]();}}}catch(_0x349a6b){logger[_0x5b6b('0x6')]('[%s][GOTOP]\x20%s',_0x4077ed,JSON[_0x5b6b('0x10')](_0x349a6b));_0x534eac[_0x5b6b('0xf')]();}};};