34688a4ae25e4c65e98857f2b2a26f8b4f5b2ec7
[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 _0x14d3=['message','join','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','stop','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','map'];(function(_0x5631a2,_0x266a08){var _0x1c4459=function(_0x310a8b){while(--_0x310a8b){_0x5631a2['push'](_0x5631a2['shift']());}};_0x1c4459(++_0x266a08);}(_0x14d3,0x19b));var _0x314d=function(_0x12f88f,_0x552290){_0x12f88f=_0x12f88f-0x0;var _0x47d8b9=_0x14d3[_0x12f88f];return _0x47d8b9;};'use strict';var schema=require('validate');var _=require(_0x314d('0x0'));var logger=require(_0x314d('0x1'))(_0x314d('0x2'));var gotop=schema({'priority':{'type':_0x314d('0x3'),'required':!![],'message':_0x314d('0x4')}});exports[_0x314d('0x5')]=function(_0x3f7dd7,_0x3d5d3d){return function(_0x118ec3){try{var _0x1561db={'priority':_0x3d5d3d[0x0]};var _0x2c0ded=gotop[_0x314d('0x6')](_0x1561db,{'typecast':!![]});if(_0x2c0ded[_0x314d('0x7')]){logger['error']('[%s][GOTOP]\x20%s',_0x3f7dd7,_[_0x314d('0x8')](_0x2c0ded,_0x314d('0x9'))[_0x314d('0xa')](',\x20'));_0x118ec3['stop']();}else{logger[_0x314d('0xb')](_0x314d('0xc'),_0x3f7dd7,_0x1561db[_0x314d('0xd')]);if(_0x1561db[_0x314d('0xd')]){var _0x388ab7=_[_0x314d('0xe')](_0x118ec3[_0x314d('0xf')](),{'p':_0x1561db[_0x314d('0xd')]});if(_0x388ab7>=0x0){logger[_0x314d('0xb')](_0x314d('0x10'),_0x3f7dd7,_0x1561db[_0x314d('0xd')]||_0x314d('0x11'),_0x388ab7);_0x118ec3[_0x314d('0x11')](_0x388ab7);}else{logger[_0x314d('0xb')](_0x314d('0x12'),_0x3f7dd7,_0x1561db[_0x314d('0xd')]||_0x314d('0x11'));_0x118ec3[_0x314d('0x13')]();}}else{_0x118ec3['next']();}}}catch(_0x14af73){logger['error']('[%s][GOTOP]\x20%s',_0x3f7dd7,JSON[_0x314d('0x14')](_0x14af73));_0x118ec3[_0x314d('0x13')]();}};};