feat: switched from worker API to fs based

This commit is contained in:
Morten Olsen
2024-01-12 14:14:40 +01:00
parent 6d8e5bf955
commit 59d6faaafc
38 changed files with 458 additions and 67 deletions

View File

@@ -1,6 +1,7 @@
import { Command } from 'commander';
import { createClient } from '../../client/client.js';
import { step } from '../../utils/step.js';
import { Context } from '../../context/context.js';
const list = new Command('list');
@@ -22,8 +23,9 @@ list
.option('-s, --sort <order>', 'Sort', 'desc')
.action(async () => {
const { runId, loadId, severities, offset, limit, order } = list.opts();
const context = new Context();
const client = await step('Connecting to server', async () => {
return createClient();
return createClient(context);
});
const logs = await step('Getting logs', async () => {
return await client.logs.find.query({
@@ -35,7 +37,7 @@ list
order,
});
});
console.table(logs.reverse());
console.table(logs);
});
export { list };