firebase-tools 15.36.0 → 15.36.1-main.0

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 (69) hide show
  1. package/lib/accountExporter.js +1 -1
  2. package/lib/accountImporter.js +7 -6
  3. package/lib/apiv2.js +0 -1
  4. package/lib/apptesting/parseTestFiles.js +1 -1
  5. package/lib/auth.js +1 -1
  6. package/lib/bin/progressiveHelp.js +1 -1
  7. package/lib/command.js +1 -2
  8. package/lib/commands/crashlytics-events-get.js +48 -0
  9. package/lib/commands/crashlytics-events-list.js +70 -0
  10. package/lib/commands/crashlytics-heapdumps-enable.js +3 -4
  11. package/lib/commands/crashlytics-heapdumps-status.js +5 -3
  12. package/lib/commands/crashlytics-issues-get.js +61 -0
  13. package/lib/commands/crashlytics-reports-get.js +179 -0
  14. package/lib/commands/crashlytics-reports-list.js +42 -0
  15. package/lib/commands/ext-dev-init.js +1 -1
  16. package/lib/commands/hosting-channel-open.js +4 -1
  17. package/lib/commands/index.js +10 -0
  18. package/lib/commands/open.js +3 -1
  19. package/lib/commands/serve.js +1 -1
  20. package/lib/commands/use.js +1 -1
  21. package/lib/config.js +1 -1
  22. package/lib/crashlytics/commandUtils.js +194 -0
  23. package/lib/crashlytics/events.js +8 -8
  24. package/lib/crashlytics/filters.js +1 -1
  25. package/lib/crashlytics/profilingManager.js +63 -16
  26. package/lib/crashlytics/reports.js +5 -1
  27. package/lib/deploy/firestore/prepare.js +21 -3
  28. package/lib/deploy/functions/cel.js +1 -1
  29. package/lib/deploy/functions/deploy.js +2 -1
  30. package/lib/deploy/functions/release/fabricator.js +9 -2
  31. package/lib/deploy/functions/release/planner.js +3 -0
  32. package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
  33. package/lib/emulator/downloadableEmulatorInfo.json +31 -31
  34. package/lib/emulator/functionsEmulatorRuntime.js +2 -2
  35. package/lib/experiments.js +5 -0
  36. package/lib/extensions/listExtensions.js +1 -1
  37. package/lib/firestore/delete.js +2 -3
  38. package/lib/frameworks/next/constants.js +17 -14
  39. package/lib/frameworks/next/index.js +25 -3
  40. package/lib/frameworks/next/utils.js +6 -8
  41. package/lib/gcp/cloudbilling.js +2 -2
  42. package/lib/gcp/cloudbuild.js +0 -77
  43. package/lib/gcp/cloudtasks.js +0 -4
  44. package/lib/gcp/devConnect.js +0 -6
  45. package/lib/gcp/iam.js +15 -1
  46. package/lib/gcp/resourceManager.js +1 -14
  47. package/lib/gcp/storage.js +87 -4
  48. package/lib/hosting/api.js +0 -7
  49. package/lib/hosting/implicitInit.js +1 -1
  50. package/lib/hosting/proxy.js +1 -1
  51. package/lib/init/features/firestore/rules.js +1 -1
  52. package/lib/init/features/functions/index.js +2 -2
  53. package/lib/init/features/functions/npm-dependencies.js +1 -1
  54. package/lib/init/features/storage/rules.js +1 -1
  55. package/lib/localFunction.js +3 -3
  56. package/lib/management/database.js +1 -1
  57. package/lib/mcp/apps/init/mcp-app.js +1 -1
  58. package/lib/mcp/apps/update_environment/mcp-app.js +1 -1
  59. package/lib/mcp/index.js +6 -2
  60. package/lib/mcp/tools/crashlytics/reports.js +2 -2
  61. package/lib/mcp/util/dataconnect/converter.js +1 -1
  62. package/lib/profileReport.js +1 -1
  63. package/lib/profiler.js +1 -1
  64. package/lib/rulesDeploy.js +0 -1
  65. package/lib/throttler/throttler.js +1 -1
  66. package/lib/tsconfig.compile.tsbuildinfo +1 -1
  67. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  68. package/lib/utils.js +1 -1
  69. package/package.json +4 -4
