Built motion from commit f25620e4.|2.6.30
[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 _0x748c=['consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x9e5eec,_0x444242){var _0x5a5d60=function(_0x48b251){while(--_0x48b251){_0x9e5eec['push'](_0x9e5eec['shift']());}};_0x5a5d60(++_0x444242);}(_0x748c,0x150));var _0xc748=function(_0x179195,_0x1dcc71){_0x179195=_0x179195-0x0;var _0x3e0ab6=_0x748c[_0x179195];return _0x3e0ab6;};'use strict';var schema=require(_0xc748('0x0'));var _=require(_0xc748('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xc748('0x2'),'required':!![],'message':_0xc748('0x3')}});exports[_0xc748('0x4')]=function(_0x1da203,_0xe40ee9){return function(_0xf78c6e){try{var _0x1095b7={'priority':_0xe40ee9[0x0]};var _0x2a9062=gotop['validate'](_0x1095b7,{'typecast':!![]});if(_0x2a9062[_0xc748('0x5')]){logger[_0xc748('0x6')](_0xc748('0x7'),_0x1da203,_[_0xc748('0x8')](_0x2a9062,_0xc748('0x9'))['join'](',\x20'));_0xf78c6e[_0xc748('0xa')]();}else{logger['info'](_0xc748('0xb'),_0x1da203,_0x1095b7[_0xc748('0xc')]);if(_0x1095b7['priority']){var _0xdb4683=_[_0xc748('0xd')](_0xf78c6e[_0xc748('0xe')](),{'p':_0x1095b7[_0xc748('0xc')]});if(_0xdb4683>=0x0){logger[_0xc748('0xf')](_0xc748('0x10'),_0x1da203,_0x1095b7['priority']||_0xc748('0x11'),_0xdb4683);_0xf78c6e[_0xc748('0x11')](_0xdb4683);}else{logger[_0xc748('0xf')](_0xc748('0x12'),_0x1da203,_0x1095b7['priority']||_0xc748('0x11'));_0xf78c6e['stop']();}}else{_0xf78c6e[_0xc748('0x11')]();}}}catch(_0x329413){logger[_0xc748('0x6')](_0xc748('0x7'),_0x1da203,JSON[_0xc748('0x13')](_0x329413));_0xf78c6e[_0xc748('0xa')]();}};};