UNPKG

graphql-compose-elasticsearch

Version:
30 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAggsDateRangeITC = void 0; const utils_1 = require("../../../utils"); const Date_1 = require("../../Commons/Date"); const FieldNames_1 = require("../../Commons/FieldNames"); function getAggsDateRangeITC(opts) { const name = (0, utils_1.getTypeName)('AggsDateRange', opts); const description = (0, utils_1.desc)(` A range aggregation that is dedicated for date values. The \`from\` and \`to\` values can be expressed in Date Math expressions, and it is also possible to specify a date format by which the from and to response fields will be returned. Note that this aggregation includes the \`from\` value and excludes the \`to\` value for each range. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html) `); return opts.getOrCreateITC(name, () => ({ name, description, fields: { field: (0, FieldNames_1.getDateFields)(opts), format: (0, Date_1.getDateFormatFC)(opts), ranges: () => [(0, Date_1.getDateRangeITC)(opts)], time_zone: (0, Date_1.getDateTimeZoneFC)(opts), }, })); } exports.getAggsDateRangeITC = getAggsDateRangeITC; //# sourceMappingURL=DateRange.js.map