@@ -33,7 +33,7 @@ function proxyRequestHandler(url, rewriteIdentifier, options = {}) {
33
33
  const sessionCookie = cookie.split(/; ?/).find((c) => {
34
34
  return c.trim().startsWith("__session=");
35
35
  });
36
- const u = new url_1.URL(url + req.url);
36
+ const u = new url_1.URL(`${url}${req.url ?? ""}`);
37
37
  const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: false });
38
38
  let body;
39
39
  let passThrough;
@@ -49,7 +49,7 @@ async function getRulesFromConsole(projectId) {
49
49
  return utils.reject("Ruleset has no files", { exit: 1 });
50
50
  }
51
51
  if (rules.length > 1) {
52
- return utils.reject("Ruleset has too many files: " + rules.length, { exit: 1 });
52
+ return utils.reject(`Ruleset has too many files: ${rules.length}`, { exit: 1 });
53
53
  }
54
54
  return rules[0].content;
55
55
  }
@@ -195,7 +195,7 @@ async function languageSetup(setup) {
195
195
  }
196
196
  async function actuate(setup, config) {
197
197
  if (setup.languageOverride) {
198
- return require("./" + setup.languageOverride).setup(setup, config);
198
+ return require(`./${String(setup.languageOverride)}`).setup(setup, config);
199
199
  }
200
- return require("./" + setup.functions.languageChoice).setup(setup, config);
200
+ return require(`./${String(setup.functions.languageChoice)}`).setup(setup, config);
201
201
  }
@@ -11,7 +11,7 @@ async function askInstallDependencies(setup, config) {
11
11
  });
