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.
- package/README.md +1 -1
- package/lib/commands/dataconnect-services-list.js +5 -5
- package/lib/commands/dataconnect-sql-grant.js +5 -0
- package/lib/commands/dataconnect-sql-setup.js +1 -3
- package/lib/crashlytics/getIssueDetails.js +41 -0
- package/lib/crashlytics/getSampleCrash.js +48 -0
- package/lib/dataconnect/client.js +23 -15
- package/lib/dataconnect/ensureApis.js +5 -9
- package/lib/dataconnect/fileUtils.js +5 -6
- package/lib/dataconnect/freeTrial.js +16 -39
- package/lib/dataconnect/provisionCloudSql.js +67 -70
- package/lib/dataconnect/schemaMigration.js +75 -47
- package/lib/deploy/dataconnect/deploy.js +9 -11
- package/lib/deploy/dataconnect/prepare.js +7 -10
- package/lib/deploy/dataconnect/release.js +11 -5
- package/lib/deploy/functions/backend.js +8 -2
- package/lib/deploy/functions/build.js +23 -1
- package/lib/deploy/functions/ensure.js +1 -1
- package/lib/deploy/functions/functionsDeployHelper.js +8 -1
- package/lib/deploy/functions/prepare.js +6 -4
- package/lib/deploy/functions/pricing.js +12 -5
- package/lib/deploy/functions/release/fabricator.js +25 -3
- package/lib/emulator/controller.js +2 -1
- package/lib/emulator/downloadableEmulatorInfo.json +18 -18
- package/lib/emulator/functionsEmulator.js +9 -1
- package/lib/experiments.js +4 -0
- package/lib/extensions/extensionsHelper.js +4 -15
- package/lib/extensions/utils.js +1 -12
- package/lib/firestore/api.js +25 -11
- package/lib/firestore/pretty-print.js +7 -0
- package/lib/functional.js +7 -1
- package/lib/functions/projectConfig.js +25 -2
- package/lib/functions/secrets.js +3 -0
- package/lib/gcp/cloudfunctionsv2.js +3 -31
- package/lib/gcp/cloudscheduler.js +1 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +2 -14
- package/lib/gcp/cloudsql/connect.js +1 -1
- package/lib/gcp/cloudsql/permissionsSetup.js +13 -15
- package/lib/gcp/k8s.js +32 -0
- package/lib/gcp/runv2.js +178 -0
- package/lib/gemini/fdcExperience.js +5 -3
- package/lib/init/features/dataconnect/index.js +266 -162
- package/lib/init/features/dataconnect/sdk.js +32 -16
- package/lib/init/features/project.js +4 -0
- package/lib/management/studio.js +1 -1
- package/lib/mcp/tools/core/init.js +7 -6
- package/lib/mcp/tools/crashlytics/get_issue_details.js +33 -0
- package/lib/mcp/tools/crashlytics/get_sample_crash.js +43 -0
- package/lib/mcp/tools/crashlytics/index.js +7 -1
- package/lib/mcp/tools/crashlytics/list_top_issues.js +2 -1
- package/lib/rtdb.js +1 -1
- package/package.json +1 -1
- package/schema/firebase-config.json +3 -0
- package/lib/extensions/resolveSource.js +0 -24
package/lib/management/studio.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
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,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;
|