@swell/cli
Version:
Swell's command line interface/utility
30 lines (29 loc) • 937 B
JavaScript
import { Args, Flags } from '@oclif/core';
import { HttpMethod } from '../../lib/api.js';
import { SwellApiCommand } from '../../swell-api-command.js';
export default class ApiDelete extends SwellApiCommand {
static summary = 'Send a DELETE request to the Swell API.';
static description = 'Remove existing resources from the Swell Backend API.';
static args = {
path: Args.string({
description: 'API endpoint path (must start with /)',
required: true,
}),
};
static flags = {
live: Flags.boolean({
description: 'Use live environment instead of test',
default: false,
}),
};
static examples = [
'swell api delete /products/abc123',
'swell api delete /functions/my-app/clear-cache',
];
get method() {
return HttpMethod.DELETE;
}
async run() {
await this.request(ApiDelete);
}
}