firebase-tools 13.35.0 → 13.35.1

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.
@@ -16,13 +16,8 @@ exports.command = new command_1.Command("functions:artifacts:setpolicy")
16
16
  "This policy will automatically delete old container images created during functions deployment.")
17
17
  .option("--location <location>", "Specify location to set up the cleanup policy. " +
18
18
  "If omitted, uses the default functions location.", "us-central1")
19
- .option("--days <days>", "Number of days to keep container images before deletion. Default is 3 days.", "3")
19
+ .option("--days <days>", `Number of days to keep container images before deletion. Default is ${artifacts.DEFAULT_CLEANUP_DAYS} day.`)
20
20
  .option("--none", "Opt-out from cleanup policy. This will prevent suggestions to set up a cleanup policy during initialization and deployment.")
21
- .before((options) => {
22
- if (options.days && options.none) {
23
- throw new error_1.FirebaseError("Cannot specify both --days and --none options.");
24
- }
25
- })
26
21
  .withForce("Automatically create or modify cleanup policy")
27
22
  .before(requireAuth_1.requireAuth)
28
23
  .before(async (options) => {
@@ -35,9 +30,12 @@ exports.command = new command_1.Command("functions:artifacts:setpolicy")
35
30
  ])
36
31
  .action(async (options) => {
37
32
  var _a;
33
+ if (options.days && options.none) {
34
+ throw new error_1.FirebaseError("Cannot specify both --days and --none options.");
35
+ }
38
36
  const projectId = (0, projectUtils_1.needProjectId)(options);
39
37
  const location = options.location || "us-central1";
40
- let daysToKeep = parseInt(options.days || "3", 10);
38
+ let daysToKeep = parseInt(options.days || artifacts.DEFAULT_CLEANUP_DAYS, 10);
41
39
  const repoPath = artifacts.makeRepoPath(projectId, location);
42
40
  let repository;
43
41
  try {
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasCleanupOptOut = exports.hasSameCleanupPolicy = exports.setCleanupPolicy = exports.optOutRepository = exports.updateRepository = exports.generateCleanupPolicy = exports.parseDaysFromPolicy = exports.daysToSeconds = exports.findExistingPolicy = exports.makeRepoPath = exports.OPT_OUT_LABEL_KEY = exports.CLEANUP_POLICY_ID = exports.GCF_REPO_ID = void 0;
3
+ exports.hasCleanupOptOut = exports.hasSameCleanupPolicy = exports.setCleanupPolicy = exports.optOutRepository = exports.updateRepository = exports.generateCleanupPolicy = exports.parseDaysFromPolicy = exports.daysToSeconds = exports.findExistingPolicy = exports.makeRepoPath = exports.DEFAULT_CLEANUP_DAYS = exports.OPT_OUT_LABEL_KEY = exports.CLEANUP_POLICY_ID = exports.GCF_REPO_ID = void 0;
4
4
  const artifactregistry = require("../gcp/artifactregistry");
5
5
  const error_1 = require("../error");
6
6
  exports.GCF_REPO_ID = "gcf-artifacts";
7
7
  exports.CLEANUP_POLICY_ID = "firebase-functions-cleanup";
8
8
  exports.OPT_OUT_LABEL_KEY = "firebase-functions-cleanup-opted-out";
9
+ exports.DEFAULT_CLEANUP_DAYS = 1;
9
10
  const SECONDS_IN_DAY = 24 * 60 * 60;
10
11
  function makeRepoPath(projectId, location, repoName = exports.GCF_REPO_ID) {
11
12
  return `projects/${projectId}/locations/${location}/repositories/${repoName}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "13.35.0",
3
+ "version": "13.35.1",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {