firebase-tools 14.12.1 → 14.13.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 (54) hide show
  1. package/README.md +1 -1
  2. package/lib/commands/dataconnect-services-list.js +5 -5
  3. package/lib/commands/dataconnect-sql-grant.js +5 -0
  4. package/lib/commands/dataconnect-sql-setup.js +1 -3
  5. package/lib/crashlytics/getIssueDetails.js +41 -0
  6. package/lib/crashlytics/getSampleCrash.js +48 -0
  7. package/lib/dataconnect/client.js +23 -15
  8. package/lib/dataconnect/ensureApis.js +5 -9
  9. package/lib/dataconnect/fileUtils.js +5 -6
  10. package/lib/dataconnect/freeTrial.js +16 -39
  11. package/lib/dataconnect/provisionCloudSql.js +67 -70
  12. package/lib/dataconnect/schemaMigration.js +75 -47
  13. package/lib/deploy/dataconnect/deploy.js +9 -11
  14. package/lib/deploy/dataconnect/prepare.js +7 -10
  15. package/lib/deploy/dataconnect/release.js +11 -5
  16. package/lib/deploy/functions/backend.js +8 -2
  17. package/lib/deploy/functions/build.js +23 -1
  18. package/lib/deploy/functions/ensure.js +1 -1
  19. package/lib/deploy/functions/functionsDeployHelper.js +8 -1
  20. package/lib/deploy/functions/prepare.js +6 -4
  21. package/lib/deploy/functions/pricing.js +12 -5
  22. package/lib/deploy/functions/release/fabricator.js +25 -3
  23. package/lib/emulator/controller.js +2 -1
  24. package/lib/emulator/downloadableEmulatorInfo.json +18 -18
  25. package/lib/emulator/functionsEmulator.js +9 -1
  26. package/lib/experiments.js +4 -0
  27. package/lib/extensions/extensionsHelper.js +4 -15
  28. package/lib/extensions/utils.js +1 -12
  29. package/lib/firestore/api.js +25 -11
  30. package/lib/firestore/pretty-print.js +7 -0
  31. package/lib/functional.js +7 -1
  32. package/lib/functions/projectConfig.js +25 -2
  33. package/lib/functions/secrets.js +3 -0
  34. package/lib/gcp/cloudfunctionsv2.js +3 -31
  35. package/lib/gcp/cloudscheduler.js +1 -1
  36. package/lib/gcp/cloudsql/cloudsqladmin.js +2 -14
  37. package/lib/gcp/cloudsql/connect.js +1 -1
  38. package/lib/gcp/cloudsql/permissionsSetup.js +13 -15
  39. package/lib/gcp/k8s.js +32 -0
  40. package/lib/gcp/runv2.js +178 -0
  41. package/lib/gemini/fdcExperience.js +5 -3
  42. package/lib/init/features/dataconnect/index.js +266 -162
  43. package/lib/init/features/dataconnect/sdk.js +32 -16
  44. package/lib/init/features/project.js +4 -0
  45. package/lib/management/studio.js +1 -1
  46. package/lib/mcp/tools/core/init.js +7 -6
  47. package/lib/mcp/tools/crashlytics/get_issue_details.js +33 -0
  48. package/lib/mcp/tools/crashlytics/get_sample_crash.js +43 -0
  49. package/lib/mcp/tools/crashlytics/index.js +7 -1
  50. package/lib/mcp/tools/crashlytics/list_top_issues.js +2 -1
  51. package/lib/rtdb.js +1 -1
  52. package/package.json +1 -1
  53. package/schema/firebase-config.json +3 -0
  54. package/lib/extensions/resolveSource.js +0 -24
@@ -110,7 +110,7 @@ async function updateStudioFirebaseProject(projectId) {
110
110
  if (err.original) {
111
111
  message += ` (original: ${err.original.message})`;
112
112
  }
113
- logger_1.logger.warn(`Failed to update active Firebase Project for current Studio Workspace: ${message}`);
113
+ logger_1.logger.debug(`Failed to update active Firebase Project for current Studio Workspace: ${message}`);
114
114
  }
