@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
23 lines • 1.01 kB
JavaScript
import fs from "node:fs";
import path from "node:path";
import inquirer from "inquirer";
import { deleteTasks } from "./deleteTasks.js";
const packageJson = JSON.parse(fs.readFileSync(path.join("./", "package.json")).toString());
const geoprocessingJson = JSON.parse(fs.readFileSync(path.join("./", "project", "geoprocessing.json")).toString());
export async function clearResults() {
const answers = await inquirer.prompt([
{
type: "input",
name: "tableName",
message: "Name of the report function cache to clear. Enter 'all' to clear all cached reports:",
validate: (value) => /^\w+$/.test(value) ? true : "Please use only alphabetical characters",
},
]);
await clearCachedResults(answers);
}
export async function clearCachedResults(options) {
const serviceName = options.tableName;
await deleteTasks(packageJson.name, geoprocessingJson.region, serviceName);
}
await clearResults();
//# sourceMappingURL=clearResults.js.map