firebase-tools-with-isolate 15.37.0 → 15.38.1
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/accountImporter.js +8 -4
- package/lib/apiv2.js +66 -11
- package/lib/appUtils.js +103 -40
- package/lib/appdistribution/client.js +5 -1
- package/lib/commands/appdistribution-distribute.js +5 -3
- package/lib/commands/crashlytics-events-get.js +1 -3
- package/lib/commands/crashlytics-events-list.js +1 -3
- package/lib/commands/crashlytics-issues-get.js +7 -3
- package/lib/commands/crashlytics-reports-get.js +103 -15
- package/lib/crashlytics/commandUtils.js +39 -6
- package/lib/crashlytics/events.js +63 -65
- package/lib/deploy/firestore/prepare.js +2 -14
- package/lib/deploy/functions/runtimes/python/index.js +3 -0
- package/lib/deploy/functions/runtimes/supported/types.js +6 -0
- package/lib/deploy/run/deploy.js +40 -35
- package/lib/deploy/run/prereqs.js +0 -3
- package/lib/downloadUtils.js +2 -1
- package/lib/emulator/download.js +1 -0
- package/lib/emulator/downloadableEmulatorInfo.json +24 -24
- package/lib/emulator/downloadableEmulators.js +14 -2
- package/lib/emulator/events/types.js +0 -6
- package/lib/emulator/storage/cloudFunctions.js +0 -1
- package/lib/emulator/storage/rules/runtime.js +0 -3
- package/lib/emulator/taskQueue.js +0 -12
- package/lib/experiments.js +5 -0
- package/lib/extensions/extensionsHelper.js +1 -4
- package/lib/extensions/replacements.json +2 -1
- package/lib/firestore/fsConfig.js +100 -41
- package/lib/frameworks/next/index.js +1 -23
- package/lib/gcp/runv2.js +0 -27
- package/lib/gcp/secretManager.js +2 -2
- package/lib/hosting/api.js +29 -16
- package/lib/init/features/dataconnect/sdk.js +15 -5
- package/lib/management/apps.js +7 -0
- package/lib/mcp/index.js +4 -2
- package/lib/mcp/tools/core/get_environment.js +1 -1
- package/lib/mcp/tools/crashlytics/events.js +2 -5
- package/lib/mcp/tools/crashlytics/reports.js +3 -12
- package/lib/mcp/util/apptesting/availability.js +3 -2
- package/lib/mcp/util/crashlytics/availability.js +59 -12
- package/lib/mcp/util.js +4 -0
- package/lib/requireAuth.js +11 -7
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/schema/firebase-config.json +6 -3
- package/standalone/package.json +6 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.batch_get_events = exports.list_events = void 0;
|
|
4
|
-
const js_yaml_1 = require("js-yaml");
|
|
5
4
|
const zod_1 = require("zod");
|
|
6
5
|
const events_1 = require("../../../crashlytics/events");
|
|
7
6
|
const filters_1 = require("../../../crashlytics/filters");
|
|
@@ -54,9 +53,8 @@ exports.list_events = (0, tool_1.tool)("crashlytics", {
|
|
|
54
53
|
return result;
|
|
55
54
|
}
|
|
56
55
|
const response = await (0, events_1.listEvents)(appId, filter, pageSize, filterExpression);
|
|
57
|
-
const eventsContent = response.events?.map((e) => (0, events_1.toText)(e)) || [];
|
|
58
56
|
return {
|
|
59
|
-
content: [{ type: "text", text: (0,
|
|
57
|
+
content: [{ type: "text", text: (0, events_1.toText)(response.events || []) }],
|
|
60
58
|
};
|
|
61
59
|
});
|
|
62
60
|
exports.batch_get_events = (0, tool_1.tool)("crashlytics", {
|
|
@@ -96,8 +94,7 @@ exports.batch_get_events = (0, tool_1.tool)("crashlytics", {
|
|
|
96
94
|
return result;
|
|
97
95
|
}
|
|
98
96
|
const response = await (0, events_1.batchGetEvents)(appId, names);
|
|
99
|
-
const eventsContent = response.events?.map((e) => (0, events_1.toText)(e)) || [];
|
|
100
97
|
return {
|
|
101
|
-
content: [{ type: "text", text: (0,
|
|
98
|
+
content: [{ type: "text", text: (0, events_1.toText)(response.events || []) }],
|
|
102
99
|
};
|
|
103
100
|
});
|
|
@@ -8,17 +8,8 @@ const tool_1 = require("../../tool");
|
|
|
8
8
|
const app_id_1 = require("../../resources/guides/app_id");
|
|
9
9
|
const DUMP_OPTIONS = { lineWidth: 200 };
|
|
10
10
|
function toText(response, filters) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
filters: (0, js_yaml_1.dump)(filters, DUMP_OPTIONS),
|
|
14
|
-
};
|
|
15
|
-
for (const [key, value] of Object.entries(response)) {
|
|
16
|
-
if (key === "name") {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
result[key] = (0, js_yaml_1.dump)(value, DUMP_OPTIONS);
|
|
20
|
-
}
|
|
21
|
-
return result;
|
|
11
|
+
const { name, ...rest } = response;
|
|
12
|
+
return (0, js_yaml_1.dump)({ name: name || "", filters, ...rest }, DUMP_OPTIONS);
|
|
22
13
|
}
|
|
23
14
|
exports.get_report = (0, tool_1.tool)("crashlytics", {
|
|
24
15
|
name: "get_report",
|
|
@@ -61,7 +52,7 @@ exports.get_report = (0, tool_1.tool)("crashlytics", {
|
|
|
61
52
|
content: [
|
|
62
53
|
{
|
|
63
54
|
type: "text",
|
|
64
|
-
text:
|
|
55
|
+
text: toText(reportResponse, filter),
|
|
65
56
|
},
|
|
66
57
|
],
|
|
67
58
|
};
|
|
@@ -5,11 +5,12 @@ const api_1 = require("../../../api");
|
|
|
5
5
|
const appUtils_1 = require("../../../appUtils");
|
|
6
6
|
const ensureApiEnabled_1 = require("../../../ensureApiEnabled");
|
|
7
7
|
const timeout_1 = require("../../../timeout");
|
|
8
|
+
const util_1 = require("../../util");
|
|
8
9
|
async function isAppTestingAvailable(ctx) {
|
|
9
10
|
const host = ctx.host;
|
|
10
|
-
const projectDir = ctx
|
|
11
|
+
const projectDir = (0, util_1.getProjectDir)(ctx);
|
|
11
12
|
const platforms = await (0, appUtils_1.getPlatformsFromFolder)(projectDir);
|
|
12
|
-
const supportedPlatforms = [appUtils_1.Platform.FLUTTER, appUtils_1.Platform.ANDROID, appUtils_1.Platform.IOS];
|
|
13
|
+
const supportedPlatforms = [appUtils_1.Platform.FLUTTER, appUtils_1.Platform.ANDROID, appUtils_1.Platform.IOS, appUtils_1.Platform.UNITY];
|
|
13
14
|
if (!platforms.some((p) => supportedPlatforms.includes(p))) {
|
|
14
15
|
host.logger.debug("Found no supported App Testing platforms.");
|
|
15
16
|
return false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isCrashlyticsAvailable = isCrashlyticsAvailable;
|
|
4
|
+
const util_1 = require("../../util");
|
|
4
5
|
const appUtils_1 = require("../../../appUtils");
|
|
5
6
|
const fs = require("fs-extra");
|
|
6
7
|
const path = require("path");
|
|
@@ -9,13 +10,15 @@ async function isCrashlyticsAvailable(ctx) {
|
|
|
9
10
|
ctx.host.logger.debug("Looking for whether crashlytics is installed...");
|
|
10
11
|
return await isCrashlyticsInstalled(ctx);
|
|
11
12
|
}
|
|
13
|
+
const CRASHLYTICS_GRADLE_PATTERN = /(firebase-crashlytics|firebase\.crashlytics|com\.google\.firebase\.crashlytics)/;
|
|
12
14
|
async function isCrashlyticsInstalled(ctx) {
|
|
13
15
|
const host = ctx.host;
|
|
14
|
-
const projectDir = ctx
|
|
16
|
+
const projectDir = (0, util_1.getProjectDir)(ctx);
|
|
15
17
|
const platforms = await (0, appUtils_1.getPlatformsFromFolder)(projectDir);
|
|
16
18
|
if (!platforms.includes(appUtils_1.Platform.FLUTTER) &&
|
|
17
19
|
!platforms.includes(appUtils_1.Platform.ANDROID) &&
|
|
18
20
|
!platforms.includes(appUtils_1.Platform.IOS) &&
|
|
21
|
+
!platforms.includes(appUtils_1.Platform.UNITY) &&
|
|
19
22
|
!platforms.includes(appUtils_1.Platform.WEB)) {
|
|
20
23
|
host.logger.debug("Found no supported Crashlytics platforms.");
|
|
21
24
|
return false;
|
|
@@ -24,6 +27,10 @@ async function isCrashlyticsInstalled(ctx) {
|
|
|
24
27
|
host.logger.debug("Found Flutter app using Crashlytics");
|
|
25
28
|
return true;
|
|
26
29
|
}
|
|
30
|
+
if (platforms.includes(appUtils_1.Platform.UNITY) && (await unityAppUsesCrashlytics(projectDir))) {
|
|
31
|
+
host.logger.debug("Found Unity app using Crashlytics");
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
27
34
|
if (platforms.includes(appUtils_1.Platform.ANDROID) && (await androidAppUsesCrashlytics(projectDir))) {
|
|
28
35
|
host.logger.debug("Found Android app using Crashlytics");
|
|
29
36
|
return true;
|
|
@@ -42,11 +49,14 @@ async function isCrashlyticsInstalled(ctx) {
|
|
|
42
49
|
}
|
|
43
50
|
async function androidAppUsesCrashlytics(appPath) {
|
|
44
51
|
const buildGradleFiles = await (0, appUtils_1.detectFiles)(appPath, "build.gradle*");
|
|
45
|
-
const crashlyticsPattern = /(firebase-crashlytics|firebase\.crashlytics|com\.google\.firebase\.crashlytics)/;
|
|
46
52
|
for (const file of buildGradleFiles) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
try {
|
|
54
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
55
|
+
if (CRASHLYTICS_GRADLE_PATTERN.test(content)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
50
60
|
}
|
|
51
61
|
}
|
|
52
62
|
return false;
|
|
@@ -56,19 +66,56 @@ async function iosAppUsesCrashlytics(appPath) {
|
|
|
56
66
|
const fileArrays = await Promise.all(filePatternsToDetect.map((term) => (0, appUtils_1.detectFiles)(appPath, term)));
|
|
57
67
|
const files = fileArrays.flat();
|
|
58
68
|
for (const file of files) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
try {
|
|
70
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
71
|
+
if (content.includes("Crashlytics")) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
62
76
|
}
|
|
63
77
|
}
|
|
64
78
|
return false;
|
|
65
79
|
}
|
|
66
80
|
async function flutterAppUsesCrashlytics(appPath) {
|
|
67
|
-
const pubspecFiles = await (0, appUtils_1.detectFiles)(appPath, "pubspec.yaml");
|
|
81
|
+
const pubspecFiles = await (0, appUtils_1.detectFiles)(appPath, "pubspec.{yaml,lock}");
|
|
68
82
|
for (const file of pubspecFiles) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
try {
|
|
84
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
85
|
+
if (content.includes("firebase_crashlytics")) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
async function unityAppUsesCrashlytics(appPath) {
|
|
95
|
+
const upmFiles = await (0, appUtils_1.detectFiles)(appPath, "Packages/{manifest.json,packages-lock.json}");
|
|
96
|
+
for (const file of upmFiles) {
|
|
97
|
+
try {
|
|
98
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
99
|
+
if (content.includes("com.google.firebase.crashlytics")) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const sdkFiles = await (0, appUtils_1.detectFiles)(appPath, "{*CrashlyticsDependencies.xml,GoogleDependency*Crashlytics*.xml,Firebase.Crashlytics.dll,com.google.firebase.crashlytics*.tgz}");
|
|
107
|
+
if (sdkFiles.length > 0) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const gradleFiles = await (0, appUtils_1.detectFiles)(appPath, "*.gradle*");
|
|
111
|
+
for (const file of gradleFiles) {
|
|
112
|
+
try {
|
|
113
|
+
const content = await fs.readFile(path.join(appPath, file), "utf8");
|
|
114
|
+
if (CRASHLYTICS_GRADLE_PATTERN.test(content)) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
72
119
|
}
|
|
73
120
|
}
|
|
74
121
|
return false;
|
package/lib/mcp/util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectDir = getProjectDir;
|
|
3
4
|
exports.toContent = toContent;
|
|
4
5
|
exports.applyAppMeta = applyAppMeta;
|
|
5
6
|
exports.mcpError = mcpError;
|
|
@@ -10,6 +11,9 @@ const experiments = require("../experiments");
|
|
|
10
11
|
const api_1 = require("../api");
|
|
11
12
|
const ensureApiEnabled_1 = require("../ensureApiEnabled");
|
|
12
13
|
const timeout_1 = require("../timeout");
|
|
14
|
+
function getProjectDir(ctx) {
|
|
15
|
+
return (ctx.config.projectDir || ctx.host.cachedProjectDir || ctx.host.startupRoot || process.cwd());
|
|
16
|
+
}
|
|
13
17
|
function toContent(data, options) {
|
|
14
18
|
if (typeof data === "string")
|
|
15
19
|
return { content: [{ type: "text", text: data }] };
|
package/lib/requireAuth.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authClientOptions = authClientOptions;
|
|
3
4
|
exports.refreshAuth = refreshAuth;
|
|
4
5
|
exports.requireAuth = requireAuth;
|
|
5
6
|
const google_auth_library_1 = require("google-auth-library");
|
|
@@ -16,21 +17,24 @@ const timeout_1 = require("./timeout");
|
|
|
16
17
|
const AUTH_ERROR_MESSAGE = `Command requires authentication, please run ${clc.bold("firebase login")}`;
|
|
17
18
|
let authClient;
|
|
18
19
|
let lastOptions;
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
const authConfig = {
|
|
20
|
+
function authClientOptions(config) {
|
|
21
|
+
const agent = apiv2.authTransporterAgent();
|
|
22
|
+
return {
|
|
24
23
|
...config,
|
|
25
24
|
clientOptions: {
|
|
26
25
|
...config.clientOptions,
|
|
27
26
|
transporterOptions: {
|
|
28
27
|
...config.clientOptions?.transporterOptions,
|
|
29
|
-
agent:
|
|
28
|
+
...(agent !== undefined ? { agent } : {}),
|
|
30
29
|
},
|
|
31
30
|
},
|
|
32
31
|
};
|
|
33
|
-
|
|
32
|
+
}
|
|
33
|
+
function getAuthClient(config) {
|
|
34
|
+
if (authClient) {
|
|
35
|
+
return authClient;
|
|
36
|
+
}
|
|
37
|
+
authClient = new google_auth_library_1.GoogleAuth(authClientOptions(config));
|
|
34
38
|
return authClient;
|
|
35
39
|
}
|
|
36
40
|
async function autoAuth(options, authScopes) {
|