browse
Version:
Unified Browserbase CLI for browser automation and cloud APIs.
28 lines (27 loc) • 1.21 kB
JavaScript
import { Args } from "@oclif/core";
import { BrowseCommand } from "../../../base.js";
import { apiCommonFlags, toApiOptions } from "../../../lib/cloud/flags.js";
import { detachFunctionSecret } from "../../../lib/secrets/api.js";
export default class FunctionSecretsDetach extends BrowseCommand {
static description = "Detach a secret from a function without deleting the secret.";
static examples = [
"browse functions secrets detach <functionId> <secretId>",
"browse functions secrets detach 7b6e1c42-8d93-4a15-b2f0-9c6d3e8a5041 d2c4f48f-38e9-4b82-a36a-2b373fd14a65",
];
static args = {
functionId: Args.string({
description: "Function ID (e.g. 7b6e1c42-8d93-4a15-b2f0-9c6d3e8a5041).",
required: true,
}),
secretId: Args.string({
description: "Project secret ID (e.g. d2c4f48f-38e9-4b82-a36a-2b373fd14a65).",
required: true,
}),
};
static flags = { ...apiCommonFlags };
async run() {
const { args, flags } = await this.parse(FunctionSecretsDetach);
const options = toApiOptions(flags);
await detachFunctionSecret(options, args.functionId, args.secretId);
}
}