Built motion from commit (unavailable).|2.0.74
[motion2.git] / server / components / parsers / qs.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 _0xfddb=['isEmpty','isArray','length','isObject','isString','unset','sequelize','fields','split','forOwn','limit','offset','map','indexOf','priority','col','unsigned','substr','ASC','omit'];(function(_0x3370b5,_0x1a2130){var _0x4270be=function(_0x5f4b4e){while(--_0x5f4b4e){_0x3370b5['push'](_0x3370b5['shift']());}};_0x4270be(++_0x1a2130);}(_0xfddb,0x16e));var _0xbfdd=function(_0x14d1b2,_0x4f6472){_0x14d1b2=_0x14d1b2-0x0;var _0x34c82b=_0xfddb[_0x14d1b2];return _0x34c82b;};'use strict';var _=require('lodash');var sequelize=require(_0xbfdd('0x0'));var LIMIT_VALUE=0xfa;exports[_0xbfdd('0x1')]=function(_0x4bb47e){var _0xf31d51=null;if(_0x4bb47e){_0xf31d51=_0x4bb47e[_0xbfdd('0x2')](',');}return _0xf31d51;};exports['filters']=function(_0x1c1e0c){var _0x295c92={};if(!_['isEmpty'](_0x1c1e0c)){_0x295c92={};_[_0xbfdd('0x3')](_0x1c1e0c,function(_0x5becd6,_0x540f9e){try{_0x295c92[_0x540f9e]=JSON['parse'](_0x5becd6);}catch(_0x1fc055){_0x295c92[_0x540f9e]=_0x5becd6['split'](',');}});}return _0x295c92;};exports[_0xbfdd('0x4')]=function(_0x3ca597){_0x3ca597=parseInt(_0x3ca597,0xa);if(!_0x3ca597||_0x3ca597<0x0){_0x3ca597=LIMIT_VALUE;}return _0x3ca597;};exports[_0xbfdd('0x5')]=function(_0x4b78ad){_0x4b78ad=parseInt(_0x4b78ad,0xa);if(!_0x4b78ad||_0x4b78ad<0x0){_0x4b78ad=0x0;}return _0x4b78ad;};exports['sort']=function(_0x54cc21){var _0x6585f7,_0x20c2fd=null;if(_0x54cc21){_0x6585f7=_0x54cc21[_0xbfdd('0x2')](',');_0x20c2fd=_[_0xbfdd('0x6')](_0x6585f7,function(_0x28c358){if(_0x28c358[_0xbfdd('0x7')]('-')===0x0){return[_0x28c358===_0xbfdd('0x8')?sequelize['cast'](sequelize[_0xbfdd('0x9')](_0xbfdd('0x8')),_0xbfdd('0xa')):_0x28c358[_0xbfdd('0xb')](0x1),'DESC'];}else{return[_0x28c358===_0xbfdd('0x8')?sequelize['cast'](sequelize['col'](_0xbfdd('0x8')),_0xbfdd('0xa')):_0x28c358,_0xbfdd('0xc')];}});}return _0x20c2fd;};exports[_0xbfdd('0xd')]=function(_0x20e9d8,_0x69d1){if(_[_0xbfdd('0xe')](_0x20e9d8)){return _0x20e9d8;}if(_[_0xbfdd('0xf')](_0x20e9d8)){for(var _0x388edd=0x0;_0x388edd<_0x20e9d8[_0xbfdd('0x10')];_0x388edd+=0x1){_0x20e9d8[_0x388edd]=this[_0xbfdd('0xd')](_0x20e9d8[_0x388edd],_0x69d1);}return _0x20e9d8;}if(!_[_0xbfdd('0x11')](_0x20e9d8)){return _0x20e9d8;}if(_[_0xbfdd('0x12')](_0x69d1)){_0x69d1=[_0x69d1];}if(!_[_0xbfdd('0xf')](_0x69d1)){return _0x20e9d8;}for(var _0x167bd2=0x0;_0x167bd2<_0x69d1['length'];_0x167bd2+=0x1){_[_0xbfdd('0x13')](_0x20e9d8,_0x69d1[_0x167bd2]);}for(var _0x394365 in _0x20e9d8){if(_0x20e9d8['hasOwnProperty'](_0x394365)){_0x20e9d8[_0x394365]=this[_0xbfdd('0xd')](_0x20e9d8[_0x394365],_0x69d1);}}return _0x20e9d8;};