Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
kibanaSavedObjectMeta: kibanaSavedObjectMetaJSON,
} = attributes as SavedSearchObjectAttributesJSON;
const { timerange } = req.payload as { timerange: TimeRangeParams };
if (!kibanaSavedObjectMetaJSON) {
throw new Error('Could not parse saved object data!');
}
const kibanaSavedObjectMeta = {
...kibanaSavedObjectMetaJSON,
searchSource: JSON.parse(kibanaSavedObjectMetaJSON.searchSourceJSON),
};
const { visState: visStateJSON } = attributes as VisObjectAttributesJSON;
if (visStateJSON) {
throw notImplemented('Visualization types are not yet implemented');
}
// saved search type
return await createJobSearch(timerange, attributes, references, kibanaSavedObjectMeta);
})
.catch((err: Error) => {
async function formatUpdate (ctx) {
console.log(ctx.params);
throw Boom.notImplemented('Updating formats is not yet implemented.');
}
, remove_object: function( bundle, callback ){
var e = Boom.notImplemented('method remove_object not implemented');
e = annotate( e, bundle );
setImmediate( callback, e, null );
}
, create_object: function create_object( bundle, callback ){
var e = Boom.notImplemented( "create_object is not implemented" );
setImmediate(callback, annotate( e, bundle ) );
}
delete: function (request, reply) {
//TODO
reply(Boom.notImplemented("This needs to be implemented."));
}
};
handler: (request, reply) => {
if(!request.db) {
reply(Boom.notImplemented('PostgreSql not added'));
} else {
request.db.query('select now()').then(reply).catch((err) => {
request.log(['error'], err);
reply(Boom.badImplementation('No time'));
});
}
}
};
const getModels = (request) => {
const noGetDb = typeof request.getDb !== 'function';
const noRequestModels = !request.models;
if (noGetDb && noRequestModels) {
return notImplemented('`request.getDb` or `request.models` are not defined.'
+ 'Be sure to load hapi-sequelize before hapi-sequelize-crud.');
}
const { models } = noGetDb ? request : request.getDb();
return models;
};
, replace_object: function replace_object( bundle, callback ){
var e = Boom.notImplemented("method replace_object not implemented");
e = annotate(e, bundle);
setImmediate( callback, e, null );
}
handler: (request, reply) => {
if (!request.query.download) {
return reply(Boom.notImplemented('Query parameter "download" missing'));
}
db('scenarios_files')
.select('*')
.where('id', request.params.fileId)
.where('project_id', request.params.projId)
.where('scenario_id', request.params.scId)
.then(res => {
if (!res.length) throw new FileNotFoundError();
return res[0];
})
.then(file => {
return getFile(file.path)
.then(dataStream => {
let mime;
switch (file.type) {