@opengis/bi
Version:
BI data visualization module
33 lines (29 loc) • 959 B
JavaScript
import data from './controllers/data.js';
const biSchema = {
type: 'object',
properties: {
querystring: {
widget: { type: 'string', pattern: '^([\\d\\w_]+)$' },
dashboard: { type: 'string', pattern: '^([\\d\\w_]+)$' },
sql: { type: 'string', pattern: '^([\\d])$' },
// metric: { type: 'string', pattern: '^([\\d\\w_]+)$' },
x: { type: 'string', pattern: '^([\\d\\w_]+)$' },
granularity: { type: 'string', pattern: '^(week|month|quarter|year)$' },
groupby: { type: 'string', pattern: '^([\\d\\w_]+)$' },
filterCustom: { type: 'string', pattern: '^([\\d\\w_,]+)$' },
},
params: {
id: { type: 'string', pattern: '^([\\d\\w]+)$' },
},
},
};
const policy = ['public'];
export default async function route(fastify, opts) {
fastify.route({
method: 'GET',
url: '/bi-data',
schema: biSchema,
config: { policy },
handler: data,
});
}