Built motion from commit (unavailable).|2.3.1
[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 _0x8280=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','stringify','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s'];(function(_0x37d958,_0x312f4a){var _0x1c9292=function(_0x25bdca){while(--_0x25bdca){_0x37d958['push'](_0x37d958['shift']());}};_0x1c9292(++_0x312f4a);}(_0x8280,0xd5));var _0x0828=function(_0x3fb780,_0x540d09){_0x3fb780=_0x3fb780-0x0;var _0x49bcf4=_0x8280[_0x3fb780];return _0x49bcf4;};'use strict';var schema=require(_0x0828('0x0'));var _=require('lodash');var logger=require(_0x0828('0x1'))('routing');var gotop=schema({'priority':{'type':_0x0828('0x2'),'required':!![],'message':_0x0828('0x3')}});exports[_0x0828('0x4')]=function(_0x1ff658,_0x3f4fce){return function(_0x1e637f){try{var _0x54d96b={'priority':_0x3f4fce[0x0]};var _0x11d775=gotop[_0x0828('0x0')](_0x54d96b,{'typecast':!![]});if(_0x11d775[_0x0828('0x5')]){logger['error'](_0x0828('0x6'),_0x1ff658,_[_0x0828('0x7')](_0x11d775,_0x0828('0x8'))[_0x0828('0x9')](',\x20'));_0x1e637f[_0x0828('0xa')]();}else{logger[_0x0828('0xb')](_0x0828('0xc'),_0x1ff658,_0x54d96b[_0x0828('0xd')]);if(_0x54d96b[_0x0828('0xd')]){var _0xd6eda9=_[_0x0828('0xe')](_0x1e637f[_0x0828('0xf')](),{'p':_0x54d96b[_0x0828('0xd')]});if(_0xd6eda9>=0x0){logger['info'](_0x0828('0x10'),_0x1ff658,_0x54d96b[_0x0828('0xd')]||_0x0828('0x11'),_0xd6eda9);_0x1e637f[_0x0828('0x11')](_0xd6eda9);}else{logger[_0x0828('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1ff658,_0x54d96b[_0x0828('0xd')]||_0x0828('0x11'));_0x1e637f[_0x0828('0xa')]();}}else{_0x1e637f['next']();}}}catch(_0x4a13e7){logger[_0x0828('0x12')](_0x0828('0x6'),_0x1ff658,JSON[_0x0828('0x13')](_0x4a13e7));_0x1e637f['stop']();}};};