Built motion from commit (unavailable).|2.4.18
[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 _0x0db3=['lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','join','priority','findIndex','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify'];(function(_0x43ada2,_0x3cc073){var _0x2b0da4=function(_0x16c59d){while(--_0x16c59d){_0x43ada2['push'](_0x43ada2['shift']());}};_0x2b0da4(++_0x3cc073);}(_0x0db3,0x6c));var _0x30db=function(_0x49bb89,_0x1bae7d){_0x49bb89=_0x49bb89-0x0;var _0x361c65=_0x0db3[_0x49bb89];return _0x361c65;};'use strict';var schema=require('validate');var _=require(_0x30db('0x0'));var logger=require(_0x30db('0x1'))(_0x30db('0x2'));var gotop=schema({'priority':{'type':_0x30db('0x3'),'required':!![],'message':_0x30db('0x4')}});exports[_0x30db('0x5')]=function(_0x42d164,_0x10cd9e){return function(_0x48de99){try{var _0x4c342f={'priority':_0x10cd9e[0x0]};var _0x20540a=gotop[_0x30db('0x6')](_0x4c342f,{'typecast':!![]});if(_0x20540a[_0x30db('0x7')]){logger[_0x30db('0x8')]('[%s][GOTOP]\x20%s',_0x42d164,_['map'](_0x20540a,_0x30db('0x9'))[_0x30db('0xa')](',\x20'));_0x48de99['stop']();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x42d164,_0x4c342f[_0x30db('0xb')]);if(_0x4c342f[_0x30db('0xb')]){var _0x1a9c9e=_[_0x30db('0xc')](_0x48de99['rules'](),{'p':_0x4c342f[_0x30db('0xb')]});if(_0x1a9c9e>=0x0){logger[_0x30db('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x42d164,_0x4c342f[_0x30db('0xb')]||_0x30db('0xe'),_0x1a9c9e);_0x48de99['next'](_0x1a9c9e);}else{logger[_0x30db('0xd')](_0x30db('0xf'),_0x42d164,_0x4c342f[_0x30db('0xb')]||'next');_0x48de99['stop']();}}else{_0x48de99[_0x30db('0xe')]();}}}catch(_0x5c1b14){logger[_0x30db('0x8')](_0x30db('0x10'),_0x42d164,JSON[_0x30db('0x11')](_0x5c1b14));_0x48de99['stop']();}};};