firebase-tools-with-isolate 15.35.0 → 15.37.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/accountExporter.js +1 -1
- package/lib/accountImporter.js +7 -6
- package/lib/apiv2.js +0 -1
- package/lib/appcheck/debugTokens.js +293 -0
- package/lib/appcheck/localConfig.js +191 -0
- package/lib/appdistribution/options-parser-util.js +1 -1
- package/lib/apphosting/githubConnections.js +1 -1
- package/lib/apptesting/parseTestFiles.js +1 -1
- package/lib/auth.js +9 -3
- package/lib/bin/progressiveHelp.js +1 -1
- package/lib/command.js +1 -2
- package/lib/commands/appcheck-debugtokens-create.js +60 -35
- package/lib/commands/appcheck-debugtokens-delete.js +21 -7
- package/lib/commands/appcheck-debugtokens-list.js +37 -8
- package/lib/commands/appcheck-debugtokens-prune.js +59 -0
- package/lib/commands/crashlytics-events-get.js +48 -0
- package/lib/commands/crashlytics-events-list.js +70 -0
- package/lib/commands/crashlytics-heapdumps-enable.js +3 -4
- package/lib/commands/crashlytics-heapdumps-status.js +5 -3
- package/lib/commands/crashlytics-issues-get.js +61 -0
- package/lib/commands/crashlytics-reports-get.js +179 -0
- package/lib/commands/crashlytics-reports-list.js +42 -0
- package/lib/commands/dataconnect-services-list.js +8 -2
- package/lib/commands/deploy.js +1 -3
- package/lib/commands/ext-dev-init.js +1 -1
- package/lib/commands/hosting-channel-create.js +1 -3
- package/lib/commands/hosting-channel-delete.js +1 -3
- package/lib/commands/hosting-channel-deploy.js +1 -3
- package/lib/commands/hosting-channel-list.js +1 -3
- package/lib/commands/hosting-channel-open.js +5 -4
- package/lib/commands/hosting-clone.js +3 -5
- package/lib/commands/hosting-disable.js +2 -2
- package/lib/commands/hosting-sites-create.js +1 -3
- package/lib/commands/hosting-sites-delete.js +1 -3
- package/lib/commands/hosting-sites-get.js +1 -3
- package/lib/commands/hosting-sites-list.js +1 -3
- package/lib/commands/index.js +11 -0
- package/lib/commands/open.js +3 -1
- package/lib/commands/serve.js +1 -1
- package/lib/commands/use.js +1 -1
- package/lib/config.js +1 -1
- package/lib/crashlytics/commandUtils.js +194 -0
- package/lib/crashlytics/events.js +122 -1
- package/lib/crashlytics/filters.js +12 -6
- package/lib/crashlytics/profilingManager.js +77 -50
- package/lib/crashlytics/reports.js +5 -1
- package/lib/crashlytics/utils.js +14 -0
- package/lib/database/import.js +5 -4
- package/lib/dataconnect/client.js +14 -8
- package/lib/dataconnect/names.js +3 -3
- package/lib/dataconnect/schemaMigration.js +1 -1
- package/lib/deploy/dataconnect/release.js +2 -2
- package/lib/deploy/firestore/prepare.js +21 -3
- package/lib/deploy/functions/backend.js +0 -10
- package/lib/deploy/functions/cel.js +2 -2
- package/lib/deploy/functions/deploy.js +2 -1
- package/lib/deploy/functions/prepare.js +28 -0
- package/lib/deploy/functions/release/fabricator.js +27 -3
- package/lib/deploy/functions/release/planner.js +3 -0
- package/lib/deploy/functions/release/reporter.js +0 -26
- package/lib/deploy/functions/runtimes/discovery/index.js +4 -1
- package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +1 -1
- package/lib/deploy/functions/runtimes/supported/index.js +10 -4
- package/lib/deploy/functions/runtimes/supported/types.js +7 -1
- package/lib/deploy/functions/services/index.js +13 -11
- package/lib/deploy/hosting/prepare.js +1 -3
- package/lib/deploy/lifecycleHooks.js +1 -1
- package/lib/emulator/auth/operations.js +2 -2
- package/lib/emulator/auth/server.js +4 -2
- package/lib/emulator/auth/widget_ui.js +1 -1
- package/lib/emulator/commandUtils.js +4 -1
- package/lib/emulator/databaseEmulator.js +16 -11
- package/lib/emulator/dataconnect/pgliteServer.js +30 -24
- package/lib/emulator/downloadableEmulatorInfo.json +31 -31
- package/lib/emulator/downloadableEmulators.js +2 -2
- package/lib/emulator/extensions/postinstall.js +6 -6
- package/lib/emulator/firestoreEmulator.js +21 -15
- package/lib/emulator/functionsEmulator.js +84 -8
- package/lib/emulator/functionsEmulatorRuntime.js +9 -4
- package/lib/emulator/hub.js +12 -8
- package/lib/emulator/shared/express.js +30 -0
- package/lib/emulator/storage/apis/firebase.js +11 -10
- package/lib/emulator/storage/apis/gcloud.js +21 -20
- package/lib/emulator/storage/files.js +1 -1
- package/lib/emulator/storage/rules/manager.js +15 -12
- package/lib/emulator/storage/server.js +10 -5
- package/lib/experiments.js +5 -0
- package/lib/extensions/extensionsHelper.js +2 -2
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/paramHelper.js +1 -1
- package/lib/extensions/provisioningHelper.js +1 -6
- package/lib/firestore/delete.js +2 -3
- package/lib/firestore/util.js +3 -3
- package/lib/frameworks/angular/utils.js +1 -1
- package/lib/frameworks/next/constants.js +17 -14
- package/lib/frameworks/next/index.js +25 -3
- package/lib/frameworks/next/utils.js +7 -9
- package/lib/functions/kits/install.js +221 -316
- package/lib/functions/kits/sources/directory.js +32 -0
- package/lib/functions/kits/sources/npm.js +55 -5
- package/lib/functionsConfig.js +0 -4
- package/lib/functionsShellCommandAction.js +1 -1
- package/lib/gcp/cloudbilling.js +2 -2
- package/lib/gcp/cloudbuild.js +0 -77
- package/lib/gcp/cloudfunctionsv2.js +0 -6
- package/lib/gcp/cloudscheduler.js +12 -0
- package/lib/gcp/cloudtasks.js +0 -4
- package/lib/gcp/devConnect.js +2 -8
- package/lib/gcp/iam.js +15 -1
- package/lib/gcp/resourceManager.js +1 -14
- package/lib/gcp/storage.js +87 -4
- package/lib/hosting/api.js +79 -7
- package/lib/hosting/implicitInit.js +1 -1
- package/lib/hosting/proxy.js +5 -2
- package/lib/init/features/firestore/rules.js +1 -1
- package/lib/init/features/functions/index.js +2 -2
- package/lib/init/features/functions/npm-dependencies.js +1 -1
- package/lib/init/features/hosting/github.js +6 -4
- package/lib/init/features/hosting/index.js +4 -0
- package/lib/init/features/storage/rules.js +1 -1
- package/lib/localFunction.js +3 -3
- package/lib/management/database.js +1 -1
- package/lib/mcp/apps/init/mcp-app.js +5 -2
- package/lib/mcp/apps/update_environment/mcp-app.js +1 -1
- package/lib/mcp/index.js +14 -4
- package/lib/mcp/prompts/apptesting/run_test.js +3 -3
- package/lib/mcp/prompts/core/deploy.js +3 -3
- package/lib/mcp/resources/guides/init_ai.js +10 -10
- package/lib/mcp/tools/crashlytics/events.js +18 -93
- package/lib/mcp/tools/crashlytics/index.js +2 -0
- package/lib/mcp/tools/crashlytics/reports.js +3 -3
- package/lib/mcp/tools/crashlytics/setup.js +392 -0
- package/lib/mcp/util/dataconnect/converter.js +1 -1
- package/lib/profileReport.js +1 -1
- package/lib/profiler.js +1 -1
- package/lib/rulesDeploy.js +0 -1
- package/lib/throttler/throttler.js +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/utils.js +5 -11
- package/package.json +16 -14
- package/schema/firebase-config.json +3 -0
- package/lib/functions/kits/sources/index.js +0 -19
package/lib/hosting/api.js
CHANGED
|
@@ -16,7 +16,6 @@ exports.listSites = listSites;
|
|
|
16
16
|
exports.listDemoSites = listDemoSites;
|
|
17
17
|
exports.getSite = getSite;
|
|
18
18
|
exports.createSite = createSite;
|
|
19
|
-
exports.updateSite = updateSite;
|
|
20
19
|
exports.deleteSite = deleteSite;
|
|
21
20
|
exports.addAuthDomains = addAuthDomains;
|
|
22
21
|
exports.removeAuthDomain = removeAuthDomain;
|
|
@@ -25,13 +24,19 @@ exports.cleanAuthState = cleanAuthState;
|
|
|
25
24
|
exports.getSiteDomains = getSiteDomains;
|
|
26
25
|
exports.getAllSiteDomains = getAllSiteDomains;
|
|
27
26
|
exports.getDeploymentDomain = getDeploymentDomain;
|
|
27
|
+
exports.resetEnsureApiEnabledCacheForTests = resetEnsureApiEnabledCacheForTests;
|
|
28
|
+
exports.ensureApiEnabled = ensureApiEnabled;
|
|
29
|
+
const clc = require("colorette");
|
|
28
30
|
const error_1 = require("../error");
|
|
29
31
|
const api_1 = require("../api");
|
|
30
32
|
const apiv2_1 = require("../apiv2");
|
|
33
|
+
const ensureApiEnabledModule = require("../ensureApiEnabled");
|
|
34
|
+
const logger_1 = require("../logger");
|
|
31
35
|
const operationPoller = require("../operation-poller");
|
|
32
36
|
const expireUtils_1 = require("../hosting/expireUtils");
|
|
33
37
|
const auth_1 = require("../gcp/auth");
|
|
34
38
|
const proto = require("../gcp/proto");
|
|
39
|
+
const utils = require("../utils");
|
|
35
40
|
const utils_1 = require("../utils");
|
|
36
41
|
const constants_1 = require("../emulator/constants");
|
|
37
42
|
const ONE_WEEK_MS = 604800000;
|
|
@@ -202,12 +207,6 @@ async function createSite(project, site, appId = "", validateOnly = false) {
|
|
|
202
207
|
const res = await apiClient.post(`/projects/${project}/sites`, { appId: appId }, { queryParams });
|
|
203
208
|
return res.body;
|
|
204
209
|
}
|
|
205
|
-
async function updateSite(project, site, fields) {
|
|
206
|
-
const res = await apiClient.patch(`/projects/${project}/sites/${site.name}`, site, {
|
|
207
|
-
queryParams: { updateMask: fields.join(",") },
|
|
208
|
-
});
|
|
209
|
-
return res.body;
|
|
210
|
-
}
|
|
211
210
|
async function deleteSite(project, site) {
|
|
212
211
|
await apiClient.delete(`/projects/${project}/sites/${site}`);
|
|
213
212
|
}
|
|
@@ -313,3 +312,76 @@ async function getDeploymentDomain(projectId, siteId, hostingChannel) {
|
|
|
313
312
|
});
|
|
314
313
|
return site && (0, utils_1.getHostnameFromUrl)(site?.defaultUrl);
|
|
315
314
|
}
|
|
315
|
+
const FAILED_API_CHECK_TTL_MS = 5 * 60 * 1000;
|
|
316
|
+
const failedApiChecks = new Map();
|
|
317
|
+
const inFlightApiChecks = new Map();
|
|
318
|
+
function resetEnsureApiEnabledCacheForTests() {
|
|
319
|
+
failedApiChecks.clear();
|
|
320
|
+
inFlightApiChecks.clear();
|
|
321
|
+
}
|
|
322
|
+
function isServiceUsagePermissionError(err) {
|
|
323
|
+
if ((0, error_1.getErrStatus)(err) === 403) {
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
if (!(0, error_1.isObject)(err)) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
const context = (0, error_1.isObject)(err.context) ? err.context : undefined;
|
|
330
|
+
const body = context && (0, error_1.isObject)(context.body) ? context.body : undefined;
|
|
331
|
+
const errorBody = body && (0, error_1.isObject)(body.error) ? body.error : undefined;
|
|
332
|
+
return errorBody?.status === "PERMISSION_DENIED" || errorBody?.code === 403;
|
|
333
|
+
}
|
|
334
|
+
function isServiceUsageEnableError(err, errMsg) {
|
|
335
|
+
if (errMsg.startsWith("Permissions denied enabling") || errMsg.includes(":enable")) {
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
if (!(0, error_1.isObject)(err) || !(0, error_1.isObject)(err.context) || !(0, error_1.isObject)(err.context.response)) {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
const responseUrl = err.context.response.url;
|
|
342
|
+
return typeof responseUrl === "string" && responseUrl.includes(":enable");
|
|
343
|
+
}
|
|
344
|
+
async function ensureApiEnabled(projectId) {
|
|
345
|
+
const apiUri = (0, api_1.hostingApiOrigin)();
|
|
346
|
+
const apiName = (0, utils_1.getHostnameFromUrl)(apiUri) || apiUri;
|
|
347
|
+
const cacheKey = `${projectId}:${apiName}`;
|
|
348
|
+
const failedUntil = failedApiChecks.get(cacheKey);
|
|
349
|
+
if (failedUntil !== undefined) {
|
|
350
|
+
if (Date.now() < failedUntil) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
failedApiChecks.delete(cacheKey);
|
|
354
|
+
}
|
|
355
|
+
const inFlight = inFlightApiChecks.get(cacheKey);
|
|
356
|
+
if (inFlight) {
|
|
357
|
+
return inFlight;
|
|
358
|
+
}
|
|
359
|
+
const checkPromise = (async () => {
|
|
360
|
+
try {
|
|
361
|
+
await ensureApiEnabledModule.ensure(projectId, apiUri, "hosting", true);
|
|
362
|
+
failedApiChecks.delete(cacheKey);
|
|
363
|
+
}
|
|
364
|
+
catch (err) {
|
|
365
|
+
const errMsg = (0, error_1.getErrMsg)(err);
|
|
366
|
+
logger_1.logger.debug(`[hosting] failed to ensure Hosting API is enabled: ${errMsg}`);
|
|
367
|
+
const enableUrl = ensureApiEnabledModule.enableApiURI(projectId, apiName);
|
|
368
|
+
if (isServiceUsagePermissionError(err)) {
|
|
369
|
+
failedApiChecks.set(cacheKey, Date.now() + FAILED_API_CHECK_TTL_MS);
|
|
370
|
+
if (isServiceUsageEnableError(err, errMsg)) {
|
|
371
|
+
utils.logLabeledWarning("hosting", clc.bold(`Unable to enable ${apiName} on project ${projectId}. Enable the API by visiting ${enableUrl}, or grant the caller the roles/serviceusage.serviceUsageAdmin role.`));
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
utils.logLabeledWarning("hosting", clc.bold(`Unable to check whether ${apiName} is enabled on project ${projectId}. Grant the caller the roles/serviceusage.serviceUsageConsumer role to check API enablement, or ensure the API is enabled at ${enableUrl} if subsequent requests fail.`));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
utils.logLabeledWarning("hosting", clc.bold(`Unable to ensure that ${apiName} is enabled on project ${projectId}. Ensure it is enabled at ${enableUrl} if subsequent requests fail.`));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
finally {
|
|
382
|
+
inFlightApiChecks.delete(cacheKey);
|
|
383
|
+
}
|
|
384
|
+
})();
|
|
385
|
+
inFlightApiChecks.set(cacheKey, checkPromise);
|
|
386
|
+
return checkPromise;
|
|
387
|
+
}
|
|
@@ -15,7 +15,7 @@ async function implicitInit(options) {
|
|
|
15
15
|
config = await (0, fetchWebSetup_1.fetchWebSetup)(options);
|
|
16
16
|
}
|
|
17
17
|
catch (e) {
|
|
18
|
-
logger_1.logger.debug(
|
|
18
|
+
logger_1.logger.debug(`fetchWebSetup error: ${String(e)}`);
|
|
19
19
|
const statusCode = _.get(e, "context.response.statusCode");
|
|
20
20
|
if (statusCode === 403) {
|
|
21
21
|
utils.logLabeledWarning("hosting", `Authentication error when trying to fetch your current web app configuration, have you run ${clc.bold("firebase login")}?`);
|
package/lib/hosting/proxy.js
CHANGED
|
@@ -27,13 +27,13 @@ function makeVary(vary = "") {
|
|
|
27
27
|
return varies.join(", ");
|
|
28
28
|
}
|
|
29
29
|
function proxyRequestHandler(url, rewriteIdentifier, options = {}) {
|
|
30
|
-
|
|
30
|
+
const handle = async (req, res, next) => {
|
|
31
31
|
logger_1.logger.info(`[hosting] Rewriting ${req.url} to ${url} for ${rewriteIdentifier}`);
|
|
32
32
|
const cookie = req.headers.cookie || "";
|
|
33
33
|
const sessionCookie = cookie.split(/; ?/).find((c) => {
|
|
34
34
|
return c.trim().startsWith("__session=");
|
|
35
35
|
});
|
|
36
|
-
const u = new url_1.URL(url
|
|
36
|
+
const u = new url_1.URL(`${url}${req.url ?? ""}`);
|
|
37
37
|
const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: false });
|
|
38
38
|
let body;
|
|
39
39
|
let passThrough;
|
|
@@ -164,6 +164,9 @@ function proxyRequestHandler(url, rewriteIdentifier, options = {}) {
|
|
|
164
164
|
res.statusCode = proxyRes.status;
|
|
165
165
|
proxyRes.body.pipe(res);
|
|
166
166
|
};
|
|
167
|
+
return (req, res, next) => {
|
|
168
|
+
void handle(req, res, next).catch(next);
|
|
169
|
+
};
|
|
167
170
|
}
|
|
168
171
|
function errorRequestHandler(error) {
|
|
169
172
|
return (req, res) => {
|
|
@@ -49,7 +49,7 @@ async function getRulesFromConsole(projectId) {
|
|
|
49
49
|
return utils.reject("Ruleset has no files", { exit: 1 });
|
|
50
50
|
}
|
|
51
51
|
if (rules.length > 1) {
|
|
52
|
-
return utils.reject(
|
|
52
|
+
return utils.reject(`Ruleset has too many files: ${rules.length}`, { exit: 1 });
|
|
53
53
|
}
|
|
54
54
|
return rules[0].content;
|
|
55
55
|
}
|
|
@@ -195,7 +195,7 @@ async function languageSetup(setup) {
|
|
|
195
195
|
}
|
|
196
196
|
async function actuate(setup, config) {
|
|
197
197
|
if (setup.languageOverride) {
|
|
198
|
-
return require(
|
|
198
|
+
return require(`./${String(setup.languageOverride)}`).setup(setup, config);
|
|
199
199
|
}
|
|
200
|
-
return require(
|
|
200
|
+
return require(`./${String(setup.functions.languageChoice)}`).setup(setup, config);
|
|
201
201
|
}
|
|
@@ -11,7 +11,7 @@ async function askInstallDependencies(setup, config) {
|
|
|
11
11
|
});
|
|
12
12
|
if (setup.npm) {
|
|
13
13
|
try {
|
|
14
|
-
await (0, spawn_1.wrapSpawn)("npm", ["install"], config.projectDir
|
|
14
|
+
await (0, spawn_1.wrapSpawn)("npm", ["install"], `${String(config.projectDir)}/${setup.source}`);
|
|
15
15
|
}
|
|
16
16
|
catch (e) {
|
|
17
17
|
logger_1.logger.info();
|
|
@@ -11,10 +11,11 @@ const auth_1 = require("../../../auth");
|
|
|
11
11
|
const fsutils_1 = require("../../../fsutils");
|
|
12
12
|
const iam_1 = require("../../../gcp/iam");
|
|
13
13
|
const resourceManager_1 = require("../../../gcp/resourceManager");
|
|
14
|
+
const api_1 = require("../../../hosting/api");
|
|
14
15
|
const logger_1 = require("../../../logger");
|
|
15
16
|
const prompt_1 = require("../../../prompt");
|
|
16
17
|
const utils_1 = require("../../../utils");
|
|
17
|
-
const
|
|
18
|
+
const api_2 = require("../../../api");
|
|
18
19
|
const apiv2_1 = require("../../../apiv2");
|
|
19
20
|
const error_1 = require("../../../error");
|
|
20
21
|
let GIT_DIR;
|
|
@@ -27,7 +28,7 @@ const YML_MERGE_FILENAME = "firebase-hosting-merge.yml";
|
|
|
27
28
|
const CHECKOUT_GITHUB_ACTION_NAME = "actions/checkout@v4";
|
|
28
29
|
const HOSTING_GITHUB_ACTION_NAME = "FirebaseExtended/action-hosting-deploy@v0";
|
|
29
30
|
const SERVICE_ACCOUNT_MAX_KEY_NUMBER = 10;
|
|
30
|
-
const githubApiClient = new apiv2_1.Client({ urlPrefix: (0,
|
|
31
|
+
const githubApiClient = new apiv2_1.Client({ urlPrefix: (0, api_2.githubApiOrigin)(), auth: false });
|
|
31
32
|
async function initGitHub(setup) {
|
|
32
33
|
if (!setup.projectId) {
|
|
33
34
|
return (0, utils_1.reject)("Could not determine Project ID, can't set up GitHub workflow.", { exit: 1 });
|
|
@@ -35,6 +36,7 @@ async function initGitHub(setup) {
|
|
|
35
36
|
if (!setup.config.hosting && !setup.featureInfo?.hosting) {
|
|
36
37
|
return (0, utils_1.reject)(`Didn't find a Hosting config in firebase.json. Run ${(0, colorette_1.bold)("firebase init hosting")} instead.`);
|
|
37
38
|
}
|
|
39
|
+
await (0, api_1.ensureApiEnabled)(setup.projectId);
|
|
38
40
|
logger_1.logger.info();
|
|
39
41
|
const gitRoot = getGitFolderPath();
|
|
40
42
|
GIT_DIR = path.join(gitRoot, ".git");
|
|
@@ -107,7 +109,7 @@ async function initGitHub(setup) {
|
|
|
107
109
|
}
|
|
108
110
|
logger_1.logger.info();
|
|
109
111
|
(0, utils_1.logLabeledBullet)("Action required", `Visit this URL to revoke authorization for the Firebase CLI GitHub OAuth App:`);
|
|
110
|
-
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${(0,
|
|
112
|
+
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${(0, api_2.githubClientId)()}`)));
|
|
111
113
|
(0, utils_1.logLabeledBullet)("Action required", `Push any new workflow file(s) to your repo`);
|
|
112
114
|
}
|
|
113
115
|
function getGitFolderPath() {
|
|
@@ -277,7 +279,7 @@ async function promptForRepo(options, ghAccessToken) {
|
|
|
277
279
|
(0, utils_1.logWarning)("The provided authorization cannot be used with this repository. If this repository is in an organization, did you remember to grant access?", "error");
|
|
278
280
|
logger_1.logger.info();
|
|
279
281
|
(0, utils_1.logLabeledBullet)("Action required", `Visit this URL to ensure access has been granted to the appropriate organization(s) for the Firebase CLI GitHub OAuth App:`);
|
|
280
|
-
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${(0,
|
|
282
|
+
logger_1.logger.info((0, colorette_1.bold)((0, colorette_1.underline)(`https://github.com/settings/connections/applications/${(0, api_2.githubClientId)()}`)));
|
|
281
283
|
logger_1.logger.info();
|
|
282
284
|
}
|
|
283
285
|
return false;
|
|
@@ -69,6 +69,7 @@ async function askQuestions(setup, config, options) {
|
|
|
69
69
|
setup.featureInfo = setup.featureInfo || {};
|
|
70
70
|
setup.featureInfo.hosting = {};
|
|
71
71
|
if (setup.projectId) {
|
|
72
|
+
await (0, api_1.ensureApiEnabled)(setup.projectId);
|
|
72
73
|
let hasHostingSite = true;
|
|
73
74
|
try {
|
|
74
75
|
await (0, getDefaultHostingSite_1.getDefaultHostingSite)({ projectId: setup.projectId });
|
|
@@ -113,6 +114,9 @@ async function actuate(setup, config, options) {
|
|
|
113
114
|
if (hostingInfo.redirectToAppHosting) {
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
117
|
+
if (setup.projectId) {
|
|
118
|
+
await (0, api_1.ensureApiEnabled)(setup.projectId);
|
|
119
|
+
}
|
|
116
120
|
if (hostingInfo.newSiteId && setup.projectId) {
|
|
117
121
|
await (0, api_1.createSite)(setup.projectId, hostingInfo.newSiteId);
|
|
118
122
|
logger_1.logger.info();
|
|
@@ -15,7 +15,7 @@ async function getRulesFromConsole(projectId) {
|
|
|
15
15
|
return utils.reject("Ruleset has no files", { exit: 1 });
|
|
16
16
|
}
|
|
17
17
|
if (rules.length > 1) {
|
|
18
|
-
return utils.reject(
|
|
18
|
+
return utils.reject(`Ruleset has too many files: ${rules.length}`, { exit: 1 });
|
|
19
19
|
}
|
|
20
20
|
return rules[0].content;
|
|
21
21
|
}
|
package/lib/localFunction.js
CHANGED
|
@@ -20,7 +20,7 @@ class LocalFunction {
|
|
|
20
20
|
return resource.replace(this.paramWildcardRegex, (wildcard) => {
|
|
21
21
|
const wildcardNoBraces = wildcard.slice(1, -1);
|
|
22
22
|
const sub = params?.[wildcardNoBraces];
|
|
23
|
-
return sub || wildcardNoBraces
|
|
23
|
+
return sub || `${wildcardNoBraces}${utils.randomInt(1, 9)}`;
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
constructCallableFunc(data, opts) {
|
|
@@ -156,9 +156,9 @@ class LocalFunction {
|
|
|
156
156
|
}
|
|
157
157
|
requestCallBack(err, response, body) {
|
|
158
158
|
if (err) {
|
|
159
|
-
return console.warn(
|
|
159
|
+
return console.warn(`\nERROR SENDING REQUEST: ${String(err)}`);
|
|
160
160
|
}
|
|
161
|
-
const status = response ? response.status
|
|
161
|
+
const status = response ? `${response.status}, ` : "";
|
|
162
162
|
let bodyString = body;
|
|
163
163
|
if (typeof bodyString === "string") {
|
|
164
164
|
try {
|
|
@@ -104,7 +104,7 @@ async function checkInstanceNameAvailable(projectId, instanceName, databaseType,
|
|
|
104
104
|
return { available: true };
|
|
105
105
|
}
|
|
106
106
|
catch (err) {
|
|
107
|
-
logger_1.logger.debug(`Invalid Realtime Database instance name: ${instanceName}.${err.message ?
|
|
107
|
+
logger_1.logger.debug(`Invalid Realtime Database instance name: ${instanceName}.${err.message ? ` ${String(err.message)}` : ""}`);
|
|
108
108
|
const errBody = err.context.body.error;
|
|
109
109
|
if (errBody?.details?.[0]?.metadata?.suggested_database_ids) {
|
|
110
110
|
return {
|
|
@@ -87,7 +87,7 @@ googleCheckbox.addEventListener("change", (e) => {
|
|
|
87
87
|
googleFields.classList.remove("active");
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
|
|
90
|
+
async function onInitClick() {
|
|
91
91
|
const selectedProduct = Array.from(productRadios).find((r) => r.checked)?.value;
|
|
92
92
|
if (!selectedProjectId) {
|
|
93
93
|
setStatus("Please select a project first.", "error");
|
|
@@ -158,6 +158,9 @@ initBtn.addEventListener("click", async () => {
|
|
|
158
158
|
initBtn.disabled = false;
|
|
159
159
|
initBtn.textContent = "Initialize";
|
|
160
160
|
}
|
|
161
|
+
}
|
|
162
|
+
initBtn.addEventListener("click", () => {
|
|
163
|
+
void onInitClick();
|
|
161
164
|
});
|
|
162
165
|
app.onhostcontextchanged = (ctx) => {
|
|
163
166
|
if (ctx.theme)
|
|
@@ -171,7 +174,7 @@ app.onhostcontextchanged = (ctx) => {
|
|
|
171
174
|
document.body.style.padding = `${top}px ${right}px ${bottom}px ${left}px`;
|
|
172
175
|
}
|
|
173
176
|
};
|
|
174
|
-
(async () => {
|
|
177
|
+
void (async () => {
|
|
175
178
|
const envDirEl = document.getElementById("env-dir");
|
|
176
179
|
try {
|
|
177
180
|
await app.connect();
|
package/lib/mcp/index.js
CHANGED
|
@@ -409,7 +409,7 @@ class FirebaseMcpServer {
|
|
|
409
409
|
app.use(cors());
|
|
410
410
|
const port = options.port || 3000;
|
|
411
411
|
const transports = {};
|
|
412
|
-
|
|
412
|
+
const handleSse = async (req, res) => {
|
|
413
413
|
this.logger.debug(`[SSE] GET /sse connection attempt from ${req.ip}`);
|
|
414
414
|
try {
|
|
415
415
|
const transport = new sse_js_1.SSEServerTransport("/message", res);
|
|
@@ -429,8 +429,11 @@ class FirebaseMcpServer {
|
|
|
429
429
|
catch (err) {
|
|
430
430
|
this.logger.error(`[SSE] Connection error: ${err}`);
|
|
431
431
|
}
|
|
432
|
+
};
|
|
433
|
+
app.get("/sse", (req, res) => {
|
|
434
|
+
void handleSse(req, res);
|
|
432
435
|
});
|
|
433
|
-
|
|
436
|
+
const handleMessage = async (req, res) => {
|
|
434
437
|
const sessionId = req.query.sessionId;
|
|
435
438
|
this.logger.debug(`[SSE] POST /message attempt for session ${sessionId}`);
|
|
436
439
|
const transport = transports[sessionId];
|
|
@@ -447,6 +450,9 @@ class FirebaseMcpServer {
|
|
|
447
450
|
this.logger.error(`[SSE] Rejecting message: No active transport found for session ${sessionId}`);
|
|
448
451
|
res.status(400).send("No active SSE transport connection found for this session");
|
|
449
452
|
}
|
|
453
|
+
};
|
|
454
|
+
app.post("/message", (req, res) => {
|
|
455
|
+
void handleMessage(req, res);
|
|
450
456
|
});
|
|
451
457
|
app.listen(port, "127.0.0.1", () => {
|
|
452
458
|
this.logger.info(`MCP Server running on HTTP/SSE mode at http://127.0.0.1:${port}`);
|
|
@@ -487,12 +493,16 @@ class FirebaseMcpServer {
|
|
|
487
493
|
const message = this._pendingMessages.shift();
|
|
488
494
|
if (!message)
|
|
489
495
|
continue;
|
|
490
|
-
this.server
|
|
496
|
+
this.server
|
|
497
|
+
.sendLoggingMessage({
|
|
491
498
|
level: message.level,
|
|
492
499
|
data: message.data,
|
|
500
|
+
})
|
|
501
|
+
.catch(() => {
|
|
493
502
|
});
|
|
494
503
|
}
|
|
495
|
-
|
|
504
|
+
this.server.sendLoggingMessage({ level, data }).catch(() => {
|
|
505
|
+
});
|
|
496
506
|
}
|
|
497
507
|
else {
|
|
498
508
|
this._pendingMessages.push({ level, data });
|
|
@@ -112,14 +112,14 @@ Here are a list of prerequisite steps that must be completed before running a te
|
|
|
112
112
|
devices.
|
|
113
113
|
|
|
114
114
|
Once the test has started, provide the developer a link to see the results of the test in the Firebase Console.
|
|
115
|
-
You should already know the value of \`appId
|
|
115
|
+
You should already know the value of \`appId\` and \`projectId\` from earlier (if you only know \`projectNumber\`,
|
|
116
116
|
use the \`firebase_get_project\` tool to get \`projectId\`). \`packageName\` is the package name of the app we tested.
|
|
117
117
|
The \`apptesting_run_test\` tool returns a response with field \`name\` in the form
|
|
118
|
-
projects/{projectNumber}/apps/{appId}/releases/{releaseId}/tests/{releaseTestId}. Extract the values for
|
|
118
|
+
projects/{projectNumber}/apps/{appId}/releases/{releaseId}/tests/{releaseTestId}. Extract the values for \`releaseId\`
|
|
119
119
|
and \`releaseTestId\` and use provide a link to the results in the Firebase Console in the format:
|
|
120
120
|
\`https://console.firebase.google.com/u/0/project/{projectId}/apptesting/app/android:{packageName}/releases/{releaseId}/tests/{releaseTestId}\`.
|
|
121
121
|
|
|
122
|
-
You can check the status of the test using the \`apptesting_check_status\` tool with \`release_test_name
|
|
122
|
+
You can check the status of the test using the \`apptesting_check_status\` tool with \`release_test_name\` set to
|
|
123
123
|
the name of the release test returned by the \`run_test\` tool.
|
|
124
124
|
`.trim(),
|
|
125
125
|
},
|
|
@@ -79,12 +79,12 @@ Follow the steps below taking note of any user instructions provided above.
|
|
|
79
79
|
Example (No): "No, there are no dependencies or file structures that indicate the use of a server-side rendering framework."
|
|
80
80
|
4. If there is no \`firebase.json\` file, manually create one based on whether the app requires SSR:
|
|
81
81
|
4a. If the app requires SSR, configure Firebase App Hosting:
|
|
82
|
-
Create \`firebase.json
|
|
82
|
+
Create \`firebase.json\` with an "apphosting" configuration, setting backendId to the app's name in package.json: \`{"apphosting": {"backendId": "<backendId>"}}\`
|
|
83
83
|
4b. If the app does NOT require SSR, configure Firebase Hosting:
|
|
84
|
-
Create \`firebase.json
|
|
84
|
+
Create \`firebase.json\` with a "hosting" configuration. Add a \`{"hosting": {"predeploy": "<build_script>"}}\` config to build before deploying.
|
|
85
85
|
5. Check if there is an active Firebase project for this environment (the \`firebase_get_environment\` tool may be helpful). If there is, provide the active project ID to the user and ask them if they want to proceed using that project. If there is not an active project, give the user two options: Provide an existing project ID or create a new project. Only use the list_projects tool on user request. Wait for their response before proceeding.
|
|
86
86
|
5a. If the user chooses to use an existing Firebase project, the \`firebase_list_projects\` tool may be helpful. Set the selected project as the active project (the \`firebase_update_environment\` tool may be helpful).
|
|
87
|
-
5b. If the user chooses to create a new project, use the \`firebase_create_project
|
|
87
|
+
5b. If the user chooses to create a new project, use the \`firebase_create_project\` tool. Then set the new project as the active project (the \`firebase_update_environment\` tool may be helpful).
|
|
88
88
|
6. If firebase.json contains an "apphosting" configuration, check if a backend exists matching the provided backendId (the \`apphosting_list_backends\` tool may be helpful).
|
|
89
89
|
If it doesn't exist, create one by running the \`${firebaseCliCommand} apphosting:backends:create --backend <backendId> --primary-region us-central1 --root-dir .\` shell.
|
|
90
90
|
7. Only after making sure Firebase has been initialized, run the \`${firebaseCliCommand} deploy\` shell command to perform the deploy. This may take a few minutes.
|
|
@@ -36,7 +36,7 @@ Before starting, ensure you have **Node.js 16+** and npm installed. Install them
|
|
|
36
36
|
|
|
37
37
|
## Firebase Setup Instructions
|
|
38
38
|
|
|
39
|
-
### 1
|
|
39
|
+
### 1. Understand the Application Setup
|
|
40
40
|
|
|
41
41
|
Scan the application files to identify what type of application the user is building. Ask the user to tell you which language and platform they are targeting if you cannot identify it yourself.
|
|
42
42
|
|
|
@@ -49,12 +49,12 @@ The following mobile and web applications are supported. Let the user know their
|
|
|
49
49
|
|
|
50
50
|
Take the following actions depending on the language and platform or framework that is identified:
|
|
51
51
|
|
|
52
|
-
- Android Platform
|
|
53
|
-
- Web Platform
|
|
54
|
-
- Flutter Platform
|
|
55
|
-
- Unsupported Platform
|
|
52
|
+
- Android Platform -> Set up Firebase AI Logic
|
|
53
|
+
- Web Platform -> Set up Firebase AI Logic
|
|
54
|
+
- Flutter Platform -> Set up Firebase AI Logic. Always do the subsequent firebase_init call using the web app
|
|
55
|
+
- Unsupported Platform -> Direct the user to Firebase Docs to learn how to set up AI Logic for their application (share this link with the user https://firebase.google.com/docs/ai-logic/get-started?api=dev)
|
|
56
56
|
|
|
57
|
-
### 2
|
|
57
|
+
### 2. Set up Firebase AI Logic
|
|
58
58
|
|
|
59
59
|
#### Set up the Firebase AI Logic Backend
|
|
60
60
|
|
|
@@ -64,11 +64,11 @@ Take the following actions depending on the language and platform or framework t
|
|
|
64
64
|
- 1. In your project-level \`/build.gradle.kts\` file, add the plugin to the plugins block: id("com.google.gms.google-services") version "4.4.2" apply false
|
|
65
65
|
- 2. In your **app-level** \`/app/build.gradle.kts\` file, apply the plugin: id("com.google.gms.google-services")
|
|
66
66
|
|
|
67
|
-
### 3
|
|
67
|
+
### 3. Implement AI Features
|
|
68
68
|
|
|
69
69
|
#### Gather Building Blocks for Code Generation
|
|
70
70
|
- Identify the correct initialization code snippet from the "Initialization Code References" section based on the language, platform, or framework used in the developer's app.
|
|
71
|
-
- Use the reference loaded from the step above to generate the initialization snippet. PLEASE USE THE EXACT SNIPPET AS A STARTING POINT
|
|
71
|
+
- Use the reference loaded from the step above to generate the initialization snippet. PLEASE USE THE EXACT SNIPPET AS A STARTING POINT!
|
|
72
72
|
- For Android apps, always include the following imports. do not forget or modify them
|
|
73
73
|
- import com.google.firebase.Firebase
|
|
74
74
|
- import com.google.firebase.ai.ai
|
|
@@ -102,7 +102,7 @@ Take the following actions depending on the language and platform or framework t
|
|
|
102
102
|
- Now implement the feature according to the plan you put together. Do not stray away from the instructions provided to you. Always re-read them fully and consult them if you run into any issues.
|
|
103
103
|
- ***DO NOT EXECUTE THE CODE YET. PERFORM THE VALIDATIONS IN STEP 4 BEFORE HANDING THE SESSION BACK OVER TO THE USER***
|
|
104
104
|
|
|
105
|
-
### 4
|
|
105
|
+
### 4. Validate Implementation
|
|
106
106
|
|
|
107
107
|
#### Perform the following checks before handing the session back to the user.
|
|
108
108
|
- Walk through the validation steps one-by-one. Analyze your instructions and the code you generated. Confirm you did not make any mistakes. If you made a mistake, FIX IT.
|
|
@@ -116,7 +116,7 @@ Take the following actions depending on the language and platform or framework t
|
|
|
116
116
|
- Confirmation that the backend is correctly configured to use the Google AI backend.
|
|
117
117
|
- Confirmation that the gemini model is correctly set based on the feature the user is implementing
|
|
118
118
|
|
|
119
|
-
### 5
|
|
119
|
+
### 5. Code Snippet References
|
|
120
120
|
|
|
121
121
|
#### Initialization Code References
|
|
122
122
|
|
|
@@ -5,103 +5,18 @@ const js_yaml_1 = require("js-yaml");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const events_1 = require("../../../crashlytics/events");
|
|
7
7
|
const filters_1 = require("../../../crashlytics/filters");
|
|
8
|
-
const types_1 = require("../../../crashlytics/types");
|
|
9
8
|
const app_id_1 = require("../../resources/guides/app_id");
|
|
10
9
|
const tool_1 = require("../../tool");
|
|
11
|
-
const DUMP_OPTIONS = { lineWidth: 200 };
|
|
12
|
-
function formatFrames(origFrames, maxFrames = 20) {
|
|
13
|
-
const frames = origFrames || [];
|
|
14
|
-
const shouldTruncate = frames.length > maxFrames;
|
|
15
|
-
const framesToFormat = shouldTruncate ? frames.slice(0, maxFrames - 1) : frames;
|
|
16
|
-
const formatted = framesToFormat.map((frame) => {
|
|
17
|
-
let line = `at`;
|
|
18
|
-
if (frame.symbol) {
|
|
19
|
-
line += ` ${frame.symbol}`;
|
|
20
|
-
}
|
|
21
|
-
if (frame.file) {
|
|
22
|
-
line += ` (${frame.file}`;
|
|
23
|
-
if (frame.line) {
|
|
24
|
-
line += `:${frame.line}`;
|
|
25
|
-
}
|
|
26
|
-
line += ")";
|
|
27
|
-
}
|
|
28
|
-
return line;
|
|
29
|
-
});
|
|
30
|
-
if (shouldTruncate) {
|
|
31
|
-
formatted.push("... frames omitted ...");
|
|
32
|
-
}
|
|
33
|
-
return formatted;
|
|
34
|
-
}
|
|
35
|
-
function toText(event) {
|
|
36
|
-
if (!event) {
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
const result = {};
|
|
40
|
-
for (const [key, value] of Object.entries(event)) {
|
|
41
|
-
if (key === "logs") {
|
|
42
|
-
const logs = value || [];
|
|
43
|
-
const slicedLogs = logs.length > 100 ? logs.slice(logs.length - 100) : logs;
|
|
44
|
-
const logLines = slicedLogs.map((log) => `[${log.logTime}] ${log.message}`);
|
|
45
|
-
result["logs"] = logLines.join("\n");
|
|
46
|
-
}
|
|
47
|
-
else if (key === "breadcrumbs") {
|
|
48
|
-
const breadcrumbs = value || [];
|
|
49
|
-
const slicedBreadcrumbs = breadcrumbs.length > 10 ? breadcrumbs.slice(-10) : breadcrumbs;
|
|
50
|
-
const breadcrumbLines = slicedBreadcrumbs.map((b) => {
|
|
51
|
-
const paramString = Object.entries(b?.params || {})
|
|
52
|
-
.map(([k, v]) => `${k}: ${v}`)
|
|
53
|
-
.join(", ");
|
|
54
|
-
const params = paramString ? ` { ${paramString} }` : "";
|
|
55
|
-
return `[${b.eventTime}] ${b.title}${params}`;
|
|
56
|
-
});
|
|
57
|
-
result["breadcrumbs"] = breadcrumbLines.join("\n");
|
|
58
|
-
}
|
|
59
|
-
else if (key === "threads") {
|
|
60
|
-
let threads = value || [];
|
|
61
|
-
if (event.issue?.errorType === types_1.ErrorType.FATAL || event.issue?.errorType === types_1.ErrorType.ANR) {
|
|
62
|
-
threads = threads.filter((t) => t.crashed || t.blamed);
|
|
63
|
-
}
|
|
64
|
-
const threadStrings = threads.map((thread) => {
|
|
65
|
-
const header = `Thread: ${thread.name || thread.threadId || ""}${thread.crashed ? " (crashed)" : ""}`;
|
|
66
|
-
const frameStrings = formatFrames(thread.frames || []);
|
|
67
|
-
return [header, ...frameStrings].join("\n");
|
|
68
|
-
});
|
|
69
|
-
result["threads"] = threadStrings.join("\n\n");
|
|
70
|
-
}
|
|
71
|
-
else if (key === "exceptions") {
|
|
72
|
-
const exceptions = value || [];
|
|
73
|
-
const exceptionStrings = exceptions.map((exception) => {
|
|
74
|
-
const header = exception.nested ? "Caused by: " : "";
|
|
75
|
-
const exceptionHeader = `${header}${exception.type || ""}: ${exception.exceptionMessage || ""}`;
|
|
76
|
-
const frameStrings = formatFrames(exception.frames || []);
|
|
77
|
-
return [exceptionHeader, ...frameStrings].join("\n");
|
|
78
|
-
});
|
|
79
|
-
result["exceptions"] = exceptionStrings.join("\n\n");
|
|
80
|
-
}
|
|
81
|
-
else if (key === "errors") {
|
|
82
|
-
const errors = value || [];
|
|
83
|
-
const errorStrings = errors.map((error) => {
|
|
84
|
-
const header = `Error: ${error.title || "error"}`;
|
|
85
|
-
const frameStrings = formatFrames(error.frames || []);
|
|
86
|
-
return [header, ...frameStrings].join("\n");
|
|
87
|
-
});
|
|
88
|
-
result["errors"] = errorStrings.join("\n\n");
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
result[key] = (0, js_yaml_1.dump)(value, DUMP_OPTIONS);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
10
|
exports.list_events = (0, tool_1.tool)("crashlytics", {
|
|
97
11
|
name: "list_events",
|
|
98
|
-
description: `Use this to list the most recent events matching the given filters.
|
|
12
|
+
description: `Use this to list the most recent events matching the given filters, including custom key filter expressions.
|
|
99
13
|
Can be used to fetch sample crashes and exceptions for an issue,
|
|
100
14
|
which will include stack traces and other data useful for debugging.`,
|
|
101
15
|
humanReadableDescription: "List recent crash and exception events matching specified filters for an issue.",
|
|
102
16
|
inputSchema: zod_1.z.object({
|
|
103
17
|
appId: filters_1.ApplicationIdSchema,
|
|
104
18
|
filter: filters_1.EventFilterSchema,
|
|
19
|
+
filterExpression: filters_1.FilterExpressionSchema,
|
|
105
20
|
pageSize: zod_1.z.number().describe("Number of rows to return").default(1),
|
|
106
21
|
}),
|
|
107
22
|
annotations: {
|
|
@@ -111,7 +26,7 @@ exports.list_events = (0, tool_1.tool)("crashlytics", {
|
|
|
111
26
|
_meta: {
|
|
112
27
|
requiresAuth: true,
|
|
113
28
|
},
|
|
114
|
-
}, async ({ appId, filter, pageSize }) => {
|
|
29
|
+
}, async ({ appId, filter, filterExpression, pageSize }) => {
|
|
115
30
|
const result = { content: [] };
|
|
116
31
|
if (!appId) {
|
|
117
32
|
result.isError = true;
|
|
@@ -125,13 +40,23 @@ exports.list_events = (0, tool_1.tool)("crashlytics", {
|
|
|
125
40
|
text: `Must specify 'filter.issueId' or 'filter.issueVariantId' parameters.`,
|
|
126
41
|
});
|
|
127
42
|
}
|
|
43
|
+
else {
|
|
44
|
+
try {
|
|
45
|
+
filter = (0, filters_1.validateEventFilters)(filter, appId);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
result.isError = true;
|
|
50
|
+
result.content.push({ type: "text", text: `Error: ${message}` });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
128
53
|
if (result.content.length > 0) {
|
|
129
54
|
return result;
|
|
130
55
|
}
|
|
131
|
-
const response = await (0, events_1.listEvents)(appId, filter, pageSize);
|
|
132
|
-
const eventsContent = response.events?.map((e) => toText(e)) || [];
|
|
56
|
+
const response = await (0, events_1.listEvents)(appId, filter, pageSize, filterExpression);
|
|
57
|
+
const eventsContent = response.events?.map((e) => (0, events_1.toText)(e)) || [];
|
|
133
58
|
return {
|
|
134
|
-
content: [{ type: "text", text: (0, js_yaml_1.dump)(eventsContent,
|
|
59
|
+
content: [{ type: "text", text: (0, js_yaml_1.dump)(eventsContent, events_1.EVENT_DUMP_OPTIONS) }],
|
|
135
60
|
};
|
|
136
61
|
});
|
|
137
62
|
exports.batch_get_events = (0, tool_1.tool)("crashlytics", {
|
|
@@ -171,8 +96,8 @@ exports.batch_get_events = (0, tool_1.tool)("crashlytics", {
|
|
|
171
96
|
return result;
|
|
172
97
|
}
|
|
173
98
|
const response = await (0, events_1.batchGetEvents)(appId, names);
|
|
174
|
-
const eventsContent = response.events?.map((e) => toText(e)) || [];
|
|
99
|
+
const eventsContent = response.events?.map((e) => (0, events_1.toText)(e)) || [];
|
|
175
100
|
return {
|
|
176
|
-
content: [{ type: "text", text: (0, js_yaml_1.dump)(eventsContent,
|
|
101
|
+
content: [{ type: "text", text: (0, js_yaml_1.dump)(eventsContent, events_1.EVENT_DUMP_OPTIONS) }],
|
|
177
102
|
};
|
|
178
103
|
});
|
|
@@ -5,6 +5,7 @@ const notes_1 = require("./notes");
|
|
|
5
5
|
const issues_1 = require("./issues");
|
|
6
6
|
const events_1 = require("./events");
|
|
7
7
|
const reports_1 = require("./reports");
|
|
8
|
+
const setup_1 = require("./setup");
|
|
8
9
|
exports.crashlyticsTools = [
|
|
9
10
|
notes_1.create_note,
|
|
10
11
|
notes_1.delete_note,
|
|
@@ -14,4 +15,5 @@ exports.crashlyticsTools = [
|
|
|
14
15
|
notes_1.list_notes,
|
|
15
16
|
reports_1.get_report,
|
|
16
17
|
issues_1.update_issue,
|
|
18
|
+
setup_1.setup,
|
|
17
19
|
];
|