@talend/react-faceted-search-query-client
Version:
Faceted search Query client
1,047 lines (700 loc) • 76.8 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["TalendReactFacetedSearchQueryClient"] = factory();
else
root["TalendReactFacetedSearchQueryClient"] = factory();
})(this, () => {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/compositor.js":
/*!********************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/compositor.js ***!
\********************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _iserializable = __webpack_require__(/*! ./operators/iserializable */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/iserializable.js");
var _iserializable2 = _interopRequireDefault(_iserializable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Compositor = function (_ISerializable) {
_inherits(Compositor, _ISerializable);
function Compositor(type) {
_classCallCheck(this, Compositor);
var _this = _possibleConstructorReturn(this, (Compositor.__proto__ || Object.getPrototypeOf(Compositor)).call(this));
if (type !== Compositor.and && type !== Compositor.or) {
throw new Error('Unknown compositor');
}
_this.type = type;
return _this;
}
_createClass(Compositor, [{
key: 'serialize',
value: function serialize() {
return this.type;
}
}], [{
key: 'get',
value: function get(type) {
return new Compositor(type);
}
}]);
return Compositor;
}(_iserializable2.default);
Compositor.and = 'and';
Compositor.or = 'or';
exports["default"] = Compositor;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/modifier.js":
/*!******************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/modifier.js ***!
\******************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _iserializable = __webpack_require__(/*! ./operators/iserializable */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/iserializable.js");
var _iserializable2 = _interopRequireDefault(_iserializable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Modifier = function (_ISerializable) {
_inherits(Modifier, _ISerializable);
function Modifier(type, query) {
_classCallCheck(this, Modifier);
var _this = _possibleConstructorReturn(this, (Modifier.__proto__ || Object.getPrototypeOf(Modifier)).call(this));
if (type !== Modifier.not) {
throw new Error('Unknown modifier');
}
_this.type = type;
_this.query = query;
return _this;
}
_createClass(Modifier, [{
key: 'serialize',
value: function serialize() {
return this.type + '(' + this.query.serialize() + ')';
}
}]);
return Modifier;
}(_iserializable2.default);
Modifier.not = 'not';
exports["default"] = Modifier;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/between.js":
/*!***************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/between.js ***!
\***************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Between operator.
* Will be serialized as follows : (field1 between [42, 76])
*/
var Between = function (_Operator) {
_inherits(Between, _Operator);
function Between() {
_classCallCheck(this, Between);
return _possibleConstructorReturn(this, (Between.__proto__ || Object.getPrototypeOf(Between)).apply(this, arguments));
}
_createClass(Between, [{
key: 'serialize',
value: function serialize() {
var min = this.options.excludeMin ? ']' : '[';
var max = this.options.excludeMax ? '[' : ']';
return '(' + this.field + ' ' + this.constructor.value + ' ' + min + this.operand.join(', ') + max + ')';
}
}]);
return Between;
}(_operator2.default);
Between.value = 'between';
Between.hasOperand = true;
exports["default"] = Between;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/complies.js":
/*!****************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/complies.js ***!
\****************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Complies operator.
* Will be serialized as follows : (field1 complies 'Aaa')
*/
var Complies = function (_Operator) {
_inherits(Complies, _Operator);
function Complies() {
_classCallCheck(this, Complies);
return _possibleConstructorReturn(this, (Complies.__proto__ || Object.getPrototypeOf(Complies)).apply(this, arguments));
}
return Complies;
}(_operator2.default);
Complies.value = 'complies';
Complies.hasOperand = true;
Complies.allowEmpty = true;
exports["default"] = Complies;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/contains.js":
/*!****************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/contains.js ***!
\****************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Contains operator.
* Will be serialized as follows : (field1 contains 'alen')
*/
var Contains = function (_Operator) {
_inherits(Contains, _Operator);
function Contains() {
_classCallCheck(this, Contains);
return _possibleConstructorReturn(this, (Contains.__proto__ || Object.getPrototypeOf(Contains)).apply(this, arguments));
}
return Contains;
}(_operator2.default);
Contains.value = 'contains';
Contains.hasOperand = true;
Contains.allowEmpty = true;
exports["default"] = Contains;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/containsIgnoreCase.js":
/*!**************************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/containsIgnoreCase.js ***!
\**************************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the ContainsIgnoreCase operator.
* Will be serialized as follows : (field1 containsIgnoreCase 'alen')
*/
var ContainsIgnoreCase = function (_Operator) {
_inherits(ContainsIgnoreCase, _Operator);
function ContainsIgnoreCase() {
_classCallCheck(this, ContainsIgnoreCase);
return _possibleConstructorReturn(this, (ContainsIgnoreCase.__proto__ || Object.getPrototypeOf(ContainsIgnoreCase)).apply(this, arguments));
}
return ContainsIgnoreCase;
}(_operator2.default);
ContainsIgnoreCase.value = 'containsIgnoreCase';
ContainsIgnoreCase.hasOperand = true;
ContainsIgnoreCase.allowEmpty = true;
exports["default"] = ContainsIgnoreCase;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/empty.js":
/*!*************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/empty.js ***!
\*************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Empty operator.
* Will be serialized as follows : (field1 is empty)
*/
var Empty = function (_Operator) {
_inherits(Empty, _Operator);
function Empty() {
_classCallCheck(this, Empty);
return _possibleConstructorReturn(this, (Empty.__proto__ || Object.getPrototypeOf(Empty)).apply(this, arguments));
}
return Empty;
}(_operator2.default);
Empty.value = 'is empty';
Empty.hasOperand = false;
exports["default"] = Empty;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/equal.js":
/*!*************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/equal.js ***!
\*************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Equal operator.
* Will be serialized as follows : (field1 = 42)
* Text values will be automatically wrapped : (field1 = 'Talend')
*/
var Equal = function (_Operator) {
_inherits(Equal, _Operator);
function Equal() {
_classCallCheck(this, Equal);
return _possibleConstructorReturn(this, (Equal.__proto__ || Object.getPrototypeOf(Equal)).apply(this, arguments));
}
return Equal;
}(_operator2.default);
Equal.value = '=';
Equal.hasOperand = true;
Equal.allowEmpty = true;
exports["default"] = Equal;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than-or-equal.js":
/*!*****************************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than-or-equal.js ***!
\*****************************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Greater Than Or Equal operator.
* Will be serialized as follows : (field1 >= 42)
*/
var GreaterThanOrEqual = function (_Operator) {
_inherits(GreaterThanOrEqual, _Operator);
function GreaterThanOrEqual() {
_classCallCheck(this, GreaterThanOrEqual);
return _possibleConstructorReturn(this, (GreaterThanOrEqual.__proto__ || Object.getPrototypeOf(GreaterThanOrEqual)).apply(this, arguments));
}
return GreaterThanOrEqual;
}(_operator2.default);
GreaterThanOrEqual.value = '>=';
GreaterThanOrEqual.hasOperand = true;
exports["default"] = GreaterThanOrEqual;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than.js":
/*!********************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than.js ***!
\********************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Greater Than operator.
* Will be serialized as follows : (field1 > 42)
*/
var GreaterThan = function (_Operator) {
_inherits(GreaterThan, _Operator);
function GreaterThan() {
_classCallCheck(this, GreaterThan);
return _possibleConstructorReturn(this, (GreaterThan.__proto__ || Object.getPrototypeOf(GreaterThan)).apply(this, arguments));
}
return GreaterThan;
}(_operator2.default);
GreaterThan.value = '>';
GreaterThan.hasOperand = true;
exports["default"] = GreaterThan;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/in.js":
/*!**********************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/in.js ***!
\**********************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the In operator.
* Will be serialized as follows : (field1 in [42, 76])
*/
var In = function (_Operator) {
_inherits(In, _Operator);
function In() {
_classCallCheck(this, In);
return _possibleConstructorReturn(this, (In.__proto__ || Object.getPrototypeOf(In)).apply(this, arguments));
}
_createClass(In, [{
key: 'serialize',
value: function serialize() {
if (!(0, _operator.isDefined)(this.operand)) {
throw new Error(this.constructor.value + ' does not allow empty.');
}
var operandAsArray = Array.isArray(this.operand) ? this.operand : [this.operand];
var operandAsArrayFormatted = operandAsArray.map(function (value) {
return (0, _operator.wrap)(value);
});
return '(' + this.field + ' ' + this.constructor.value + ' [' + operandAsArrayFormatted.join(', ') + '])';
}
}]);
return In;
}(_operator2.default);
In.value = 'in';
In.hasOperand = true;
exports["default"] = In;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/index.js":
/*!*************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/index.js ***!
\*************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.In = exports.Quality = exports.Between = exports.Invalid = exports.Valid = exports.LessThanOrEqual = exports.LessThan = exports.GreaterThanOrEqual = exports.GreaterThan = exports.WordComplies = exports.Complies = exports.ContainsIgnoreCase = exports.Contains = exports.Unequal = exports.Equal = exports.Empty = undefined;
var _empty = __webpack_require__(/*! ./empty */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/empty.js");
var _empty2 = _interopRequireDefault(_empty);
var _equal = __webpack_require__(/*! ./equal */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/equal.js");
var _equal2 = _interopRequireDefault(_equal);
var _unequal = __webpack_require__(/*! ./unequal */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/unequal.js");
var _unequal2 = _interopRequireDefault(_unequal);
var _contains = __webpack_require__(/*! ./contains */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/contains.js");
var _contains2 = _interopRequireDefault(_contains);
var _containsIgnoreCase = __webpack_require__(/*! ./containsIgnoreCase */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/containsIgnoreCase.js");
var _containsIgnoreCase2 = _interopRequireDefault(_containsIgnoreCase);
var _complies = __webpack_require__(/*! ./complies */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/complies.js");
var _complies2 = _interopRequireDefault(_complies);
var _wordComplies = __webpack_require__(/*! ./wordComplies */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/wordComplies.js");
var _wordComplies2 = _interopRequireDefault(_wordComplies);
var _greaterThan = __webpack_require__(/*! ./greater-than */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than.js");
var _greaterThan2 = _interopRequireDefault(_greaterThan);
var _greaterThanOrEqual = __webpack_require__(/*! ./greater-than-or-equal */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/greater-than-or-equal.js");
var _greaterThanOrEqual2 = _interopRequireDefault(_greaterThanOrEqual);
var _lessThan = __webpack_require__(/*! ./less-than */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than.js");
var _lessThan2 = _interopRequireDefault(_lessThan);
var _lessThanOrEqual = __webpack_require__(/*! ./less-than-or-equal */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than-or-equal.js");
var _lessThanOrEqual2 = _interopRequireDefault(_lessThanOrEqual);
var _valid = __webpack_require__(/*! ./valid */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/valid.js");
var _valid2 = _interopRequireDefault(_valid);
var _invalid = __webpack_require__(/*! ./invalid */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/invalid.js");
var _invalid2 = _interopRequireDefault(_invalid);
var _between = __webpack_require__(/*! ./between */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/between.js");
var _between2 = _interopRequireDefault(_between);
var _quality = __webpack_require__(/*! ./quality */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/quality.js");
var _quality2 = _interopRequireDefault(_quality);
var _in = __webpack_require__(/*! ./in */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/in.js");
var _in2 = _interopRequireDefault(_in);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Empty = _empty2.default;
exports.Equal = _equal2.default;
exports.Unequal = _unequal2.default;
exports.Contains = _contains2.default;
exports.ContainsIgnoreCase = _containsIgnoreCase2.default;
exports.Complies = _complies2.default;
exports.WordComplies = _wordComplies2.default;
exports.GreaterThan = _greaterThan2.default;
exports.GreaterThanOrEqual = _greaterThanOrEqual2.default;
exports.LessThan = _lessThan2.default;
exports.LessThanOrEqual = _lessThanOrEqual2.default;
exports.Valid = _valid2.default;
exports.Invalid = _invalid2.default;
exports.Between = _between2.default;
exports.Quality = _quality2.default;
exports.In = _in2.default;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/invalid.js":
/*!***************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/invalid.js ***!
\***************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Invalid operator.
* Will be serialized as follows : (field1 is invalid)
*/
var Invalid = function (_Operator) {
_inherits(Invalid, _Operator);
function Invalid() {
_classCallCheck(this, Invalid);
return _possibleConstructorReturn(this, (Invalid.__proto__ || Object.getPrototypeOf(Invalid)).apply(this, arguments));
}
return Invalid;
}(_operator2.default);
Invalid.value = 'is invalid';
Invalid.hasOperand = false;
exports["default"] = Invalid;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/iserializable.js":
/*!*********************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/iserializable.js ***!
\*********************************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Interface to be implemented by the operators and queries
*/
var ISerializable = function () {
function ISerializable() {
_classCallCheck(this, ISerializable);
}
_createClass(ISerializable, [{
key: 'serialize',
/* eslint-disable class-methods-use-this */
value: function serialize() {
throw new Error('serialize() is not implemented.');
}
/* eslint-enable class-methods-use-this */
}]);
return ISerializable;
}();
exports["default"] = ISerializable;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than-or-equal.js":
/*!**************************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than-or-equal.js ***!
\**************************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Less Than Or Equal operator.
* Will be serialized as follows : (field1 <= 42)
*/
var LessThanOrEqual = function (_Operator) {
_inherits(LessThanOrEqual, _Operator);
function LessThanOrEqual() {
_classCallCheck(this, LessThanOrEqual);
return _possibleConstructorReturn(this, (LessThanOrEqual.__proto__ || Object.getPrototypeOf(LessThanOrEqual)).apply(this, arguments));
}
return LessThanOrEqual;
}(_operator2.default);
LessThanOrEqual.value = '<=';
LessThanOrEqual.hasOperand = true;
exports["default"] = LessThanOrEqual;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than.js":
/*!*****************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/less-than.js ***!
\*****************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Less Than operator.
* Will be serialized as follows : (field1 < 42)
*/
var LessThan = function (_Operator) {
_inherits(LessThan, _Operator);
function LessThan() {
_classCallCheck(this, LessThan);
return _possibleConstructorReturn(this, (LessThan.__proto__ || Object.getPrototypeOf(LessThan)).apply(this, arguments));
}
return LessThan;
}(_operator2.default);
LessThan.value = '<';
LessThan.hasOperand = true;
exports["default"] = LessThan;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js":
/*!****************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js ***!
\****************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.wrap = wrap;
exports.isDefined = isDefined;
var _empty = __webpack_require__(/*! ./empty */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/empty.js");
var _empty2 = _interopRequireDefault(_empty);
var _iserializable = __webpack_require__(/*! ./iserializable */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/iserializable.js");
var _iserializable2 = _interopRequireDefault(_iserializable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var WILDCARD = '*';
function isString(value) {
return typeof value === 'string';
}
function wrap(value) {
return isString(value) ? '\'' + value.replace(/'/g, "\\'") + '\'' : value;
}
function isDefined(value) {
return value != null && value !== '';
}
/**
* Class representing an operator.
* @extends ISerializable
*/
var Operator = function (_ISerializable) {
_inherits(Operator, _ISerializable);
/**
* Create an Operator.
* @param {string} field - The field on which to apply the operator.
* @param {any} operands - The operand(s) of the operation.
* @param {object} options - The options of the operator.
* This could be an array or a single value.
*/
function Operator(field, operands, options) {
_classCallCheck(this, Operator);
var _this = _possibleConstructorReturn(this, (Operator.__proto__ || Object.getPrototypeOf(Operator)).call(this));
_this.field = field || WILDCARD;
_this.options = options || {};
if (Array.isArray(operands)) {
_this.operand = operands.length > 1 ? operands : operands[0];
} else {
_this.operand = operands;
}
return _this;
}
/**
* Converts the operator to its TQL equivalent.
* @return {string} The TQL expression.
*/
_createClass(Operator, [{
key: 'serialize',
value: function serialize() {
if (this.constructor.hasOperand !== false && isDefined(this.operand)) {
return '(' + this.field + ' ' + this.constructor.value + ' ' + wrap(this.operand) + ')';
} else if (this.constructor.hasOperand === false) {
return '(' + this.field + ' ' + this.constructor.value + ')';
} else if (this.constructor.allowEmpty === true) {
return '(' + this.field + ' ' + _empty2.default.value + ')';
}
throw new Error(this.constructor.value + ' does not allow empty.');
}
}]);
return Operator;
}(_iserializable2.default);
exports["default"] = Operator;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/quality.js":
/*!***************************************************************************************!*\
!*** ../../node_modules/@talend/daikon-tql-client/lib/converter/operators/quality.js ***!
\***************************************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _operator = __webpack_require__(/*! ./operator */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/operator.js");
var _operator2 = _interopRequireDefault(_operator);
var _ = __webpack_require__(/*! ./ */ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/index.js");
var _compositor = __webpack_require__(/*! ../compositor */ "../../node_modules/@talend/daikon-tql-client/lib/converter/compositor.js");
var _compositor2 = _interopRequireDefault(_compositor);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Class representing the Quality operator.
* Will be serialized as follows : ((field1 is empty) or (field1 is invalid))
*/
var Quality = function (_Operator) {
_inherits(Quality, _Operator);
function Quality() {
_classCallCheck(this, Quality);
return _possibleConstructorReturn(this, (Quality.__proto__ || Object.getPrototypeOf(Quality)).apply(this, arguments));
}
_createClass(Quality, [{
key: 'serialize',
value: function serialize() {
var operations = [];
if (this.options.empty) {
operations.push(new _.Empty(this.field));
}
if (this.options.invalid) {
operations.push(new _.Invalid(this.field));
}
if (this.options.valid) {
operations.push(new _.Valid(this.field));
}
if (!operations.length) {
throw new Error('Invalid options given to quality operator.');
}
var query = operations.map(function (o) {
return o.serialize();
}).join(' ' + _compositor2.default.or + ' ');
return operations.length > 1 ? '(' + query + ')' : query;
}
}]);
return Quality;
}(_operator2.default);
exports["default"] = Quality;
/***/ }),
/***/ "../../node_modules/@talend/daikon-tql-client/lib/converter/operators/unequal.js":