"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function query(body) {
    return {
        _id: body._id,
        datasourceId: body.datasourceId,
        parameters: body.parameters,
        fields: body.fields,
        queryVerb: body.queryVerb,
        name: body.name,
        schema: body.schema,
        transformer: body.transformer,
        readable: body.readable,
    };
}
function mapQueries(ctx) {
    const queries = ctx.body.map((body) => query(body));
    return {
        data: queries,
    };
}
function mapQueryExecution(ctx) {
    // very little we can map here, structure mostly unknown
    return {
        data: ctx.body.data,
        pagination: ctx.body.pagination,
        extra: {
            raw: ctx.body.raw,
            headers: ctx.body.headers,
        },
    };
}
exports.default = {
    mapQueries,
    mapQueryExecution,
};