12
12
  if (setup.npm) {
13
13
  try {
14
- await (0, spawn_1.wrapSpawn)("npm", ["install"], config.projectDir + `/${setup.source}`);
14
+ await (0, spawn_1.wrapSpawn)("npm", ["install"], `${String(config.projectDir)}/${setup.source}`);
15
15
  }
16
16
  catch (e) {
17
17
  logger_1.logger.info();
@@ -15,7 +15,7 @@ async function getRulesFromConsole(projectId) {
15
15
  return utils.reject("Ruleset has no files", { exit: 1 });
16
16
  }
17
17
  if (rules.length > 1) {
18
- return utils.reject("Ruleset has too many files: " + rules.length, { exit: 1 });
18
+ return utils.reject(`Ruleset has too many files: ${rules.length}`, { exit: 1 });
19
19
  }
20
20
  return rules[0].content;
21
21
  }
@@ -20,7 +20,7 @@ class LocalFunction {
20
20
  return resource.replace(this.paramWildcardRegex, (wildcard) => {
21
21
  const wildcardNoBraces = wildcard.slice(1, -1);
22
22
  const sub = params?.[wildcardNoBraces];
23
- return sub || wildcardNoBraces + utils.randomInt(1, 9);
23
+ return sub || `${wildcardNoBraces}${utils.randomInt(1, 9)}`;
24
24
  });
25
25
  }
26
26
  constructCallableFunc(data, opts) {
@@ -156,9 +156,9 @@ class LocalFunction {
156
156
  }
157
157
  requestCallBack(err, response, body) {
158
158
  if (err) {
159
- return console.warn("\nERROR SENDING REQUEST: " + err);
159
+ return console.warn(`\nERROR SENDING REQUEST: ${String(err)}`);
160
160
  }
161
- const status = response ? response.status + ", " : "";
161
+ const status = response ? `${response.status}, ` : "";
162
162
  let bodyString = body;
163
163
  if (typeof bodyString === "string") {
164
164
  try {
@@ -104,7 +104,7 @@ async function checkInstanceNameAvailable(projectId, instanceName, databaseType,
104
104
  return { available: true };
105
105
  }
106
106
  catch (err) {
107
- logger_1.logger.debug(`Invalid Realtime Database instance name: ${instanceName}.${err.message ? " " + err.message : ""}`);
107
+ logger_1.logger.debug(`Invalid Realtime Database instance name: ${instanceName}.${err.message ? ` ${String(err.message)}` : ""}`);
108
108
  const errBody = err.context.body.error;
109
109
  if (errBody?.details?.[0]?.metadata?.suggested_database_ids) {
110
110
  return {
@@ -174,7 +174,7 @@ app.onhostcontextchanged = (ctx) => {
174
174
  document.body.style.padding = `${top}px ${right}px ${bottom}px ${left}px`;
175
175
  }
176
176
  };
177
- (async () => {
177
+ void (async () => {
178
178
  const envDirEl = document.getElementById("env-dir");
179
179
  try {
180
180
  await app.connect();
@@ -97,7 +97,7 @@ app.onhostcontextchanged = (ctx) => {
97
97
  document.body.style.padding = `${top}px ${right}px ${bottom}px ${left}px`;
98
98
  }
99
99
  };
100
- (async () => {
100
+ void (async () => {
101
101
  try {
102
102
  await app.connect();
103
103
  showStatus("Connecting to server...", "info");
package/lib/mcp/index.js CHANGED
@@ -493,12 +493,16 @@ class FirebaseMcpServer {
493
493
  const message = this._pendingMessages.shift();
494
494
  if (!message)
495
495
  continue;
496
- this.server.sendLoggingMessage({
496
+ this.server
497
+ .sendLoggingMessage({
497
498
  level: message.level,
498
499
  data: message.data,
500
+ })
501
+ .catch(() => {
499
502
  });
500
503
  }
501
- void this.server.sendLoggingMessage({ level, data });
504
+ this.server.sendLoggingMessage({ level, data }).catch(() => {
505
+ });
502
506
  }
503
507
  else {
504
508
  this._pendingMessages.push({ level, data });
@@ -33,7 +33,7 @@ exports.get_report = (0, tool_1.tool)("crashlytics", {
33
33
  _meta: {
34
34
  requiresAuth: true,
35
35
  },
36
- }, async ({ appId, report, pageSize, filter, granularity }) => {
36
+ }, async ({ appId, report, pageSize, filter, filterExpression, granularity }) => {
37
37
  const result = { content: [] };
38
38
  if (!appId) {
39
39
  result.isError = true;
@@ -52,7 +52,7 @@ exports.get_report = (0, tool_1.tool)("crashlytics", {
52
52
  return result;
53
53
  }
54
54
  try {
55
- const reportResponse = (0, reports_1.simplifyReport)(await (0, reports_1.getReport)(report, appId, filter, pageSize, granularity));
55
+ const reportResponse = (0, reports_1.simplifyReport)(await (0, reports_1.getReport)(report, appId, filter, pageSize, granularity, filterExpression));
56
56
  reportResponse.usage =
57
57
  reportResponse.groups && reportResponse.groups.length
58
58
  ? reportResponse.usage || ""
@@ -23,7 +23,7 @@ function parseVariables(unparsedVariables) {
23
23
  obj = JSON.parse(unparsedVariables || "{}");
24
24
  }
25
25
  catch (e) {
26
- throw new Error("Provided variables string `" + unparsedVariables + "` is not valid JSON.");
26
+ throw new Error(`Provided variables string \`${String(unparsedVariables)}\` is not valid JSON.`);
27
27
  }
28
28
  if (typeof obj !== "object" || obj == null)
29
29
  throw new Error("not an object");
@@ -50,7 +50,7 @@ function formatNumber(num) {
50
50
  function formatBytes(bytes) {
51
51
  const threshold = 1000;
52
52
  if (Math.round(bytes) < threshold) {
53
- return bytes + " B";
53
+ return `${bytes} B`;
54
54
  }
55
55
  const units = ["kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
56
56
  let u = -1;
package/lib/profiler.js CHANGED
@@ -68,7 +68,7 @@ async function profiler(options) {
68
68
  }
69
69
  });
70
70
  res.body.on("end", () => {
71
- spinner.text = counter + " operations recorded.\n";
71
+ spinner.text = `${counter} operations recorded.\n`;
72
72
  });
73
73
  let resError;
74
74
  res.body.on("error", (e) => {
@@ -29,7 +29,6 @@ class RulesDeploy {
29
29
  constructor(options, type) {
30
30
  this.options = options;
31
31
  this.type = type;
32
- this.project = options.project;
33
32
  this.rulesFiles = [];
34
33
  this.rulesetNames = {};
35
34
  }
@@ -72,7 +72,7 @@ class Throttler {
72
72
  return;
73
73
  }
74
74
  this.active++;
75
- this.handle(this.nextWaitingTaskIndex());
75
+ void this.handle(this.nextWaitingTaskIndex());
76
76
  }
77
77
  async handle(cursorIndex) {
78
78
  const taskData = this.taskDataMap.get(cursorIndex);