const getRequiredParams = (table) => (table &&
    (("query" in table &&
        ("params" in table ? [] : table.query.paramsRequired)) ||
        ("insight" in table && table.params))) ||
    [];
const generateQueryParams = (params) => {
    const newParams = {};
    Object.keys(params).forEach((param) => {
        newParams[param] = Object.assign(Object.assign({}, params[param]), { name: param });
    });
    return newParams;
};
const getRegisteredParams = (table) => (table &&
    (("query" in table &&
        ("params" in table ? table.params : table.query.registeredParams)) ||
        ("insight" in table && table.registeredParams))) ||
    {};
export const tableParams = (table) => getRequiredParams(table)
    .map((param) => ({ name: param, type: "" }))
    .concat(Object.values(table && "query" in table && "params" in table
    ? generateQueryParams(getRegisteredParams(table))
    : getRegisteredParams(table)));
//# sourceMappingURL=tableParams.js.map