You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
605 B

import { input, password } from '@inquirer/prompts'
import { v4 as uuidv4 } from 'uuid';
import { getOrCreateSqlite } from '@nano/sqlite'
import path from 'path'
import FlowStore from './../store/flow.js'
// getting db and flowStore
const mainDB = getOrCreateSqlite({ 'uri': process.env.APP_SQLITE_URI_MAIN, 'create': true, 'readwrite': true })
const flowStore = new FlowStore(mainDB)
// adding action
const uuid = await input({
message: 'uuid:',
async validate(value) {
if (!value) {
return 'Required!'
}
return true
}
})
flowStore.deleteByUuid(uuid)