Built motion from commit (unavailable).|2.5.1
[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 _0x732f=['limit','sort','map','priority','cast','col','unsigned','DESC','omit','length','isObject','unset','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','push','toString','join','lodash','moment','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','$lte','utc','subtract','isArray'];(function(_0x5c18cb,_0x136453){var _0x3b8e66=function(_0x18a161){while(--_0x18a161){_0x5c18cb['push'](_0x5c18cb['shift']());}};_0x3b8e66(++_0x136453);}(_0x732f,0xb0));var _0xf732=function(_0x4624f9,_0x49b411){_0x4624f9=_0x4624f9-0x0;var _0x10c5ab=_0x732f[_0x4624f9];return _0x10c5ab;};'use strict';var _=require(_0xf732('0x0'));var sequelize=require('sequelize');var moment=require(_0xf732('0x1'));var LIMIT_VALUE=0xfa;exports[_0xf732('0x2')]=function(_0x3e6768){var _0x3ad837=null;if(_0x3e6768){_0x3ad837=_0x3e6768[_0xf732('0x3')](',');}return _0x3ad837;};exports[_0xf732('0x4')]=function(_0xa92ee2,_0x52b622){var _0x50cd1b={};if(!_[_0xf732('0x5')](_0xa92ee2)){_[_0xf732('0x6')](_0xa92ee2,function(_0x4963f6,_0x415cc2){try{if(_0x52b622){var _0x212bd7=_[_0xf732('0x7')](_0x52b622,{'name':_0x415cc2})||{};if(_0x212bd7[_0xf732('0x8')]===_0xf732('0x9')&&_[_0xf732('0xa')](_0x4963f6)){var _0xd56b4a=JSON[_0xf732('0xb')](_0x4963f6);var _0x20f64e={'$gte':moment(moment(_0xd56b4a[_0xf732('0xc')])[_0xf732('0xd')](_0xf732('0xe')))['utc']()['format'](),'$lte':moment(moment(_0xd56b4a[_0xf732('0xf')])[_0xf732('0xd')](_0xf732('0xe')))[_0xf732('0x10')]()[_0xf732('0x11')](0x1,'s')[_0xf732('0xd')]()};_0x50cd1b[_0x415cc2]=_0x20f64e;}else{_0x50cd1b[_0x415cc2]=_[_0xf732('0x12')](_0x4963f6)?_0x4963f6:JSON[_0xf732('0xb')](_0x4963f6);}}else{_0x50cd1b[_0x415cc2]=_[_0xf732('0x12')](_0x4963f6)?_0x4963f6:JSON[_0xf732('0xb')](_0x4963f6);}}catch(_0x3c8319){_0x50cd1b[_0x415cc2]=_0x4963f6[_0xf732('0x3')](',');}});}return _0x50cd1b;};exports[_0xf732('0x13')]=function(_0x5df7a7){_0x5df7a7=parseInt(_0x5df7a7,0xa);if(!_0x5df7a7||_0x5df7a7<0x0){_0x5df7a7=LIMIT_VALUE;}return _0x5df7a7;};exports['offset']=function(_0x2b3942){_0x2b3942=parseInt(_0x2b3942,0xa);if(!_0x2b3942||_0x2b3942<0x0){_0x2b3942=0x0;}return _0x2b3942;};exports[_0xf732('0x14')]=function(_0x394e52){var _0x1a4a12,_0x82057e=null;if(_0x394e52){_0x1a4a12=_0x394e52[_0xf732('0x3')](',');_0x82057e=_[_0xf732('0x15')](_0x1a4a12,function(_0x13d939){if(_0x13d939['indexOf']('-')===0x0){return[_0x13d939===_0xf732('0x16')?sequelize[_0xf732('0x17')](sequelize[_0xf732('0x18')]('priority'),_0xf732('0x19')):_0x13d939['substr'](0x1),_0xf732('0x1a')];}else{return[_0x13d939===_0xf732('0x16')?sequelize['cast'](sequelize[_0xf732('0x18')](_0xf732('0x16')),_0xf732('0x19')):_0x13d939,'ASC'];}});}return _0x82057e;};exports[_0xf732('0x1b')]=function(_0xabb099,_0x44a510){if(_[_0xf732('0x5')](_0xabb099)){return _0xabb099;}if(_[_0xf732('0x12')](_0xabb099)){for(var _0xaa010b=0x0;_0xaa010b<_0xabb099[_0xf732('0x1c')];_0xaa010b+=0x1){_0xabb099[_0xaa010b]=this[_0xf732('0x1b')](_0xabb099[_0xaa010b],_0x44a510);}return _0xabb099;}if(!_[_0xf732('0x1d')](_0xabb099)){return _0xabb099;}if(_['isString'](_0x44a510)){_0x44a510=[_0x44a510];}if(!_[_0xf732('0x12')](_0x44a510)){return _0xabb099;}for(var _0x3bf6a5=0x0;_0x3bf6a5<_0x44a510['length'];_0x3bf6a5+=0x1){_[_0xf732('0x1e')](_0xabb099,_0x44a510[_0x3bf6a5]);}for(var _0x4f294c in _0xabb099){if(_0xabb099['hasOwnProperty'](_0x4f294c)){_0xabb099[_0x4f294c]=this[_0xf732('0x1b')](_0xabb099[_0x4f294c],_0x44a510);}}return _0xabb099;};exports[_0xf732('0x1f')]=function(_0x3c9b9c){return _0x3c9b9c[_0xf732('0x20')](RegExp(_0xf732('0x21')))?!![]:![];};exports[_0xf732('0x22')]=function(_0x1f3a56){return _0x1f3a56[_0xf732('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xf732('0x23')]=function(_0x109534){var _0x3b5cb8=[];_0x109534['split']('\x20')['forEach'](function(_0x3cc27e){_0x3b5cb8[_0xf732('0x24')]('+'+_0x3cc27e[_0xf732('0x25')]()+'*');});return _0x3b5cb8[_0xf732('0x26')]('\x20');};