Built motion from commit 775e2a94.|2.6.3
[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 _0xdefd=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdefd,0x197));var _0xddef=function(_0x12df79,_0x5e0282){_0x12df79=_0x12df79-0x0;var _0x435759=_0xdefd[_0x12df79];return _0x435759;};'use strict';var schema=require(_0xddef('0x0'));var _=require(_0xddef('0x1'));var logger=require(_0xddef('0x2'))('routing');var gotop=schema({'priority':{'type':_0xddef('0x3'),'required':!![],'message':_0xddef('0x4')}});exports[_0xddef('0x5')]=function(_0x1f1795,_0x7fc393){return function(_0x295536){try{var _0x57a4bd={'priority':_0x7fc393[0x0]};var _0x57c3f2=gotop[_0xddef('0x0')](_0x57a4bd,{'typecast':!![]});if(_0x57c3f2['length']){logger[_0xddef('0x6')](_0xddef('0x7'),_0x1f1795,_[_0xddef('0x8')](_0x57c3f2,_0xddef('0x9'))[_0xddef('0xa')](',\x20'));_0x295536[_0xddef('0xb')]();}else{logger[_0xddef('0xc')](_0xddef('0xd'),_0x1f1795,_0x57a4bd['priority']);if(_0x57a4bd[_0xddef('0xe')]){var _0x4eb837=_[_0xddef('0xf')](_0x295536[_0xddef('0x10')](),{'p':_0x57a4bd[_0xddef('0xe')]});if(_0x4eb837>=0x0){logger[_0xddef('0xc')](_0xddef('0x11'),_0x1f1795,_0x57a4bd[_0xddef('0xe')]||_0xddef('0x12'),_0x4eb837);_0x295536[_0xddef('0x12')](_0x4eb837);}else{logger[_0xddef('0xc')](_0xddef('0x13'),_0x1f1795,_0x57a4bd[_0xddef('0xe')]||_0xddef('0x12'));_0x295536[_0xddef('0xb')]();}}else{_0x295536[_0xddef('0x12')]();}}}catch(_0x17c825){logger[_0xddef('0x6')](_0xddef('0x7'),_0x1f1795,JSON[_0xddef('0x14')](_0x17c825));_0x295536['stop']();}};};