firebase-tools-with-isolate 15.37.0 → 15.38.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/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
package/lib/accountImporter.js
CHANGED
|
@@ -46,11 +46,15 @@ const ALLOWED_PROVIDER_IDS = [
|
|
|
46
46
|
"yahoo.com",
|
|
47
47
|
];
|
|
48
48
|
function isValidBase64(str) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
str += "=".repeat(expected.length - str.length);
|
|
49
|
+
if (typeof str !== "string") {
|
|
50
|
+
return false;
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
const normalized = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
53
|
+
const expected = Buffer.from(normalized, "base64").toString("base64");
|
|
54
|
+
const padded = normalized.length < expected.length && !normalized.endsWith("=")
|
|
55
|
+
? normalized + "=".repeat(expected.length - normalized.length)
|
|
56
|
+
: normalized;
|
|
57
|
+
return expected === padded;
|
|
54
58
|
}
|
|
55
59
|
function toWebSafeBase64(data) {
|
|
56
60
|
return data.replace(/\//g, "_").replace(/\+/g, "-");
|
package/lib/apiv2.js
CHANGED
|
@@ -4,7 +4,9 @@ exports.Client = exports.CLI_OAUTH_PROJECT_NUMBER = exports.GOOG_USER_PROJECT_HE
|
|
|
4
4
|
exports.setRefreshToken = setRefreshToken;
|
|
5
5
|
exports.setAccessToken = setAccessToken;
|
|
6
6
|
exports.getAccessToken = getAccessToken;
|
|
7
|
+
exports.bypassesProxy = bypassesProxy;
|
|
7
8
|
exports.noKeepAliveAgent = noKeepAliveAgent;
|
|
9
|
+
exports.authTransporterAgent = authTransporterAgent;
|
|
8
10
|
const url_1 = require("url");
|
|
9
11
|
const stream_1 = require("stream");
|
|
10
12
|
const undici_1 = require("undici");
|
|
@@ -64,11 +66,63 @@ function proxyURIFromEnv() {
|
|
|
64
66
|
}
|
|
65
67
|
return uri;
|
|
66
68
|
}
|
|
69
|
+
const DEFAULT_PORTS = { "http:": 80, "https:": 443 };
|
|
70
|
+
function unbracket(host) {
|
|
71
|
+
return host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
|
|
72
|
+
}
|
|
73
|
+
function bypassesProxy(url, noProxy = process.env.no_proxy ?? process.env.NO_PROXY) {
|
|
74
|
+
if (!noProxy) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const hostname = unbracket(url.hostname.toLowerCase());
|
|
78
|
+
const port = Number(url.port) || DEFAULT_PORTS[url.protocol] || 0;
|
|
79
|
+
for (const raw of noProxy.split(/[,\s]+/)) {
|
|
80
|
+
let entry = raw.trim().toLowerCase();
|
|
81
|
+
if (!entry) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (entry === "*") {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
let entryPort;
|
|
88
|
+
const bracketed = /^\[([^\]]+)\](?::(.*))?$/.exec(entry);
|
|
89
|
+
if (bracketed) {
|
|
90
|
+
entry = bracketed[1];
|
|
91
|
+
entryPort = bracketed[2];
|
|
92
|
+
}
|
|
93
|
+
else if ((entry.match(/:/g) || []).length === 1) {
|
|
94
|
+
[entry, entryPort] = entry.split(":");
|
|
95
|
+
}
|
|
96
|
+
if (entryPort !== undefined) {
|
|
97
|
+
if (!/^\d+$/.test(entryPort) || Number(entryPort) === 0) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (Number(entryPort) !== port) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
entry = entry.replace(/^\*/, "");
|
|
105
|
+
if (entry.startsWith(".") ? hostname.endsWith(entry) : hostname === entry) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
function proxyURIForURL(url) {
|
|
112
|
+
const proxyURI = proxyURIFromEnv();
|
|
113
|
+
if (!proxyURI || bypassesProxy(url)) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
return proxyURI;
|
|
117
|
+
}
|
|
67
118
|
const httpAgentNoKeepAlive = new http.Agent({ keepAlive: false });
|
|
68
119
|
const httpsAgentNoKeepAlive = new https.Agent({ keepAlive: false });
|
|
69
120
|
function noKeepAliveAgent(parsedURL) {
|
|
70
121
|
return parsedURL.protocol === "https:" ? httpsAgentNoKeepAlive : httpAgentNoKeepAlive;
|
|
71
122
|
}
|
|
123
|
+
function authTransporterAgent() {
|
|
124
|
+
return proxyURIFromEnv() ? undefined : noKeepAliveAgent;
|
|
125
|
+
}
|
|
72
126
|
function isPrematureCloseError(err) {
|
|
73
127
|
for (const candidate of [err, err?.original]) {
|
|
74
128
|
if (!candidate) {
|
|
@@ -234,12 +288,13 @@ class Client {
|
|
|
234
288
|
fetchURL += `?${queryString}`;
|
|
235
289
|
}
|
|
236
290
|
}
|
|
291
|
+
const loggedURL = options.skipLog?.queryParams ? this.requestURL(options) : fetchURL;
|
|
237
292
|
const fetchOptions = {
|
|
238
293
|
headers: options.headers,
|
|
239
294
|
method: options.method,
|
|
240
295
|
redirect: options.redirect,
|
|
241
296
|
};
|
|
242
|
-
const proxyURI =
|
|
297
|
+
const proxyURI = proxyURIForURL(new url_1.URL(fetchURL));
|
|
243
298
|
if (proxyURI) {
|
|
244
299
|
fetchOptions.dispatcher = new undici_1.ProxyAgent({ uri: proxyURI });
|
|
245
300
|
}
|
|
@@ -328,14 +383,17 @@ class Client {
|
|
|
328
383
|
: thrown instanceof Error
|
|
329
384
|
? thrown
|
|
330
385
|
: new Error(thrown);
|
|
331
|
-
|
|
386
|
+
const loggedOptions = options.skipLog?.body
|
|
387
|
+
? { ...fetchOptions, body: "[omitted]" }
|
|
388
|
+
: fetchOptions;
|
|
389
|
+
logger_1.logger.debug(`*** [apiv2] error from fetch(${loggedURL}, ${JSON.stringify(loggedOptions)}): ${err}`);
|
|
332
390
|
const isAbortError = err.name.includes("AbortError");
|
|
333
391
|
if (isAbortError) {
|
|
334
|
-
throw new error_1.FirebaseError(`Timeout reached making request to ${
|
|
392
|
+
throw new error_1.FirebaseError(`Timeout reached making request to ${loggedURL}`, {
|
|
335
393
|
original: err,
|
|
336
394
|
});
|
|
337
395
|
}
|
|
338
|
-
throw new error_1.FirebaseError(`Failed to make request to ${
|
|
396
|
+
throw new error_1.FirebaseError(`Failed to make request to ${loggedURL}`, { original: err });
|
|
339
397
|
}
|
|
340
398
|
finally {
|
|
341
399
|
if (reqTimeout) {
|
|
@@ -382,16 +440,13 @@ class Client {
|
|
|
382
440
|
}
|
|
383
441
|
}
|
|
384
442
|
catch (err) {
|
|
385
|
-
if (!disabledKeepAlive &&
|
|
386
|
-
bodyReplayable &&
|
|
387
|
-
!proxyURIFromEnv() &&
|
|
388
|
-
isPrematureCloseError(err)) {
|
|
443
|
+
if (!disabledKeepAlive && bodyReplayable && !proxyURI && isPrematureCloseError(err)) {
|
|
389
444
|
disabledKeepAlive = true;
|
|
390
445
|
fetchOptions.agent = noKeepAliveAgent;
|
|
391
446
|
const closeHeaders = new Headers(fetchOptions.headers);
|
|
392
447
|
closeHeaders.set("Connection", "close");
|
|
393
448
|
fetchOptions.headers = closeHeaders;
|
|
394
|
-
logger_1.logger.debug(`*** [apiv2] retrying ${
|
|
449
|
+
logger_1.logger.debug(`*** [apiv2] retrying ${loggedURL} without keep-alive after a premature close error`);
|
|
395
450
|
if (operation.retry(err instanceof Error ? err : new Error(`${err}`))) {
|
|
396
451
|
return;
|
|
397
452
|
}
|
|
@@ -406,13 +461,13 @@ class Client {
|
|
|
406
461
|
setAccessToken(await getAccessToken());
|
|
407
462
|
}
|
|
408
463
|
if (options.retryCodes?.includes(res.status)) {
|
|
409
|
-
const err = (0, responseToError_1.responseToError)({ statusCode: res.status }, body,
|
|
464
|
+
const err = (0, responseToError_1.responseToError)({ statusCode: res.status }, body, loggedURL) || undefined;
|
|
410
465
|
if (operation.retry(err)) {
|
|
411
466
|
return;
|
|
412
467
|
}
|
|
413
468
|
}
|
|
414
469
|
if (!options.resolveOnHTTPError) {
|
|
415
|
-
return reject((0, responseToError_1.responseToError)({ statusCode: res.status }, body,
|
|
470
|
+
return reject((0, responseToError_1.responseToError)({ statusCode: res.status }, body, loggedURL));
|
|
416
471
|
}
|
|
417
472
|
}
|
|
418
473
|
resolve({
|
package/lib/appUtils.js
CHANGED
|
@@ -19,6 +19,7 @@ var Platform;
|
|
|
19
19
|
Platform["IOS"] = "IOS";
|
|
20
20
|
Platform["FLUTTER"] = "FLUTTER";
|
|
21
21
|
Platform["ADMIN_NODE"] = "ADMIN_NODE";
|
|
22
|
+
Platform["UNITY"] = "UNITY";
|
|
22
23
|
})(Platform || (exports.Platform = Platform = {}));
|
|
23
24
|
var Framework;
|
|
24
25
|
(function (Framework) {
|
|
@@ -33,21 +34,26 @@ async function getPlatformsFromFolder(dirPath) {
|
|
|
33
34
|
return [...new Set(apps.map((app) => app.platform))];
|
|
34
35
|
}
|
|
35
36
|
async function detectApps(dirPath) {
|
|
36
|
-
const [packageJsonFiles, pubSpecYamlFiles, srcMainFolders, xCodeProjects] = await Promise.all([
|
|
37
|
+
const [packageJsonFiles, pubSpecYamlFiles, srcMainFolders, xCodeProjects, unityVersionFiles] = await Promise.all([
|
|
37
38
|
detectFiles(dirPath, "package.json"),
|
|
38
39
|
detectFiles(dirPath, "pubspec.yaml"),
|
|
39
40
|
detectFiles(dirPath, "src/main/"),
|
|
40
41
|
detectFiles(dirPath, "*.xcodeproj/"),
|
|
42
|
+
detectFiles(dirPath, "ProjectSettings/ProjectVersion.txt"),
|
|
41
43
|
]);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
+
const unityDirs = unityVersionFiles.map((f) => path.dirname(path.dirname(f)));
|
|
45
|
+
const [adminAndWebApps, flutterApps, androidAppsRaw, iosAppsRaw, unityApps] = await Promise.all([
|
|
46
|
+
Promise.all(packageJsonFiles.map((p) => packageJsonToAdminOrWebApp(dirPath, p, unityDirs))).then((r) => r.flat()),
|
|
44
47
|
Promise.all(pubSpecYamlFiles.map((f) => processFlutterDir(dirPath, f))).then((r) => r.flat()),
|
|
45
48
|
Promise.all(srcMainFolders.map((f) => processAndroidDir(dirPath, f))).then((r) => r.flat()),
|
|
46
49
|
Promise.all(xCodeProjects.map((f) => processIosDir(dirPath, f))).then((r) => r.flat()),
|
|
50
|
+
Promise.all(unityVersionFiles.map((f) => processUnityDir(dirPath, f))).then((r) => r.flat()),
|
|
47
51
|
]);
|
|
48
|
-
const androidApps = androidAppsRaw.filter((a) => !flutterApps.some((f) => isPathInside(f.directory, a.directory))
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const androidApps = androidAppsRaw.filter((a) => !flutterApps.some((f) => isPathInside(f.directory, a.directory)) &&
|
|
53
|
+
!unityApps.some((u) => isPathInside(u.directory, a.directory)));
|
|
54
|
+
const iosApps = iosAppsRaw.filter((a) => !flutterApps.some((f) => isPathInside(f.directory, a.directory)) &&
|
|
55
|
+
!unityApps.some((u) => isPathInside(u.directory, a.directory)));
|
|
56
|
+
return [...flutterApps, ...unityApps, ...androidApps, ...iosApps, ...adminAndWebApps];
|
|
51
57
|
}
|
|
52
58
|
async function processIosDir(dirPath, filePath) {
|
|
53
59
|
const iosDir = path.dirname(filePath);
|
|
@@ -89,7 +95,7 @@ async function processAndroidDir(dirPath, filePath) {
|
|
|
89
95
|
}
|
|
90
96
|
async function processFlutterDir(dirPath, filePath) {
|
|
91
97
|
const flutterDir = path.dirname(filePath);
|
|
92
|
-
const flutterAppIds = await detectAppIdsForPlatform(dirPath, Platform.FLUTTER);
|
|
98
|
+
const flutterAppIds = await detectAppIdsForPlatform(path.join(dirPath, flutterDir), Platform.FLUTTER);
|
|
93
99
|
if (flutterAppIds.length === 0) {
|
|
94
100
|
return [
|
|
95
101
|
{
|
|
@@ -98,20 +104,36 @@ async function processFlutterDir(dirPath, filePath) {
|
|
|
98
104
|
},
|
|
99
105
|
];
|
|
100
106
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
return flutterAppIds.map((app) => ({
|
|
108
|
+
platform: Platform.FLUTTER,
|
|
109
|
+
directory: flutterDir,
|
|
110
|
+
appId: app.appId,
|
|
111
|
+
bundleId: app.bundleId,
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
async function processUnityDir(dirPath, filePath) {
|
|
115
|
+
const unityDir = path.dirname(path.dirname(filePath));
|
|
116
|
+
const unityAppIds = await detectAppIdsForPlatform(path.join(dirPath, unityDir), Platform.UNITY);
|
|
117
|
+
if (unityAppIds.length === 0) {
|
|
118
|
+
return [
|
|
119
|
+
{
|
|
120
|
+
platform: Platform.UNITY,
|
|
121
|
+
directory: unityDir,
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
return unityAppIds.map((app) => ({
|
|
126
|
+
platform: Platform.UNITY,
|
|
127
|
+
directory: unityDir,
|
|
128
|
+
appId: app.appId,
|
|
129
|
+
bundleId: app.bundleId,
|
|
109
130
|
}));
|
|
110
|
-
return flutterApps.flat();
|
|
111
131
|
}
|
|
112
132
|
function isPathInside(parent, child) {
|
|
113
133
|
const relativePath = path.relative(parent, child);
|
|
114
|
-
return !relativePath.startsWith(
|
|
134
|
+
return (!relativePath.startsWith(`..${path.sep}`) &&
|
|
135
|
+
relativePath !== ".." &&
|
|
136
|
+
!path.isAbsolute(relativePath));
|
|
115
137
|
}
|
|
116
138
|
function getAllDepsFromPackageJson(packageJson) {
|
|
117
139
|
const devDependencies = Object.keys(packageJson.devDependencies ?? {});
|
|
@@ -119,8 +141,14 @@ function getAllDepsFromPackageJson(packageJson) {
|
|
|
119
141
|
const allDeps = Array.from(new Set([...devDependencies, ...dependencies]));
|
|
120
142
|
return allDeps;
|
|
121
143
|
}
|
|
122
|
-
async function packageJsonToAdminOrWebApp(dirPath, packageJsonFile) {
|
|
144
|
+
async function packageJsonToAdminOrWebApp(dirPath, packageJsonFile, unityDirs = []) {
|
|
123
145
|
try {
|
|
146
|
+
const appDir = path.dirname(packageJsonFile);
|
|
147
|
+
const isUnityPackage = unityDirs.some((uDir) => isPathInside(path.join(uDir, "Packages"), appDir));
|
|
148
|
+
if (isUnityPackage) {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
const isInsideUnity = unityDirs.some((uDir) => isPathInside(uDir, appDir));
|
|
124
152
|
const fullPath = path.join(dirPath, packageJsonFile);
|
|
125
153
|
const packageJson = JSON.parse((await fs.readFile(fullPath)).toString());
|
|
126
154
|
const allDeps = getAllDepsFromPackageJson(packageJson);
|
|
@@ -128,14 +156,17 @@ async function packageJsonToAdminOrWebApp(dirPath, packageJsonFile) {
|
|
|
128
156
|
if (allDeps.includes("firebase-admin") || allDeps.includes("firebase-functions")) {
|
|
129
157
|
detectedApps.push({
|
|
130
158
|
platform: Platform.ADMIN_NODE,
|
|
131
|
-
directory:
|
|
159
|
+
directory: appDir,
|
|
132
160
|
});
|
|
133
161
|
}
|
|
134
|
-
|
|
162
|
+
const frameworks = getFrameworksFromPackageJson(packageJson);
|
|
163
|
+
if (allDeps.includes("firebase") ||
|
|
164
|
+
(!isInsideUnity && detectedApps.length === 0) ||
|
|
165
|
+
(isInsideUnity && frameworks.length > 0)) {
|
|
135
166
|
detectedApps.push({
|
|
136
167
|
platform: Platform.WEB,
|
|
137
|
-
directory:
|
|
138
|
-
frameworks
|
|
168
|
+
directory: appDir,
|
|
169
|
+
frameworks,
|
|
139
170
|
});
|
|
140
171
|
}
|
|
141
172
|
return detectedApps;
|
|
@@ -149,30 +180,53 @@ const WEB_FRAMEWORKS_SIGNALS = {
|
|
|
149
180
|
react: ["react", "next"],
|
|
150
181
|
angular: ["@angular/core"],
|
|
151
182
|
};
|
|
183
|
+
function dedupeAppIdentifiers(identifiers) {
|
|
184
|
+
const byAppId = new Map();
|
|
185
|
+
for (const id of identifiers) {
|
|
186
|
+
const existing = byAppId.get(id.appId);
|
|
187
|
+
if (!existing || (!existing.bundleId && id.bundleId)) {
|
|
188
|
+
byAppId.set(id.appId, id);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return Array.from(byAppId.values());
|
|
192
|
+
}
|
|
193
|
+
async function extractFromFiles(dirPath, filePattern, extractFunc) {
|
|
194
|
+
const files = await detectFiles(dirPath, filePattern);
|
|
195
|
+
const allAppIds = await Promise.all(files.map(async (file) => {
|
|
196
|
+
try {
|
|
197
|
+
const fileContent = (await fs.readFile(path.join(dirPath, file))).toString();
|
|
198
|
+
return extractFunc(fileContent);
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
}));
|
|
204
|
+
return allAppIds.flat();
|
|
205
|
+
}
|
|
152
206
|
async function detectAppIdsForPlatform(dirPath, platform) {
|
|
153
|
-
let appIdFiles;
|
|
154
|
-
let extractFunc;
|
|
155
207
|
switch (platform) {
|
|
156
208
|
case Platform.ANDROID:
|
|
157
|
-
|
|
158
|
-
extractFunc = extractAppIdentifiersAndroid;
|
|
159
|
-
break;
|
|
209
|
+
return extractFromFiles(dirPath, "google-services*.json*", extractAppIdentifiersAndroid);
|
|
160
210
|
case Platform.IOS:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
return extractFromFiles(dirPath, "GoogleService-*.plist*", extractAppIdentifierIos);
|
|
212
|
+
case Platform.FLUTTER: {
|
|
213
|
+
const [dartIds, androidIds, iosIds] = await Promise.all([
|
|
214
|
+
extractFromFiles(dirPath, "firebase_options*.dart", extractAppIdentifiersFlutter),
|
|
215
|
+
extractFromFiles(dirPath, "google-services*.json*", extractAppIdentifiersAndroid),
|
|
216
|
+
extractFromFiles(dirPath, "GoogleService-*.plist*", extractAppIdentifierIos),
|
|
217
|
+
]);
|
|
218
|
+
return dedupeAppIdentifiers([...dartIds, ...androidIds, ...iosIds]);
|
|
219
|
+
}
|
|
220
|
+
case Platform.UNITY: {
|
|
221
|
+
const [androidIds, iosIds] = await Promise.all([
|
|
222
|
+
extractFromFiles(dirPath, "google-services*.json*", extractAppIdentifiersAndroid),
|
|
223
|
+
extractFromFiles(dirPath, "GoogleService-*.plist*", extractAppIdentifierIos),
|
|
224
|
+
]);
|
|
225
|
+
return dedupeAppIdentifiers([...androidIds, ...iosIds]);
|
|
226
|
+
}
|
|
168
227
|
default:
|
|
169
228
|
return [];
|
|
170
229
|
}
|
|
171
|
-
const allAppIds = await Promise.all(appIdFiles.map(async (file) => {
|
|
172
|
-
const fileContent = (await fs.readFile(path.join(dirPath, file))).toString();
|
|
173
|
-
return extractFunc(fileContent);
|
|
174
|
-
}));
|
|
175
|
-
return allAppIds.flat();
|
|
176
230
|
}
|
|
177
231
|
function getFrameworksFromPackageJson(packageJson) {
|
|
178
232
|
const allDeps = getAllDepsFromPackageJson(packageJson);
|
|
@@ -243,9 +297,18 @@ async function detectFiles(dirPath, filePattern) {
|
|
|
243
297
|
"**/out/**",
|
|
244
298
|
"**/.next/**",
|
|
245
299
|
"**/coverage/**",
|
|
300
|
+
"**/Library/**",
|
|
301
|
+
"**/Temp/**",
|
|
302
|
+
"**/Obj/**",
|
|
303
|
+
"**/Logs/**",
|
|
304
|
+
"**/UserSettings/**",
|
|
305
|
+
"**/*.meta",
|
|
306
|
+
"**/.dart_tool/**",
|
|
307
|
+
"**/Pods/**",
|
|
308
|
+
"**/.symlinks/**",
|
|
246
309
|
],
|
|
247
310
|
absolute: false,
|
|
248
|
-
maxDepth:
|
|
311
|
+
maxDepth: 8,
|
|
249
312
|
};
|
|
250
313
|
return (0, glob_1.glob)(`**/${filePattern}`, options);
|
|
251
314
|
}
|
|
@@ -60,13 +60,17 @@ class AppDistributionClient {
|
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
const queryParams = { updateMask: "release_notes.text" };
|
|
63
|
+
let response;
|
|
63
64
|
try {
|
|
64
|
-
await this.appDistroV1Client.patch(`/${releaseName}`, data, {
|
|
65
|
+
response = await this.appDistroV1Client.patch(`/${releaseName}`, data, {
|
|
66
|
+
queryParams,
|
|
67
|
+
});
|
|
65
68
|
}
|
|
66
69
|
catch (err) {
|
|
67
70
|
throw new error_1.FirebaseError(`failed to update release notes with ${(0, error_1.getErrMsg)(err)}`);
|
|
68
71
|
}
|
|
69
72
|
utils.logSuccess("added release notes successfully");
|
|
73
|
+
return response.body;
|
|
70
74
|
}
|
|
71
75
|
async distribute(releaseName, testerEmails = [], groupAliases = []) {
|
|
72
76
|
if (testerEmails.length === 0 && groupAliases.length === 0) {
|
|
@@ -40,6 +40,7 @@ exports.command = new command_1.Command("appdistribution:distribute <release-bin
|
|
|
40
40
|
.option("--test-case-ids <string>", "a comma-separated list of test case IDs.")
|
|
41
41
|
.option("--test-case-ids-file <file>", "path to file with a comma- or newline-separated list of test case IDs.")
|
|
42
42
|
.option("--results-bucket <bucket>", "The name of a Google Cloud Storage bucket where raw results of any automated tests will be stored. If this flag is not set, Firebase creates a bucket for you. Note that the bucket must be owned by a billing-enabled project, and that using a non-default bucket will result in billing charges for the storage used.")
|
|
43
|
+
.help("With --json, the result field contains the uploaded release, including its URLs and updated release notes.")
|
|
43
44
|
.before(requireAuth_1.requireAuth)
|
|
44
45
|
.action(async (file, options) => {
|
|
45
46
|
const appName = (0, options_parser_util_1.getAppName)(options);
|
|
@@ -60,7 +61,7 @@ exports.command = new command_1.Command("appdistribution:distribute <release-bin
|
|
|
60
61
|
usernameResourceName: options.testUsernameResource,
|
|
61
62
|
passwordResourceName: options.testPasswordResource,
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
return distribute(appName, distribution, testCases, testDevices, releaseNotes, testers, groups, options.testNonBlocking, loginCredential, resultsBucket);
|
|
64
65
|
});
|
|
65
66
|
async function distribute(appName, distribution, testCases, testDevices, releaseNotes, testers, groups, testNonBlocking, loginCredential, resultsBucket) {
|
|
66
67
|
const requests = new client_1.AppDistributionClient();
|
|
@@ -99,7 +100,7 @@ async function distribute(appName, distribution, testCases, testDevices, release
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
+
let release = await (0, distribution_1.upload)(requests, appName, distribution);
|
|
103
104
|
if (aabInfo && !aabInfo.testCertificate) {
|
|
104
105
|
aabInfo = await requests.getAabInfo(appName);
|
|
105
106
|
if (aabInfo.testCertificate) {
|
|
@@ -112,7 +113,7 @@ async function distribute(appName, distribution, testCases, testDevices, release
|
|
|
112
113
|
`SHA-256 certificate fingerprint: ${aabInfo.testCertificate.hashSha256}`);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
await requests.updateReleaseNotes(release.name, releaseNotes);
|
|
116
|
+
release = (await requests.updateReleaseNotes(release.name, releaseNotes)) ?? release;
|
|
116
117
|
await requests.distribute(release.name, testers, groups);
|
|
117
118
|
if (testDevices.length) {
|
|
118
119
|
utils.logBullet("starting automated test (note: this feature is in beta)");
|
|
@@ -138,4 +139,5 @@ async function distribute(appName, distribution, testCases, testDevices, release
|
|
|
138
139
|
await (0, distribution_1.awaitTestResults)(releaseTests, requests);
|
|
139
140
|
}
|
|
140
141
|
}
|
|
142
|
+
return release;
|
|
141
143
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const js_yaml_1 = require("js-yaml");
|
|
5
4
|
const command_1 = require("../command");
|
|
6
5
|
const commandUtils_1 = require("../crashlytics/commandUtils");
|
|
7
6
|
const events_1 = require("../crashlytics/events");
|
|
@@ -40,8 +39,7 @@ exports.command = new command_1.Command("crashlytics:events:get <eventIds...>")
|
|
|
40
39
|
logger_1.logger.info("No matching events found.");
|
|
41
40
|
}
|
|
42
41
|
else {
|
|
43
|
-
|
|
44
|
-
logger_1.logger.info((0, js_yaml_1.dump)(formatted, events_1.EVENT_DUMP_OPTIONS));
|
|
42
|
+
logger_1.logger.info((0, events_1.toText)(events, { maxFrames, full: Boolean(options.full) }));
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
return response;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const js_yaml_1 = require("js-yaml");
|
|
5
4
|
const command_1 = require("../command");
|
|
6
5
|
const commandUtils_1 = require("../crashlytics/commandUtils");
|
|
7
6
|
const events_1 = require("../crashlytics/events");
|
|
@@ -62,8 +61,7 @@ Custom Key Filtering (--filter):
|
|
|
62
61
|
logger_1.logger.info("No matching events found.");
|
|
63
62
|
}
|
|
64
63
|
else {
|
|
65
|
-
|
|
66
|
-
logger_1.logger.info((0, js_yaml_1.dump)(formatted, events_1.EVENT_DUMP_OPTIONS));
|
|
64
|
+
logger_1.logger.info((0, events_1.toText)(events, { maxFrames, full: Boolean(options.full) }));
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
return response;
|
|
@@ -8,7 +8,8 @@ const issues_1 = require("../crashlytics/issues");
|
|
|
8
8
|
const error_1 = require("../error");
|
|
9
9
|
const logger_1 = require("../logger");
|
|
10
10
|
const requireAuth_1 = require("../requireAuth");
|
|
11
|
-
function logIssue(issue) {
|
|
11
|
+
function logIssue(appId, issue) {
|
|
12
|
+
const sampleEventId = (0, commandUtils_1.shortEventId)(issue.sampleEvent);
|
|
12
13
|
const table = new Table({
|
|
13
14
|
head: ["Field", "Value"],
|
|
14
15
|
style: { head: ["green"] },
|
|
@@ -31,7 +32,7 @@ function logIssue(issue) {
|
|
|
31
32
|
.join(", "),
|
|
32
33
|
],
|
|
33
34
|
["Notes Count", issue.notesCount !== undefined ? String(issue.notesCount) : undefined],
|
|
34
|
-
["Sample Event",
|
|
35
|
+
["Sample Event", sampleEventId],
|
|
35
36
|
["Console URI", issue.uri],
|
|
36
37
|
];
|
|
37
38
|
for (const [label, value] of rows) {
|
|
@@ -40,6 +41,9 @@ function logIssue(issue) {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
logger_1.logger.info(table.toString());
|
|
44
|
+
if (sampleEventId) {
|
|
45
|
+
logger_1.logger.info(`Run 'firebase crashlytics:events:get --app ${appId} ${sampleEventId}' to inspect the sample event.`);
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
exports.command = new command_1.Command("crashlytics:issues:get <issueId>")
|
|
45
49
|
.description("get details for a Crashlytics issue")
|
|
@@ -55,7 +59,7 @@ exports.command = new command_1.Command("crashlytics:issues:get <issueId>")
|
|
|
55
59
|
}
|
|
56
60
|
const issue = await (0, issues_1.getIssue)(appId, trimmedIssueId);
|
|
57
61
|
if (!(await (0, commandUtils_1.writeOutputFileIfRequested)(issue, options))) {
|
|
58
|
-
logIssue(issue);
|
|
62
|
+
logIssue(appId, issue);
|
|
59
63
|
}
|
|
60
64
|
return issue;
|
|
61
65
|
});
|