firebase-tools 12.4.6 → 12.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,8 @@ exports.command = new command_1.Command("ext:configure <extensionInstanceId>")
58
58
  instanceId,
59
59
  projectDir: config.projectDir,
60
60
  });
61
- const [immutableParams, tbdParams] = (0, functional_1.partition)(((_a = spec.params) !== null && _a !== void 0 ? _a : []).concat((_b = spec.systemParams) !== null && _b !== void 0 ? _b : []), (param) => { var _a; return (_a = param.immutable) !== null && _a !== void 0 ? _a : false; });
61
+ const params = ((_a = spec.params) !== null && _a !== void 0 ? _a : []).concat((_b = spec.systemParams) !== null && _b !== void 0 ? _b : []);
62
+ const [immutableParams, tbdParams] = (0, functional_1.partition)(params, (param) => { var _a; return (_a = (param.immutable && !!oldParamValues[param.param])) !== null && _a !== void 0 ? _a : false; });
62
63
  infoImmutableParams(immutableParams, oldParamValues);
63
64
  paramHelper.setNewDefaults(tbdParams, oldParamValues);
64
65
  const mutableParamsBindingOptions = await paramHelper.getParams({
@@ -5,9 +5,11 @@ const command_1 = require("../command");
5
5
  const logger_1 = require("../logger");
6
6
  const projectUtils_1 = require("../projectUtils");
7
7
  const secretManager_1 = require("../gcp/secretManager");
8
+ const requireAuth_1 = require("../requireAuth");
8
9
  const secrets = require("../functions/secrets");
9
10
  exports.command = new command_1.Command("functions:secrets:access <KEY>[@version]")
10
11
  .description("Access secret value given secret and its version. Defaults to accessing the latest version.")
12
+ .before(requireAuth_1.requireAuth)
11
13
  .before(secrets.ensureApi)
12
14
  .action(async (key, options) => {
13
15
  const projectId = (0, projectUtils_1.needProjectId)(options);
@@ -6,11 +6,13 @@ const projectUtils_1 = require("../projectUtils");
6
6
  const secretManager_1 = require("../gcp/secretManager");
7
7
  const prompt_1 = require("../prompt");
8
8
  const utils_1 = require("../utils");
9
+ const requireAuth_1 = require("../requireAuth");
9
10
  const secrets = require("../functions/secrets");
10
11
  const backend = require("../deploy/functions/backend");
11
12
  exports.command = new command_1.Command("functions:secrets:destroy <KEY>[@version]")
12
13
  .description("Destroy a secret. Defaults to destroying the latest version.")
13
14
  .withForce("Destroys a secret without confirmation.")
15
+ .before(requireAuth_1.requireAuth)
14
16
  .before(secrets.ensureApi)
15
17
  .action(async (key, options) => {
16
18
  const projectId = (0, projectUtils_1.needProjectId)(options);
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.command = void 0;
4
4
  const Table = require("cli-table");
5
+ const requireAuth_1 = require("../requireAuth");
5
6
  const command_1 = require("../command");
6
7
  const logger_1 = require("../logger");
7
8
  const projectUtils_1 = require("../projectUtils");
@@ -10,6 +11,7 @@ const requirePermissions_1 = require("../requirePermissions");
10
11
  const secrets = require("../functions/secrets");
11
12
  exports.command = new command_1.Command("functions:secrets:get <KEY>")
12
13
  .description("Get metadata for secret and its versions")
14
+ .before(requireAuth_1.requireAuth)
13
15
  .before(secrets.ensureApi)
14
16
  .before(requirePermissions_1.requirePermissions, ["secretmanager.secrets.get"])
15
17
  .action(async (key, options) => {
@@ -2,17 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.command = void 0;
4
4
  const backend = require("../deploy/functions/backend");
5
+ const secrets = require("../functions/secrets");
5
6
  const command_1 = require("../command");
6
7
  const projectUtils_1 = require("../projectUtils");
7
- const secrets = require("../functions/secrets");
8
8
  const requirePermissions_1 = require("../requirePermissions");
9
9
  const deploymentTool_1 = require("../deploymentTool");
10
10
  const utils_1 = require("../utils");
11
11
  const prompt_1 = require("../prompt");
12
12
  const secretManager_1 = require("../gcp/secretManager");
13
+ const requireAuth_1 = require("../requireAuth");
13
14
  exports.command = new command_1.Command("functions:secrets:prune")
14
15
  .withForce("Destroys unused secrets without prompt")
15
16
  .description("Destroys unused secrets")
17
+ .before(requireAuth_1.requireAuth)
16
18
  .before(secrets.ensureApi)
17
19
  .before(requirePermissions_1.requirePermissions, [
18
20
  "cloudfunctions.functions.list",
@@ -13,11 +13,13 @@ const utils_1 = require("../utils");
13
13
  const projectUtils_1 = require("../projectUtils");
14
14
  const secretManager_1 = require("../gcp/secretManager");
15
15
  const ensureApiEnabled_1 = require("../ensureApiEnabled");
16
+ const requireAuth_1 = require("../requireAuth");
16
17
  const secrets = require("../functions/secrets");
17
18
  const backend = require("../deploy/functions/backend");
18
19
  exports.command = new command_1.Command("functions:secrets:set <KEY>")
19
20
  .description("Create or update a secret for use in Cloud Functions for Firebase.")
20
21
  .withForce("Automatically updates functions to use the new secret.")
22
+ .before(requireAuth_1.requireAuth)
21
23
  .before(secrets.ensureApi)
22
24
  .before(requirePermissions_1.requirePermissions, [
23
25
  "secretmanager.secrets.create",
@@ -10,13 +10,12 @@ const logger_1 = require("../logger");
10
10
  const path = require("path");
11
11
  function runCommand(command, childOptions) {
12
12
  const escapedCommand = command.replace(/\"/g, '\\"');
13
- const translatedCommand = '"' +
14
- process.execPath +
15
- '" "' +
16
- path.resolve(require.resolve("cross-env"), "..", "bin", "cross-env-shell.js") +
17
- '" "' +
18
- escapedCommand +
19
- '"';
13
+ const isVSCode = utils.isVSCodeExtension();
14
+ const nodeExecutable = isVSCode ? "node" : process.execPath;
15
+ const crossEnvShellPath = isVSCode
16
+ ? path.resolve(__dirname, "./cross-env/dist/bin/cross-env-shell.js")
17
+ : path.resolve(require.resolve("cross-env"), "..", "bin", "cross-env-shell.js");
18
+ const translatedCommand = '"' + nodeExecutable + '" "' + crossEnvShellPath + '" "' + escapedCommand + '"';
20
19
  return new Promise((resolve, reject) => {
21
20
  logger_1.logger.info("Running command: " + command);
22
21
  if (translatedCommand === "") {