Built motion from commit 092f8824.|2.5.49
[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 _0x8b78=['info','[%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','[%s][GOTOP]\x20%s','stringify','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','stop'];(function(_0xf89eda,_0x57e180){var _0x29f4dc=function(_0x2d5fa9){while(--_0x2d5fa9){_0xf89eda['push'](_0xf89eda['shift']());}};_0x29f4dc(++_0x57e180);}(_0x8b78,0xee));var _0x88b7=function(_0x517a56,_0x112b8c){_0x517a56=_0x517a56-0x0;var _0x1e8d4e=_0x8b78[_0x517a56];return _0x1e8d4e;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x88b7('0x0'))(_0x88b7('0x1'));var gotop=schema({'priority':{'type':_0x88b7('0x2'),'required':!![],'message':_0x88b7('0x3')}});exports[_0x88b7('0x4')]=function(_0x4c4ce8,_0x599e6c){return function(_0x1d4634){try{var _0x22f973={'priority':_0x599e6c[0x0]};var _0x32f3d6=gotop[_0x88b7('0x5')](_0x22f973,{'typecast':!![]});if(_0x32f3d6[_0x88b7('0x6')]){logger[_0x88b7('0x7')]('[%s][GOTOP]\x20%s',_0x4c4ce8,_['map'](_0x32f3d6,'message')['join'](',\x20'));_0x1d4634[_0x88b7('0x8')]();}else{logger[_0x88b7('0x9')](_0x88b7('0xa'),_0x4c4ce8,_0x22f973[_0x88b7('0xb')]);if(_0x22f973[_0x88b7('0xb')]){var _0x59a5de=_[_0x88b7('0xc')](_0x1d4634[_0x88b7('0xd')](),{'p':_0x22f973[_0x88b7('0xb')]});if(_0x59a5de>=0x0){logger[_0x88b7('0x9')](_0x88b7('0xe'),_0x4c4ce8,_0x22f973[_0x88b7('0xb')]||_0x88b7('0xf'),_0x59a5de);_0x1d4634[_0x88b7('0xf')](_0x59a5de);}else{logger[_0x88b7('0x9')](_0x88b7('0x10'),_0x4c4ce8,_0x22f973[_0x88b7('0xb')]||_0x88b7('0xf'));_0x1d4634[_0x88b7('0x8')]();}}else{_0x1d4634['next']();}}}catch(_0x3327a4){logger[_0x88b7('0x7')](_0x88b7('0x11'),_0x4c4ce8,JSON[_0x88b7('0x12')](_0x3327a4));_0x1d4634[_0x88b7('0x8')]();}};};