firebase-tools 15.26.0 → 15.27.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/lib/appcheck/api.js +19 -0
- package/lib/appcheck/providers.js +240 -0
- package/lib/commands/appcheck-apps-list.js +78 -0
- package/lib/commands/appcheck-debugtokens-create.js +2 -2
- package/lib/commands/appcheck-debugtokens-delete.js +2 -2
- package/lib/commands/appcheck-debugtokens-list.js +2 -2
- package/lib/commands/appcheck-prompts.js +55 -0
- package/lib/commands/appcheck-providers-get.js +73 -0
- package/lib/commands/appcheck-providers-list.js +67 -0
- package/lib/commands/appcheck-providers-set.js +96 -0
- package/lib/commands/ext-export.js +75 -3
- package/lib/commands/functions-kits-install.js +294 -0
- package/lib/commands/index.js +10 -0
- package/lib/crashlytics/filters.js +12 -4
- package/lib/crashlytics/reports.js +2 -0
- package/lib/crashlytics/types.js +8 -1
- package/lib/deploy/functions/backend.js +11 -1
- package/lib/deploy/functions/build.js +1 -1
- package/lib/deploy/functions/params.js +5 -1
- package/lib/deploy/functions/prepare.js +26 -13
- package/lib/deploy/functions/prompts.js +1 -1
- package/lib/deploy/functions/release/lifecycle.js +11 -0
- package/lib/deploy/functions/release/planner.js +5 -2
- package/lib/emulator/controller.js +1 -0
- package/lib/emulator/functionsEmulator.js +3 -1
- package/lib/experiments.js +11 -5
- package/lib/extensions/export.js +47 -0
- package/lib/functions/env.js +20 -7
- package/lib/functions/projectConfig.js +19 -11
- package/lib/functions/python.js +1 -1
- package/lib/gcp/runv2.js +1 -0
- package/lib/mcp/onemcp/index.js +2 -1
- package/lib/mcp/onemcp/onemcp_server.js +38 -11
- package/lib/mcp/prompts/crashlytics/connect.js +1 -1
- package/lib/mcp/resources/guides/crashlytics_issues.js +3 -3
- package/lib/mcp/resources/guides/crashlytics_reports.js +32 -11
- package/lib/mcp/tool.js +5 -0
- package/lib/mcp/tools/crashlytics/notes.js +3 -3
- package/lib/mcp/tools/crashlytics/reports.js +2 -0
- package/lib/mcp/util/crashlytics/availability.js +54 -1
- package/lib/serve/functions.js +1 -1
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/schema/firebase-config.json +3 -3
- package/templates/init/functions/typescript/index-kit-migration.ts +49 -0
- package/templates/init/functions/typescript/index-kit.ts +35 -0
- package/lib/appcheck/prompts.js +0 -41
|
@@ -8,7 +8,7 @@ const filters_1 = require("../../../crashlytics/filters");
|
|
|
8
8
|
const util_1 = require("../../util");
|
|
9
9
|
exports.create_note = (0, tool_1.tool)("crashlytics", {
|
|
10
10
|
name: "create_note",
|
|
11
|
-
description: "Add a note to an issue from crashlytics.",
|
|
11
|
+
description: "Add a note to an issue from crashlytics. Only supported for mobile (Android and iOS) apps.",
|
|
12
12
|
inputSchema: zod_1.z.object({
|
|
13
13
|
appId: filters_1.ApplicationIdSchema,
|
|
14
14
|
issueId: filters_1.IssueIdSchema,
|
|
@@ -32,7 +32,7 @@ exports.create_note = (0, tool_1.tool)("crashlytics", {
|
|
|
32
32
|
});
|
|
33
33
|
exports.list_notes = (0, tool_1.tool)("crashlytics", {
|
|
34
34
|
name: "list_notes",
|
|
35
|
-
description: "Use this to list all notes for an issue in Crashlytics.",
|
|
35
|
+
description: "Use this to list all notes for an issue in Crashlytics. Only supported for mobile (Android and iOS) apps.",
|
|
36
36
|
inputSchema: zod_1.z.object({
|
|
37
37
|
appId: filters_1.ApplicationIdSchema,
|
|
38
38
|
issueId: filters_1.IssueIdSchema,
|
|
@@ -54,7 +54,7 @@ exports.list_notes = (0, tool_1.tool)("crashlytics", {
|
|
|
54
54
|
});
|
|
55
55
|
exports.delete_note = (0, tool_1.tool)("crashlytics", {
|
|
56
56
|
name: "delete_note",
|
|
57
|
-
description: "Delete a note from a Crashlytics issue.",
|
|
57
|
+
description: "Delete a note from a Crashlytics issue. Only supported for mobile (Android and iOS) apps.",
|
|
58
58
|
inputSchema: zod_1.z.object({
|
|
59
59
|
appId: filters_1.ApplicationIdSchema,
|
|
60
60
|
issueId: filters_1.IssueIdSchema,
|
|
@@ -15,6 +15,8 @@ Must specify the desired report:
|
|
|
15
15
|
* TOP_OPERATING_SYSTEMS - metrics grouped by *operating system*
|
|
16
16
|
* TOP_ANDROID_DEVICES - metrics grouped by *device*
|
|
17
17
|
* TOP_APPLE_DEVICES - metrics grouped by *device*
|
|
18
|
+
* TOP_BROWSERS - metrics grouped by *browser*
|
|
19
|
+
* WEB_METRICS - metrics by *error type*
|
|
18
20
|
`.trim();
|
|
19
21
|
function toText(response, filters) {
|
|
20
22
|
const result = {
|
|
@@ -4,6 +4,7 @@ exports.isCrashlyticsAvailable = isCrashlyticsAvailable;
|
|
|
4
4
|
const appUtils_1 = require("../../../appUtils");
|
|
5
5
|
const fs = require("fs-extra");
|
|
6
6
|
const path = require("path");
|
|
7
|
+
const apiv2_1 = require("../../../apiv2");
|
|
7
8
|
async function isCrashlyticsAvailable(ctx) {
|
|
8
9
|
ctx.host.logger.debug("Looking for whether crashlytics is installed...");
|
|
9
10
|
return await isCrashlyticsInstalled(ctx);
|
|
@@ -14,7 +15,8 @@ async function isCrashlyticsInstalled(ctx) {
|
|
|
14
15
|
const platforms = await (0, appUtils_1.getPlatformsFromFolder)(projectDir);
|
|
15
16
|
if (!platforms.includes(appUtils_1.Platform.FLUTTER) &&
|
|
16
17
|
!platforms.includes(appUtils_1.Platform.ANDROID) &&
|
|
17
|
-
!platforms.includes(appUtils_1.Platform.IOS)
|
|
18
|
+
!platforms.includes(appUtils_1.Platform.IOS) &&
|
|
19
|
+
!platforms.includes(appUtils_1.Platform.WEB)) {
|
|
18
20
|
host.logger.debug("Found no supported Crashlytics platforms.");
|
|
19
21
|
return false;
|
|
20
22
|
}
|
|
@@ -30,6 +32,11 @@ async function isCrashlyticsInstalled(ctx) {
|
|
|
30
32
|
host.logger.debug("Found iOS app using Crashlytics");
|
|
31
33
|
return true;
|
|
32
34
|
}
|
|
35
|
+
if (platforms.includes(appUtils_1.Platform.WEB) &&
|
|
36
|
+
(await webAppUsesCrashlytics(projectDir, ctx.projectId))) {
|
|
37
|
+
host.logger.debug("Found Web app using Crashlytics");
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
33
40
|
host.logger.debug(`Found supported platforms ${JSON.stringify(platforms)}, but did not find a Crashlytics dependency.`);
|
|
34
41
|
return false;
|
|
35
42
|
}
|
|
@@ -66,3 +73,49 @@ async function flutterAppUsesCrashlytics(appPath) {
|
|
|
66
73
|
}
|
|
67
74
|
return false;
|
|
68
75
|
}
|
|
76
|
+
async function webAppUsesCrashlytics(appPath, projectId) {
|
|
77
|
+
if (!projectId) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const client = new apiv2_1.Client({
|
|
81
|
+
urlPrefix: "https://firebasetelemetryadmin.googleapis.com",
|
|
82
|
+
auth: true,
|
|
83
|
+
apiVersion: "v1alpha",
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
const res = await client.get(`projects/${projectId}/locations/global/configs`);
|
|
87
|
+
const configs = res.body?.configs || [];
|
|
88
|
+
const appIdsInPath = await getAppIdsFromAppPath(appPath);
|
|
89
|
+
for (const config of configs) {
|
|
90
|
+
if (config.appId && appIdsInPath.has(config.appId)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
async function getAppIdsFromAppPath(appPath) {
|
|
100
|
+
const appIds = new Set();
|
|
101
|
+
try {
|
|
102
|
+
const files = await (0, appUtils_1.detectFiles)(appPath, "*");
|
|
103
|
+
const appIdRegex = /1:\d+:[a-z0-9_-]+:[a-z0-9_-]+/gi;
|
|
104
|
+
for (const file of files) {
|
|
105
|
+
try {
|
|
106
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
107
|
+
const matches = content.match(appIdRegex);
|
|
108
|
+
if (matches) {
|
|
109
|
+
for (const match of matches) {
|
|
110
|
+
appIds.add(match);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
}
|
|
120
|
+
return appIds;
|
|
121
|
+
}
|
package/lib/serve/functions.js
CHANGED