"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOgcAggregationQueryParams = getOgcAggregationQueryParams;
const get_prop_1 = require("../../../objects/get-prop");
const getFilterQueryParam_1 = require("./getFilterQueryParam");
const getQQueryParam_1 = require("./getQQueryParam");
const getBboxQueryParam_1 = require("./getBboxQueryParam");
function getOgcAggregationQueryParams(query, options) {
    // TODO: use options.aggLimit once the OGC API supports it
    const aggregations = `terms(fields=(${options.aggFields.join()}))`;
    const filter = (0, getFilterQueryParam_1.getFilterQueryParam)(query);
    const bbox = (0, getBboxQueryParam_1.getBboxQueryParam)(query);
    const q = (0, getQQueryParam_1.getQQueryParam)(query);
    const token = (0, get_prop_1.getProp)(options, "requestOptions.authentication.token");
    return {
        aggregations,
        bbox,
        filter,
        q,
        token,
    };
}
//# sourceMappingURL=getOgcAggregationQueryParams.js.map