firebase-tools 10.1.0 → 10.1.4

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.
Files changed (91) hide show
  1. package/lib/accountExporter.js +9 -8
  2. package/lib/accountImporter.js +10 -8
  3. package/lib/apiv2.js +91 -48
  4. package/lib/archiveDirectory.js +63 -73
  5. package/lib/bin/firebase.js +1 -1
  6. package/lib/commands/auth-export.js +26 -25
  7. package/lib/commands/auth-import.js +88 -78
  8. package/lib/commands/ext-configure.js +1 -1
  9. package/lib/commands/ext-dev-init.js +1 -1
  10. package/lib/commands/ext-dev-publish.js +1 -1
  11. package/lib/commands/ext-dev-register.js +1 -1
  12. package/lib/commands/ext-dev-usage.js +3 -8
  13. package/lib/commands/ext-info.js +1 -1
  14. package/lib/commands/ext-install.js +1 -1
  15. package/lib/commands/ext-uninstall.js +1 -1
  16. package/lib/commands/ext-update.js +1 -1
  17. package/lib/commands/functions-config-clone.js +22 -23
  18. package/lib/commands/functions-config-get.js +22 -22
  19. package/lib/commands/functions-config-set.js +24 -22
  20. package/lib/commands/functions-config-unset.js +20 -22
  21. package/lib/commands/help.js +12 -12
  22. package/lib/commands/hosting-channel-create.js +1 -1
  23. package/lib/commands/hosting-channel-delete.js +2 -2
  24. package/lib/commands/hosting-channel-deploy.js +1 -1
  25. package/lib/commands/hosting-clone.js +1 -1
  26. package/lib/commands/login-ci.js +10 -10
  27. package/lib/commands/remoteconfig-versions-list.js +6 -1
  28. package/lib/commands/setup-emulators-database.js +8 -7
  29. package/lib/commands/setup-emulators-firestore.js +8 -7
  30. package/lib/commands/setup-emulators-pubsub.js +5 -4
  31. package/lib/commands/setup-emulators-storage.js +3 -2
  32. package/lib/commands/setup-emulators-ui.js +8 -7
  33. package/lib/commands/target-apply.js +17 -16
  34. package/lib/commands/target-clear.js +11 -10
  35. package/lib/commands/target-remove.js +10 -9
  36. package/lib/commands/target.js +20 -20
  37. package/lib/database/metadata.js +16 -24
  38. package/lib/defaultCredentials.js +3 -3
  39. package/lib/deploy/functions/backend.js +3 -1
  40. package/lib/deploy/functions/prepare.js +17 -11
  41. package/lib/deploy/functions/release/fabricator.js +4 -1
  42. package/lib/deploy/functions/runtimes/golang/index.js +6 -9
  43. package/lib/deploy/functions/runtimes/index.js +6 -10
  44. package/lib/deploy/functions/runtimes/node/index.js +5 -9
  45. package/lib/deploy/functions/runtimes/node/validate.js +2 -1
  46. package/lib/deploy/functions/validate.js +32 -4
  47. package/lib/deploy/hosting/convertConfig.js +45 -24
  48. package/lib/deploy/hosting/prepare.js +1 -1
  49. package/lib/emulator/auth/widget_ui.js +1 -1
  50. package/lib/emulator/downloadableEmulators.js +3 -2
  51. package/lib/emulator/functionsEmulator.js +9 -1
  52. package/lib/emulator/functionsEmulatorRuntime.js +4 -4
  53. package/lib/emulator/storage/apis/gcloud.js +2 -2
  54. package/lib/emulator/storage/files.js +8 -3
  55. package/lib/emulator/storage/rules/runtime.js +5 -4
  56. package/lib/extensions/askUserForConsent.js +1 -1
  57. package/lib/extensions/askUserForParam.js +1 -1
  58. package/lib/extensions/billingMigrationHelper.js +1 -1
  59. package/lib/extensions/changelog.js +1 -1
  60. package/lib/extensions/displayExtensionInfo.js +1 -1
  61. package/lib/extensions/extensionsApi.js +57 -112
  62. package/lib/extensions/extensionsHelper.js +19 -15
  63. package/lib/extensions/provisioningHelper.js +7 -10
  64. package/lib/extensions/resolveSource.js +5 -5
  65. package/lib/extensions/updateHelper.js +1 -1
  66. package/lib/extensions/warnings.js +1 -1
  67. package/lib/functionsConfig.js +4 -5
  68. package/lib/gcp/cloudbilling.js +8 -19
  69. package/lib/gcp/cloudfunctions.js +22 -46
  70. package/lib/gcp/cloudlogging.js +8 -11
  71. package/lib/gcp/cloudmonitoring.js +8 -5
  72. package/lib/gcp/cloudscheduler.js +7 -18
  73. package/lib/gcp/firedata.js +5 -4
  74. package/lib/gcp/firestore.js +5 -5
  75. package/lib/gcp/iam.js +18 -33
  76. package/lib/gcp/resourceManager.js +8 -13
  77. package/lib/gcp/rules.js +18 -41
  78. package/lib/gcp/runtimeconfig.js +31 -53
  79. package/lib/gcp/secretManager.js +21 -43
  80. package/lib/gcp/storage.js +25 -29
  81. package/lib/projectUtils.js +1 -1
  82. package/lib/remoteconfig/get.js +14 -8
  83. package/lib/remoteconfig/rollback.js +13 -6
  84. package/lib/remoteconfig/versionslist.js +13 -7
  85. package/npm-shrinkwrap.json +1439 -2295
  86. package/package.json +16 -11
  87. package/schema/firebase-config.json +387 -12
  88. package/standalone/firepit.js +4 -4
  89. package/templates/init/hosting/index.html +1 -1
  90. package/lib/commands/functions-config-legacy.js +0 -45
  91. package/lib/prepareFirebaseRules.js +0 -58
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var _ = require("lodash");
3
- var { Command } = require("../command");
4
- var needProjectId = require("../projectUtils").needProjectId;
5
- var { requirePermissions } = require("../requirePermissions");
6
- var runtimeconfig = require("../gcp/runtimeconfig");
7
- var functionsConfig = require("../functionsConfig");
8
- const { logger } = require("../logger");
9
- module.exports = new Command("functions:config:legacy")
10
- .description("get legacy functions config variables")
11
- .before(requirePermissions, [
12
- "runtimeconfig.configs.list",
13
- "runtimeconfig.configs.get",
14
- "runtimeconfig.variables.list",
15
- "runtimeconfig.variables.get",
16
- ])
17
- .action(function (options) {
18
- var projectId = needProjectId(options);
19
- var metaPath = "projects/" + projectId + "/configs/firebase/variables/meta";
20
- return runtimeconfig.variables
21
- .get(metaPath)
22
- .then(function (result) {
23
- var metaVal = JSON.parse(result.text);
24
- if (!_.has(metaVal, "version")) {
25
- logger.info("You do not have any legacy config variables.");
26
- return null;
27
- }
28
- var latestVarPath = functionsConfig.idsToVarName(projectId, "firebase", metaVal.version);
29
- return runtimeconfig.variables.get(latestVarPath);
30
- })
31
- .then(function (latest) {
32
- if (latest !== null) {
33
- var latestVal = JSON.parse(latest.text);
34
- logger.info(JSON.stringify(latestVal, null, 2));
35
- return latestVal;
36
- }
37
- })
38
- .catch(function (err) {
39
- if (_.get(err, "context.response.statusCode") === 404) {
40
- logger.info("You do not have any legacy config variables.");
41
- return null;
42
- }
43
- return Promise.reject(err);
44
- });
45
- });
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var clc = require("cli-color");
3
- var fs = require("fs");
4
- var api = require("./api");
5
- var utils = require("./utils");
6
- var prepareFirebaseRules = function (component, options, payload) {
7
- var rulesFileName = component + ".rules";
8
- var rulesPath = options.config.get(rulesFileName);
9
- if (rulesPath) {
10
- rulesPath = options.config.path(rulesPath);
11
- var src = fs.readFileSync(rulesPath, "utf8");
12
- utils.logBullet(clc.bold.cyan(component + ":") + " checking rules for compilation errors...");
13
- return api
14
- .request("POST", "/v1/projects/" + encodeURIComponent(options.project) + ":test", {
15
- origin: api.rulesOrigin,
16
- data: {
17
- source: {
18
- files: [
19
- {
20
- content: src,
21
- name: rulesFileName,
22
- },
23
- ],
24
- },
25
- },
26
- auth: true,
27
- })
28
- .then(function (response) {
29
- if (response.body && response.body.issues && response.body.issues.length > 0) {
30
- var add = response.body.issues.length === 1 ? "" : "s";
31
- var message = "Compilation error" +
32
- add +
33
- " in " +
34
- clc.bold(options.config.get(rulesFileName)) +
35
- ":\n";
36
- response.body.issues.forEach(function (issue) {
37
- message +=
38
- "\n[" +
39
- issue.severity.substring(0, 1) +
40
- "] " +
41
- issue.sourcePosition.line +
42
- ":" +
43
- issue.sourcePosition.column +
44
- " - " +
45
- issue.description;
46
- });
47
- return utils.reject(message, { exit: 1 });
48
- }
49
- utils.logSuccess(clc.bold.green(component + ":") + " rules file compiled successfully");
50
- payload[component] = {
51
- rules: [{ name: options.config.get(rulesFileName), content: src }],
52
- };
53
- return Promise.resolve();
54
- });
55
- }
56
- return Promise.resolve();
57
- };
58
- module.exports = prepareFirebaseRules;