115
115
  recordStudioProjectSyncTime();
116
116
  }
@@ -54,6 +54,10 @@ exports.init = (0, tool_1.tool)({
54
54
  .describe("Provide this object to initialize Cloud Firestore in this project directory."),
55
55
  dataconnect: zod_1.z
56
56
  .object({
57
+ app_description: zod_1.z
58
+ .string()
59
+ .optional()
60
+ .describe("Provide a description of the app you are trying to build. If present, Gemini will help generate Data Connect Schema, Connector and seed data"),
57
61
  service_id: zod_1.z
58
62
  .string()
59
63
  .optional()
@@ -74,7 +78,7 @@ exports.init = (0, tool_1.tool)({
74
78
  .describe("The Postgres database ID to use in the Firebase Data Connect service."),
75
79
  })
76
80
  .optional()
77
- .describe("Provide this object to initialize Firebase Data Connect in this project directory."),
81
+ .describe("Provide this object to initialize Firebase Data Connect with Cloud SQL Postgres in this project directory."),
78
82
  storage: zod_1.z
79
83
  .object({
80
84
  rules_filename: zod_1.z
@@ -127,15 +131,12 @@ exports.init = (0, tool_1.tool)({
127
131
  if (features.dataconnect) {
128
132
  featuresList.push("dataconnect");
129
133
  featureInfo.dataconnect = {
134
+ analyticsFlow: "mcp",
135
+ appDescription: features.dataconnect.app_description || "",
130
136
  serviceId: features.dataconnect.service_id || "",
131
137
  locationId: features.dataconnect.location_id || "",
132
138
  cloudSqlInstanceId: features.dataconnect.cloudsql_instance_id || "",
133
139
  cloudSqlDatabase: features.dataconnect.cloudsql_database || "",
134
- connectors: [],
135
- isNewInstance: false,
136
- isNewDatabase: false,
137
- schemaGql: [],
138
- shouldProvisionCSQL: true,
139
140
  };
140
141
  }
141
142
  const setup = {
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.get_issue_details = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const getIssueDetails_1 = require("../../../crashlytics/getIssueDetails");
8
+ exports.get_issue_details = (0, tool_1.tool)({
9
+ name: "get_issue_details",
10
+ description: "Gets the details about a specific crashlytics issue.",
11
+ inputSchema: zod_1.z.object({
12
+ app_id: zod_1.z
13
+ .string()
14
+ .describe("The AppID for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
15
+ issue_id: zod_1.z
16
+ .string()
17
+ .describe("The issue ID for which the details needs to be fetched. This is the value of the field `id` in the list of issues. Defaults to the first id in the list of issues."),
18
+ }),
19
+ annotations: {
20
+ title: "Gets the details of a specific issue.",
21
+ readOnlyHint: true,
22
+ },
23
+ _meta: {
24
+ requiresAuth: true,
25
+ requiresProject: false,
26
+ },
27
+ }, async ({ app_id, issue_id }) => {
28
+ if (!app_id)
29
+ return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
30
+ if (!issue_id)
31
+ return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
32
+ return (0, util_1.toContent)(await (0, getIssueDetails_1.getIssueDetails)(app_id, issue_id));
33
+ });
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.get_sample_crash = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const getSampleCrash_1 = require("../../../crashlytics/getSampleCrash");
8
+ exports.get_sample_crash = (0, tool_1.tool)({
9
+ name: "get_sample_crash_for_issue",
10
+ description: "Gets the sample crash for an issue.",
11
+ inputSchema: zod_1.z.object({
12
+ app_id: zod_1.z
13
+ .string()
14
+ .describe("AppId for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
15
+ issue_id: zod_1.z
16
+ .string()
17
+ .describe("The issue Id for which the sample crash needs to be fetched. This is the value of the field `id` in the list of issues. Defaults to the first id in the list of issues."),
18
+ variant_id: zod_1.z
19
+ .string()
20
+ .optional()
21
+ .describe("The issue variant Id used as a filter to get sample issues."),
22
+ sample_count: zod_1.z
23
+ .number()
24
+ .describe("Number of samples that needs to be fetched. Maximum value is 3. Defaults to 1.")
25
+ .default(1),
26
+ }),
27
+ annotations: {
28
+ title: "Gets a sample of a crash for a specific issue.",
29
+ readOnlyHint: true,
30
+ },
31
+ _meta: {
32
+ requiresAuth: true,
33
+ requiresProject: false,
34
+ },
35
+ }, async ({ app_id, issue_id, variant_id, sample_count }) => {
36
+ if (!app_id)
37
+ return (0, util_1.mcpError)(`Must specify 'app_id' parameter.`);
38
+ if (!issue_id)
39
+ return (0, util_1.mcpError)(`Must specify 'issue_id' parameter.`);
40
+ if (sample_count > 3)
41
+ sample_count = 3;
42
+ return (0, util_1.toContent)(await (0, getSampleCrash_1.getSampleCrash)(app_id, issue_id, sample_count, variant_id));
43
+ });
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.crashlyticsTools = void 0;
4
+ const get_issue_details_1 = require("./get_issue_details");
4
5
  const list_top_issues_1 = require("./list_top_issues");
5
- exports.crashlyticsTools = [list_top_issues_1.list_top_issues];
6
+ const get_sample_crash_1 = require("./get_sample_crash");
7
+ exports.crashlyticsTools = [
8
+ list_top_issues_1.list_top_issues,
9
+ get_issue_details_1.get_issue_details,
10
+ get_sample_crash_1.get_sample_crash,
11
+ ];
@@ -16,7 +16,8 @@ exports.list_top_issues = (0, tool_1.tool)({
16
16
  issue_count: zod_1.z
17
17
  .number()
18
18
  .optional()
19
- .describe("Number of issues that needs to be fetched. Defaults to 10 if unspecified."),
19
+ .describe("Number of issues that needs to be fetched. Defaults to 10 if unspecified.")
20
+ .default(10),
20
21
  issue_type: zod_1.z
21
22
  .enum(["FATAL", "NON-FATAL", "ANR"])
22
23
  .optional()
package/lib/rtdb.js CHANGED
@@ -14,7 +14,7 @@ async function updateRules(projectId, instance, src, options = {}) {
14
14
  }
15
15
  const origin = utils.getDatabaseUrl((0, api_1.realtimeOriginOrCustomUrl)(downstreamOptions.instanceDetails.databaseUrl), instance, "");
16
16
  const client = new apiv2_1.Client({ urlPrefix: origin });
17
- return updateRulesWithClient(client, options);
17
+ return updateRulesWithClient(client, src, options);
18
18
  }
19
19
  exports.updateRules = updateRules;
20
20
  async function updateRulesWithClient(client, src, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "14.12.1",
3
+ "version": "14.13.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -279,6 +279,9 @@
279
279
  }
280
280
  ]
281
281
  },
282
+ "prefix": {
283
+ "type": "string"
284
+ },
282
285
  "runtime": {
283
286
  "enum": [
284
287
  "nodejs18",
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getExtensionRegistry = void 0;
4
- const apiv2_1 = require("../apiv2");
5
- const api_1 = require("../api");
6
- const EXTENSIONS_REGISTRY_ENDPOINT = "/extensions.json";
7
- async function getExtensionRegistry(onlyFeatured = false) {
8
- var _a;
9
- const client = new apiv2_1.Client({ urlPrefix: (0, api_1.firebaseExtensionsRegistryOrigin)() });
10
- const res = await client.get(EXTENSIONS_REGISTRY_ENDPOINT);
11
- const extensions = res.body.mods || {};
12
- if (onlyFeatured) {
13
- const featuredList = new Set(((_a = res.body.featured) === null || _a === void 0 ? void 0 : _a.discover) || []);
14
- const filteredExtensions = {};
15
- for (const [name, extension] of Object.entries(extensions)) {
16
- if (featuredList.has(name)) {
17
- filteredExtensions[name] = extension;
18
- }
19
- }
20
- return filteredExtensions;
21
- }
22
- return extensions;
23
- }
24
- exports.getExtensionRegistry = getExtensionRegistry;