GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: //usr/local/lib/node_modules/firebase-tools/lib/commands/functions-config-unset.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.command = void 0;
const clc = require("colorette");
const command_1 = require("../command");
const logger_1 = require("../logger");
const requirePermissions_1 = require("../requirePermissions");
const projectUtils_1 = require("../projectUtils");
const functionsConfig = require("../functionsConfig");
const runtimeconfig = require("../gcp/runtimeconfig");
const utils = require("../utils");
const error_1 = require("../error");
exports.command = new command_1.Command("functions:config:unset [keys...]")
    .description("unset environment config at the specified path(s)")
    .before(requirePermissions_1.requirePermissions, [
    "runtimeconfig.configs.list",
    "runtimeconfig.configs.create",
    "runtimeconfig.configs.get",
    "runtimeconfig.configs.update",
    "runtimeconfig.configs.delete",
    "runtimeconfig.variables.list",
    "runtimeconfig.variables.create",
    "runtimeconfig.variables.get",
    "runtimeconfig.variables.update",
    "runtimeconfig.variables.delete",
])
    .before(functionsConfig.ensureApi)
    .action(async (args, options) => {
    if (!args.length) {
        throw new error_1.FirebaseError("Must supply at least one key");
    }
    const projectId = (0, projectUtils_1.needProjectId)(options);
    const parsed = functionsConfig.parseUnsetArgs(args);
    await Promise.all(parsed.map((item) => {
        if (item.varId === "") {
            return runtimeconfig.configs.delete(projectId, item.configId);
        }
        return runtimeconfig.variables.delete(projectId, item.configId, item.varId);
    }));
    utils.logSuccess("Environment updated.");
    logger_1.logger.info(`\nPlease deploy your functions for the change to take effect by running ${clc.bold("firebase deploy --only functions")}\n`);
});