diff --git a/src/commands/frameworks-stacks-create.ts b/src/commands/frameworks-backends-create.ts similarity index 78% rename from src/commands/frameworks-stacks-create.ts rename to src/commands/frameworks-backends-create.ts index 5ffe85a9c12..b31b5033820 100644 --- a/src/commands/frameworks-stacks-create.ts +++ b/src/commands/frameworks-backends-create.ts @@ -4,8 +4,8 @@ import { needProjectId } from "../projectUtils"; import requireInteractive from "../requireInteractive"; import { doSetup } from "../init/features/frameworks"; -export const command = new Command("stacks:create") - .description("Create a stack in a Firebase project") +export const command = new Command("backends:create") + .description("Create a backend in a Firebase project") .before(requireInteractive) .action(async (options: Options) => { const projectId = needProjectId(options); diff --git a/src/commands/frameworks-stacks-delete.ts b/src/commands/frameworks-backends-delete.ts similarity index 57% rename from src/commands/frameworks-stacks-delete.ts rename to src/commands/frameworks-backends-delete.ts index 8916e856b10..21c79a993f4 100644 --- a/src/commands/frameworks-stacks-delete.ts +++ b/src/commands/frameworks-backends-delete.ts @@ -6,24 +6,24 @@ import * as gcp from "../gcp/frameworks"; import { promptOnce } from "../prompt"; import * as utils from "../utils"; -export const command = new Command("stacks:delete") - .description("Delete a stack from a Firebase project") +export const command = new Command("backends:delete") + .description("Delete a backend from a Firebase project") .option("-l, --location ", "App Backend location", "us-central1") - .option("-s, --stackId ", "Stack Id", "") + .option("-s, --backendId ", "Backend Id", "") .withForce() .action(async (options: Options) => { const projectId = needProjectId(options); const location = options.location as string; - const stackId = options.stackId as string; - if (!stackId) { - throw new FirebaseError("Stack id can't be empty."); + const backendId = options.backendId as string; + if (!backendId) { + throw new FirebaseError("Backend id can't be empty."); } const confirmDeletion = await promptOnce( { type: "confirm", name: "force", default: false, - message: "You are about to delete the Stack with id: " + stackId + "\n Are you sure?", + message: "You are about to delete the backend with id: " + backendId + "\n Are you sure?", }, options ); @@ -32,11 +32,11 @@ export const command = new Command("stacks:delete") } try { - await gcp.deleteStack(projectId, location, stackId); - utils.logSuccess(`Successfully deleted the stack: ${stackId}`); + await gcp.deleteBackend(projectId, location, backendId); + utils.logSuccess(`Successfully deleted the backend: ${backendId}`); } catch (err: any) { throw new FirebaseError( - `Failed to delete stack: ${stackId}. Please check the parameters you have provided.`, + `Failed to delete backend: ${backendId}. Please check the parameters you have provided.`, { original: err } ); } diff --git a/src/commands/index.ts b/src/commands/index.ts index 4814d4f66fe..cf22615a910 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -155,9 +155,9 @@ export function load(client: any): any { client.frameworks = {}; client.frameworks.stacks = {}; client.frameworks.stacks.list = loadCommand("frameworks-stacks-list"); - client.frameworks.stacks.create = loadCommand("frameworks-stacks-create"); + client.frameworks.stacks.create = loadCommand("frameworks-backends-create"); client.frameworks.stacks.create = loadCommand("frameworks-stacks-get"); - client.frameworks.stacks.create = loadCommand("frameworks-stacks-delete"); + client.frameworks.stacks.create = loadCommand("frameworks-backends-delete"); } client.login = loadCommand("login"); client.login.add = loadCommand("login-add"); diff --git a/src/gcp/frameworks.ts b/src/gcp/frameworks.ts index cc7f3a5f4d2..b6d740074e9 100644 --- a/src/gcp/frameworks.ts +++ b/src/gcp/frameworks.ts @@ -128,14 +128,14 @@ export async function listStack(projectId: string, location: string): Promise
  • { - const name = `projects/${projectId}/locations/${location}/backends/${stackId}`; + const name = `projects/${projectId}/locations/${location}/backends/${backendId}`; const res = await client.delete(name); return res.body;