dsl-builder
Version:
OpenSearch Query Builder - Extract from OpenSearch Dashboards
74 lines (73 loc) • 3.29 kB
JavaScript
;
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFilterDisabled = exports.cleanFilter = void 0;
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const lodash_1 = require("lodash");
__exportStar(require("./build_filters"), exports);
__exportStar(require("./custom_filter"), exports);
__exportStar(require("./exists_filter"), exports);
__exportStar(require("./geo_bounding_box_filter"), exports);
__exportStar(require("./geo_shape_filter"), exports);
__exportStar(require("./geo_polygon_filter"), exports);
__exportStar(require("./get_display_value"), exports);
__exportStar(require("./get_filter_field"), exports);
__exportStar(require("./get_filter_params"), exports);
__exportStar(require("./get_index_pattern_from_filter"), exports);
__exportStar(require("./match_all_filter"), exports);
__exportStar(require("./meta_filter"), exports);
__exportStar(require("./missing_filter"), exports);
__exportStar(require("./phrase_filter"), exports);
__exportStar(require("./phrases_filter"), exports);
__exportStar(require("./query_string_filter"), exports);
__exportStar(require("./range_filter"), exports);
__exportStar(require("./types"), exports);
/**
* Clean out any invalid attributes from the filters
* @param {object} filter The filter to clean
* @returns {object}
*/
const cleanFilter = (filter) => (0, lodash_1.omit)(filter, ['meta', '$state']);
exports.cleanFilter = cleanFilter;
const isFilterDisabled = (filter) => (0, lodash_1.get)(filter, 'meta.disabled', false);
exports.isFilterDisabled = isFilterDisabled;