"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOgcItemQueryParams = getOgcItemQueryParams;
const get_prop_1 = require("../../../objects/get-prop");
const getBboxQueryParam_1 = require("./getBboxQueryParam");
const getFieldsQueryParam_1 = require("./getFieldsQueryParam");
const getFilterQueryParam_1 = require("./getFilterQueryParam");
const getFlattenQueryParam_1 = require("./getFlattenQueryParam");
const getQQueryParam_1 = require("./getQQueryParam");
const getSortByQueryParam_1 = require("./getSortByQueryParam");
/**
 * @private
 * Derives a hash of query params that should be included with a request
 * to the /items endpoint of an OGC API collection
 *
 * @param query an IQuery to derive query params from
 * @param options an ISearchOgcItemsOptions object to derive query params from
 * @returns a hash of query params to be included in the request
 */
function getOgcItemQueryParams(query, options) {
    const filter = (0, getFilterQueryParam_1.getFilterQueryParam)(query);
    const token = (0, get_prop_1.getProp)(options, "requestOptions.authentication.token");
    const limit = options.num;
    // API requires the param name be all lowercase
    const startindex = options.start;
    const q = (0, getQQueryParam_1.getQQueryParam)(query);
    const sortBy = (0, getSortByQueryParam_1.getSortByQueryParam)(options);
    const bbox = (0, getBboxQueryParam_1.getBboxQueryParam)(query);
    const flatten = (0, getFlattenQueryParam_1.getFlattenQueryParam)(query);
    const fields = (0, getFieldsQueryParam_1.getFieldsQueryParam)(query);
    return {
        filter,
        token,
        limit,
        startindex,
        q,
        sortBy,
        bbox,
        flatten,
        fields,
    };
}
//# sourceMappingURL=getOgcItemQueryParams.js.map