This commit is contained in:
Morten Olsen
2024-01-12 12:43:51 +01:00
commit 6d8e5bf955
109 changed files with 9246 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import { Command } from 'commander';
import { createClient } from '../../client/client.js';
import { step } from '../../utils/step.js';
const create = new Command('create');
create
.description('Create a new run')
.argument('load-id', 'Load ID')
.action(async (loadId) => {
const client = await step('Connecting to server', async () => {
return createClient();
});
await step('Creating run', async () => {
await client.runs.create.mutate({ loadId });
});
});
export { create };

View File

@@ -0,0 +1,21 @@
import { Command } from 'commander';
import { createClient } from '../../client/client.js';
import { step } from '../../utils/step.js';
const list = new Command('create');
list
.alias('ls')
.description('Find a run')
.argument('[load-id]', 'Load ID')
.action(async (loadId) => {
const client = await step('Connecting to server', async () => {
return createClient();
});
const runs = await step('Getting runs', async () => {
return await client.runs.find.query({ loadId });
});
console.table(runs);
});
export { list };

View File

@@ -0,0 +1,8 @@
import { Command } from 'commander';
import { create } from './runs.create.js';
import { list } from './runs.list.js';
const runs = new Command('runs');
runs.description('Manage runs').addCommand(create).addCommand(list);
export { runs };