f00e7258f0fe3d3cb18551e1d1dabe8f429b254a
[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 _0x4bbe=['lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join','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','error','stringify','validate'];(function(_0xfbe1a6,_0x117da5){var _0x5469a4=function(_0x54208a){while(--_0x54208a){_0xfbe1a6['push'](_0xfbe1a6['shift']());}};_0x5469a4(++_0x117da5);}(_0x4bbe,0x133));var _0xe4bb=function(_0x11c0f1,_0x57fec3){_0x11c0f1=_0x11c0f1-0x0;var _0x2c4cf9=_0x4bbe[_0x11c0f1];return _0x2c4cf9;};'use strict';var schema=require(_0xe4bb('0x0'));var _=require(_0xe4bb('0x1'));var logger=require('../../../../config/logger')(_0xe4bb('0x2'));var gotop=schema({'priority':{'type':_0xe4bb('0x3'),'required':!![],'message':_0xe4bb('0x4')}});exports[_0xe4bb('0x5')]=function(_0x380c57,_0x448724){return function(_0x7e82fd){try{var _0x1d1829={'priority':_0x448724[0x0]};var _0x23961f=gotop['validate'](_0x1d1829,{'typecast':!![]});if(_0x23961f[_0xe4bb('0x6')]){logger['error'](_0xe4bb('0x7'),_0x380c57,_[_0xe4bb('0x8')](_0x23961f,_0xe4bb('0x9'))[_0xe4bb('0xa')](',\x20'));_0x7e82fd[_0xe4bb('0xb')]();}else{logger['info'](_0xe4bb('0xc'),_0x380c57,_0x1d1829[_0xe4bb('0xd')]);if(_0x1d1829[_0xe4bb('0xd')]){var _0xe7599d=_[_0xe4bb('0xe')](_0x7e82fd[_0xe4bb('0xf')](),{'p':_0x1d1829[_0xe4bb('0xd')]});if(_0xe7599d>=0x0){logger[_0xe4bb('0x10')](_0xe4bb('0x11'),_0x380c57,_0x1d1829[_0xe4bb('0xd')]||_0xe4bb('0x12'),_0xe7599d);_0x7e82fd[_0xe4bb('0x12')](_0xe7599d);}else{logger['info'](_0xe4bb('0x13'),_0x380c57,_0x1d1829[_0xe4bb('0xd')]||'next');_0x7e82fd['stop']();}}else{_0x7e82fd['next']();}}}catch(_0x2ad0f2){logger[_0xe4bb('0x14')](_0xe4bb('0x7'),_0x380c57,JSON[_0xe4bb('0x15')](_0x2ad0f2));_0x7e82fd['stop']();}};};