Built motion from commit 06eb8eb0.|2.6.31
[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 _0x74b1=['[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','map','message','stop','info'];(function(_0x54a646,_0x51e965){var _0xc776ee=function(_0x5947c7){while(--_0x5947c7){_0x54a646['push'](_0x54a646['shift']());}};_0xc776ee(++_0x51e965);}(_0x74b1,0x1af));var _0x174b=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x74b1[_0x154192];return _0x3c2792;};'use strict';var schema=require(_0x174b('0x0'));var _=require(_0x174b('0x1'));var logger=require(_0x174b('0x2'))('routing');var gotop=schema({'priority':{'type':_0x174b('0x3'),'required':!![],'message':_0x174b('0x4')}});exports[_0x174b('0x5')]=function(_0x29d1af,_0x312278){return function(_0x234b9a){try{var _0xc3349a={'priority':_0x312278[0x0]};var _0x25eac8=gotop['validate'](_0xc3349a,{'typecast':!![]});if(_0x25eac8['length']){logger[_0x174b('0x6')]('[%s][GOTOP]\x20%s',_0x29d1af,_[_0x174b('0x7')](_0x25eac8,_0x174b('0x8'))['join'](',\x20'));_0x234b9a[_0x174b('0x9')]();}else{logger[_0x174b('0xa')](_0x174b('0xb'),_0x29d1af,_0xc3349a['priority']);if(_0xc3349a[_0x174b('0xc')]){var _0x14744=_['findIndex'](_0x234b9a['rules'](),{'p':_0xc3349a[_0x174b('0xc')]});if(_0x14744>=0x0){logger[_0x174b('0xa')](_0x174b('0xd'),_0x29d1af,_0xc3349a[_0x174b('0xc')]||_0x174b('0xe'),_0x14744);_0x234b9a[_0x174b('0xe')](_0x14744);}else{logger[_0x174b('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x29d1af,_0xc3349a[_0x174b('0xc')]||_0x174b('0xe'));_0x234b9a[_0x174b('0x9')]();}}else{_0x234b9a[_0x174b('0xe')]();}}}catch(_0x4b0d31){logger[_0x174b('0x6')](_0x174b('0xf'),_0x29d1af,JSON[_0x174b('0x10')](_0x4b0d31));_0x234b9a[_0x174b('0x9')]();}};};