firebase-tools 15.35.0 → 15.36.1-main.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/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/names.js +3 -3
- package/lib/dataconnect/schemaMigration.js +1 -1
- 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/release/fabricator.js +9 -2
- 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/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 +11 -7
- 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/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.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/utils.js +5 -11
- package/package.json +4 -4
- package/lib/functions/kits/sources/index.js +0 -19
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const node_crypto_1 = require("node:crypto");
|
|
6
|
-
const os = require("os");
|
|
7
6
|
const command_1 = require("../command");
|
|
8
7
|
const projectUtils_1 = require("../projectUtils");
|
|
9
8
|
const api_1 = require("../appcheck/api");
|
|
9
|
+
const debugTokens_1 = require("../appcheck/debugTokens");
|
|
10
|
+
const localConfig_1 = require("../appcheck/localConfig");
|
|
10
11
|
const appcheck_prompts_1 = require("./appcheck-prompts");
|
|
11
12
|
const requireAuth_1 = require("../requireAuth");
|
|
12
13
|
const utils_1 = require("../utils");
|
|
@@ -15,16 +16,23 @@ const prompt_1 = require("../prompt");
|
|
|
15
16
|
const logger_1 = require("../logger");
|
|
16
17
|
exports.command = new command_1.Command("appcheck:debugtokens:create [debugToken]")
|
|
17
18
|
.description("generate and register an App Check debug token for an app")
|
|
19
|
+
.help(`generates or registers a Firebase App Check debug token for an app and saves it to the local machine configuration (~/.config/configstore/firebase-appcheck.json) so local SDKs can discover it automatically.
|
|
20
|
+
|
|
21
|
+
Pass an optional \`[debugToken]\` UUID v4 to register a specific token, or omit it to generate a new UUID v4 token. Use \`--no-save-local\` when provisioning tokens for remote CI environments to avoid modifying the local config file.`)
|
|
18
22
|
.option("--app <appId>", "the app id of your Firebase app")
|
|
19
|
-
.option("--display-name <displayName>", "display name for the debug token")
|
|
20
|
-
.option("--
|
|
21
|
-
.
|
|
23
|
+
.option("--display-name <displayName>", "display name for the debug token (max 50 characters)")
|
|
24
|
+
.option("--no-save-local", "do not save the debug token to the local machine config")
|
|
25
|
+
.withForce("accept default prompts and overwrite any existing debug token with the same display name")
|
|
26
|
+
.before((options) => (0, requireAuth_1.requireAuth)(options))
|
|
22
27
|
.action(async (debugToken, options) => {
|
|
28
|
+
const validatedTokenArg = debugToken !== undefined ? (0, debugTokens_1.validateDebugTokenUuid)(debugToken) : undefined;
|
|
29
|
+
const validatedDisplayNameOpt = options.displayName !== undefined ? (0, debugTokens_1.validateDisplayName)(options.displayName) : undefined;
|
|
30
|
+
const saveLocal = options.saveLocal !== false;
|
|
23
31
|
const { appId } = await (0, appcheck_prompts_1.getOrPromptProjectAndAppId)(options);
|
|
24
32
|
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
25
|
-
let token =
|
|
33
|
+
let token = validatedTokenArg;
|
|
26
34
|
if (!token) {
|
|
27
|
-
if (!options.nonInteractive) {
|
|
35
|
+
if (!options.nonInteractive && !options.force) {
|
|
28
36
|
const action = await (0, prompt_1.select)({
|
|
29
37
|
message: "Would you like to register a token generated by the SDK, or create a new one?",
|
|
30
38
|
choices: [
|
|
@@ -33,10 +41,11 @@ exports.command = new command_1.Command("appcheck:debugtokens:create [debugToken
|
|
|
33
41
|
],
|
|
34
42
|
});
|
|
35
43
|
if (action === "sdk") {
|
|
36
|
-
|
|
44
|
+
const entered = await (0, prompt_1.password)({
|
|
37
45
|
message: "Enter the debug token generated by the SDK:",
|
|
38
|
-
validate: (val) => (
|
|
46
|
+
validate: (val) => (0, debugTokens_1.getDebugTokenValidationError)(val) ?? true,
|
|
39
47
|
});
|
|
48
|
+
token = (0, debugTokens_1.validateDebugTokenUuid)(entered);
|
|
40
49
|
}
|
|
41
50
|
else {
|
|
42
51
|
token = (0, node_crypto_1.randomUUID)();
|
|
@@ -46,14 +55,16 @@ exports.command = new command_1.Command("appcheck:debugtokens:create [debugToken
|
|
|
46
55
|
token = (0, node_crypto_1.randomUUID)();
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
|
-
let displayName =
|
|
50
|
-
const defaultName = `CLI Debug Token (${os.hostname() || "Unknown Host"})`;
|
|
58
|
+
let displayName = validatedDisplayNameOpt;
|
|
51
59
|
if (!displayName) {
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
const defaultName = (0, debugTokens_1.getDefaultDisplayName)(saveLocal);
|
|
61
|
+
if (!options.nonInteractive && !options.force) {
|
|
62
|
+
const entered = await (0, prompt_1.input)({
|
|
54
63
|
message: "What would you like to call this debug token?",
|
|
55
64
|
default: defaultName,
|
|
65
|
+
validate: (val) => (0, debugTokens_1.getDisplayNameValidationError)(val) ?? true,
|
|
56
66
|
});
|
|
67
|
+
displayName = (0, debugTokens_1.validateDisplayName)(entered);
|
|
57
68
|
}
|
|
58
69
|
else {
|
|
59
70
|
displayName = defaultName;
|
|
@@ -61,35 +72,49 @@ exports.command = new command_1.Command("appcheck:debugtokens:create [debugToken
|
|
|
61
72
|
}
|
|
62
73
|
const existingTokens = await (0, api_1.listDebugTokens)(projectNumber, appId);
|
|
63
74
|
const matchingTokens = existingTokens.filter((t) => t.displayName === displayName);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
throw new error_1.FirebaseError(`A token with the display name "${displayName}" already exists. Must pass --force to overwrite in non-interactive mode.`, { exit: 1 });
|
|
69
|
-
}
|
|
70
|
-
shouldOverwrite = await (0, prompt_1.confirm)({
|
|
71
|
-
message: `A token with the display name "${displayName}" already exists. Delete the old token(s)?`,
|
|
72
|
-
default: true,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (shouldOverwrite) {
|
|
76
|
-
for (const t of matchingTokens) {
|
|
77
|
-
await (0, api_1.deleteDebugToken)(t.name);
|
|
78
|
-
}
|
|
75
|
+
(0, debugTokens_1.ensureCanCreateOrOverwriteDebugToken)({ appId, existingTokens, matchingTokens });
|
|
76
|
+
if (matchingTokens.length > 0 && !options.force) {
|
|
77
|
+
if (options.nonInteractive) {
|
|
78
|
+
throw new error_1.FirebaseError(`A token with the display name "${displayName}" already exists. Must pass --force to overwrite in non-interactive mode.`, { exit: 1 });
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
const shouldOverwrite = await (0, prompt_1.confirm)({
|
|
81
|
+
message: `A token with the display name "${displayName}" already exists. Replace the existing token(s)?`,
|
|
82
|
+
default: true,
|
|
83
|
+
});
|
|
84
|
+
if (!shouldOverwrite) {
|
|
81
85
|
throw new error_1.FirebaseError("Registration canceled.", { exit: 1 });
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
|
-
const result = await (0, utils_1.promiseWithSpinner)(
|
|
88
|
+
const result = await (0, utils_1.promiseWithSpinner)(() => (0, debugTokens_1.provisionDebugToken)({
|
|
89
|
+
projectNumber,
|
|
90
|
+
appId,
|
|
91
|
+
displayName,
|
|
92
|
+
token,
|
|
93
|
+
existingTokens,
|
|
94
|
+
matchingTokens,
|
|
95
|
+
saveLocal,
|
|
96
|
+
}), `Registering App Check debug token with Firebase for app ${clc.bold(appId)}`);
|
|
97
|
+
const finalToken = result.token || token;
|
|
85
98
|
(0, utils_1.logSuccess)(`Successfully registered App Check debug token:
|
|
86
99
|
- Display Name: ${clc.bold(result.displayName)}
|
|
87
|
-
- Resource Name: ${clc.cyan(result.name)}
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
- Resource Name: ${clc.cyan(result.name)}
|
|
101
|
+
- Token: ${clc.bold(clc.green(finalToken))}`);
|
|
102
|
+
if (saveLocal) {
|
|
103
|
+
logger_1.logger.info(`Saved debug token to local config: ${clc.bold((0, localConfig_1.getLocalConfigPath)())}`);
|
|
104
|
+
}
|
|
105
|
+
if ((0, debugTokens_1.isWebAppId)(appId)) {
|
|
106
|
+
logger_1.logger.info(`\nWeb Framework Instructions:\n` +
|
|
107
|
+
`Copy and paste the relevant variable into your local environment file (${clc.bold(".env.local")}), or export the debug token as a shell environment variable:\n` +
|
|
108
|
+
` # Vite\n` +
|
|
109
|
+
` VITE_FIREBASE_APPCHECK_DEBUG_TOKEN=${finalToken}\n` +
|
|
110
|
+
` # Next.js\n` +
|
|
111
|
+
` NEXT_PUBLIC_FIREBASE_APPCHECK_DEBUG_TOKEN=${finalToken}\n` +
|
|
112
|
+
` # Create React App\n` +
|
|
113
|
+
` REACT_APP_FIREBASE_APPCHECK_DEBUG_TOKEN=${finalToken}\n` +
|
|
114
|
+
`Assign this variable to ${clc.bold("self.FIREBASE_APPCHECK_DEBUG_TOKEN")} in your app initialization code before initializing App Check.\n` +
|
|
115
|
+
`Ensure ${clc.bold(".env.local")} is in your ${clc.bold(".gitignore")} so debug tokens are never committed.`);
|
|
90
116
|
}
|
|
91
117
|
logger_1.logger.info(clc.yellow(clc.bold("Warning: ") +
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
return result;
|
|
118
|
+
"App Check debug tokens grant access to backend resources and are secrets. Do NOT commit debug tokens or .env.local to source repositories. Revoke unused tokens with 'firebase appcheck:debugtokens:delete'."));
|
|
119
|
+
return finalToken;
|
|
95
120
|
});
|
|
@@ -4,19 +4,29 @@ exports.command = void 0;
|
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const command_1 = require("../command");
|
|
6
6
|
const projectUtils_1 = require("../projectUtils");
|
|
7
|
-
const
|
|
7
|
+
const debugTokens_1 = require("../appcheck/debugTokens");
|
|
8
|
+
const localConfig_1 = require("../appcheck/localConfig");
|
|
8
9
|
const appcheck_prompts_1 = require("./appcheck-prompts");
|
|
9
10
|
const requireAuth_1 = require("../requireAuth");
|
|
10
11
|
const utils_1 = require("../utils");
|
|
11
12
|
const prompt_1 = require("../prompt");
|
|
12
13
|
const error_1 = require("../error");
|
|
14
|
+
const logger_1 = require("../logger");
|
|
13
15
|
exports.command = new command_1.Command("appcheck:debugtokens:delete <debugTokenId>")
|
|
14
16
|
.description("delete a Firebase App Check debug token for an app")
|
|
17
|
+
.help(`deletes a server-registered Firebase App Check debug token for an app (accepting either the short \`<debugTokenId>\` or the full \`projects/<projectNumber>/apps/<appId>/debugTokens/<debugTokenId>\` resource name) and removes the matching entry from ~/.config/configstore/firebase-appcheck.json if present.`)
|
|
15
18
|
.option("--app <appId>", "the app id of your Firebase app")
|
|
16
|
-
.
|
|
17
|
-
.before(requireAuth_1.requireAuth)
|
|
19
|
+
.withForce("attempt to delete debug token without prompting for confirmation")
|
|
20
|
+
.before((options) => (0, requireAuth_1.requireAuth)(options))
|
|
18
21
|
.action(async (debugTokenId, options) => {
|
|
19
|
-
|
|
22
|
+
let inferredAppId;
|
|
23
|
+
if (debugTokenId.startsWith("projects/")) {
|
|
24
|
+
const match = /^projects\/[^/]+\/apps\/([^/]+)\/debugTokens\/[^/]+$/.exec(debugTokenId);
|
|
25
|
+
if (match) {
|
|
26
|
+
inferredAppId = match[1];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const { appId } = await (0, appcheck_prompts_1.getOrPromptProjectAndAppId)({ ...options, app: options.app || inferredAppId }, "Select the app to delete a debug token from:");
|
|
20
30
|
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
21
31
|
let debugTokenName = debugTokenId;
|
|
22
32
|
if (!debugTokenName.startsWith("projects/")) {
|
|
@@ -25,7 +35,8 @@ exports.command = new command_1.Command("appcheck:debugtokens:delete <debugToken
|
|
|
25
35
|
else {
|
|
26
36
|
const expectedPrefix = `projects/${projectNumber}/apps/${appId}/debugTokens/`;
|
|
27
37
|
if (!debugTokenName.startsWith(expectedPrefix)) {
|
|
28
|
-
throw new error_1.FirebaseError(`Debug token ${debugTokenId} does not belong to app ${appId} in project ${projectNumber}
|
|
38
|
+
throw new error_1.FirebaseError(`Debug token ${debugTokenId} does not belong to app ${appId} in project ${projectNumber}. ` +
|
|
39
|
+
`Pass --app <appId> for the matching app or run "firebase appcheck:debugtokens:list" to view valid debug tokens.`, { exit: 1 });
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
42
|
if (!options.force) {
|
|
@@ -40,9 +51,12 @@ exports.command = new command_1.Command("appcheck:debugtokens:delete <debugToken
|
|
|
40
51
|
default: false,
|
|
41
52
|
});
|
|
42
53
|
if (!consent) {
|
|
43
|
-
throw new error_1.FirebaseError("Delete App Check debug token canceled.");
|
|
54
|
+
throw new error_1.FirebaseError("Delete App Check debug token canceled.", { exit: 1 });
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
await (0, utils_1.promiseWithSpinner)(
|
|
57
|
+
const removedLocal = await (0, utils_1.promiseWithSpinner)(() => (0, debugTokens_1.deleteDebugTokenAndCleanLocal)({ appId, debugTokenName }), `Deleting App Check debug token ${clc.bold(debugTokenName)}`);
|
|
47
58
|
(0, utils_1.logSuccess)(`Successfully deleted App Check debug token ${clc.bold(debugTokenName)}`);
|
|
59
|
+
if (removedLocal) {
|
|
60
|
+
logger_1.logger.info(`Removed matching debug token from local config: ${clc.bold((0, localConfig_1.getLocalConfigPath)())}`);
|
|
61
|
+
}
|
|
48
62
|
});
|
|
@@ -6,30 +6,59 @@ const Table = require("cli-table3");
|
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const projectUtils_1 = require("../projectUtils");
|
|
8
8
|
const api_1 = require("../appcheck/api");
|
|
9
|
+
const debugTokens_1 = require("../appcheck/debugTokens");
|
|
9
10
|
const appcheck_prompts_1 = require("./appcheck-prompts");
|
|
10
11
|
const requireAuth_1 = require("../requireAuth");
|
|
11
12
|
const logger_1 = require("../logger");
|
|
12
13
|
const utils_1 = require("../utils");
|
|
13
|
-
function
|
|
14
|
+
function logServerDebugTokensList(debugTokens) {
|
|
14
15
|
if (debugTokens.length === 0) {
|
|
15
16
|
logger_1.logger.info(clc.bold("No App Check debug tokens found."));
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const table = new Table({
|
|
20
|
+
head: ["Display Name", "Resource Name", "Update Time"],
|
|
21
|
+
style: { head: ["green"] },
|
|
22
|
+
});
|
|
23
|
+
for (const { displayName, name, updateTime } of debugTokens) {
|
|
21
24
|
table.push([displayName, name, updateTime || "N/A"]);
|
|
25
|
+
}
|
|
26
|
+
logger_1.logger.info(table.toString());
|
|
27
|
+
}
|
|
28
|
+
function logLocalDebugTokensList(entries) {
|
|
29
|
+
if (entries.length === 0) {
|
|
30
|
+
logger_1.logger.info(clc.bold("No local App Check debug tokens found."));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const table = new Table({
|
|
34
|
+
head: ["App ID", "Token Prefix", "Server Status"],
|
|
35
|
+
style: { head: ["green"] },
|
|
22
36
|
});
|
|
37
|
+
for (const entry of entries) {
|
|
38
|
+
table.push([entry.appId, entry.tokenPrefix, (0, debugTokens_1.formatLocalTokenStatus)(entry.status)]);
|
|
39
|
+
}
|
|
23
40
|
logger_1.logger.info(table.toString());
|
|
24
41
|
}
|
|
25
42
|
exports.command = new command_1.Command("appcheck:debugtokens:list")
|
|
26
|
-
.description("list
|
|
43
|
+
.description("list Firebase App Check debug tokens for an app or stored locally on this machine")
|
|
44
|
+
.help(`lists server-registered Firebase App Check debug tokens for an app, or passes \`--local\` to inspect debug tokens saved in ~/.config/configstore/firebase-appcheck.json on this machine (optionally filtered by \`--app\`).`)
|
|
27
45
|
.option("--app <appId>", "the app id of your Firebase app")
|
|
28
|
-
.
|
|
46
|
+
.option("--local", "list debug tokens stored locally on this machine instead of querying all server tokens for an app")
|
|
47
|
+
.before((options) => {
|
|
48
|
+
if (options.local) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
return (0, requireAuth_1.requireAuth)(options);
|
|
52
|
+
})
|
|
29
53
|
.action(async (options) => {
|
|
54
|
+
if (options.local) {
|
|
55
|
+
const localEntries = await (0, debugTokens_1.inspectLocalDebugTokens)(options);
|
|
56
|
+
logLocalDebugTokensList(localEntries);
|
|
57
|
+
return localEntries;
|
|
58
|
+
}
|
|
30
59
|
const { appId } = await (0, appcheck_prompts_1.getOrPromptProjectAndAppId)(options, "Select the app to list debug tokens for:");
|
|
31
60
|
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
32
|
-
const debugTokens = await (0, utils_1.promiseWithSpinner)(
|
|
33
|
-
|
|
61
|
+
const debugTokens = await (0, utils_1.promiseWithSpinner)(() => (0, api_1.listDebugTokens)(projectNumber, appId), `Listing App Check debug tokens for app ${clc.bold(appId)}`);
|
|
62
|
+
logServerDebugTokensList(debugTokens);
|
|
34
63
|
return debugTokens;
|
|
35
64
|
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const debugTokens_1 = require("../appcheck/debugTokens");
|
|
7
|
+
const localConfig_1 = require("../appcheck/localConfig");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const projectUtils_1 = require("../projectUtils");
|
|
11
|
+
const prompt_1 = require("../prompt");
|
|
12
|
+
const requireAuth_1 = require("../requireAuth");
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
|
+
function logServerTokensUntouchedNote() {
|
|
15
|
+
logger_1.logger.info(`Server-registered debug tokens are untouched. Manage server tokens with ${clc.bold("firebase appcheck:debugtokens:list")} and ${clc.bold("firebase appcheck:debugtokens:delete")}.`);
|
|
16
|
+
}
|
|
17
|
+
exports.command = new command_1.Command("appcheck:debugtokens:prune")
|
|
18
|
+
.description("remove stale App Check debug tokens from the local machine config")
|
|
19
|
+
.help(`removes stale App Check debug token entries from ~/.config/configstore/firebase-appcheck.json (and $XDG_CONFIG_HOME/configstore/firebase-appcheck.json when $XDG_CONFIG_HOME is set) on this machine whose Firebase app has been deleted from the active project or whose debug token has been revoked on the server.
|
|
20
|
+
|
|
21
|
+
This command only modifies the local machine config (~/.config/configstore/firebase-appcheck.json and any $XDG_CONFIG_HOME mirror); server-registered debug tokens are untouched and can be managed via \`firebase appcheck:debugtokens:list\` and \`firebase appcheck:debugtokens:delete\`.`)
|
|
22
|
+
.withForce("remove stale local debug tokens without prompting")
|
|
23
|
+
.before((options) => (0, requireAuth_1.requireAuth)(options))
|
|
24
|
+
.action(async (options) => {
|
|
25
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
26
|
+
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
27
|
+
if (Object.keys((0, localConfig_1.getAllLocalTokens)()).length === 0) {
|
|
28
|
+
logger_1.logger.info(clc.bold("No local App Check debug tokens found."));
|
|
29
|
+
logServerTokensUntouchedNote();
|
|
30
|
+
return { prunedAppIds: [] };
|
|
31
|
+
}
|
|
32
|
+
const staleEntries = await (0, utils_1.promiseWithSpinner)(() => (0, debugTokens_1.findStaleLocalDebugTokens)({ projectId, projectNumber }), `Checking local App Check debug tokens against project ${clc.bold(projectId)}`);
|
|
33
|
+
if (staleEntries.length === 0) {
|
|
34
|
+
logger_1.logger.info(clc.bold(`No stale local App Check debug tokens found for project ${projectId}.`));
|
|
35
|
+
logServerTokensUntouchedNote();
|
|
36
|
+
return { prunedAppIds: [] };
|
|
37
|
+
}
|
|
38
|
+
logger_1.logger.info(`Found ${staleEntries.length} stale local debug token(s) in ${clc.bold((0, localConfig_1.getLocalConfigPath)())}:`);
|
|
39
|
+
for (const entry of staleEntries) {
|
|
40
|
+
logger_1.logger.info(` - ${clc.bold(entry.appId)} (${entry.tokenPrefix}): ${(0, debugTokens_1.formatLocalTokenStatus)(entry.status)}`);
|
|
41
|
+
}
|
|
42
|
+
logServerTokensUntouchedNote();
|
|
43
|
+
if (!options.force) {
|
|
44
|
+
if (options.nonInteractive) {
|
|
45
|
+
throw new error_1.FirebaseError("Must pass --force to prune stale local debug tokens in non-interactive mode.", { exit: 1 });
|
|
46
|
+
}
|
|
47
|
+
const consent = await (0, prompt_1.confirm)({
|
|
48
|
+
message: `Remove ${staleEntries.length} stale local debug token(s) from ${(0, localConfig_1.getLocalConfigPath)()}?`,
|
|
49
|
+
default: false,
|
|
50
|
+
});
|
|
51
|
+
if (!consent) {
|
|
52
|
+
throw new error_1.FirebaseError("Prune local App Check debug tokens canceled.", { exit: 1 });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const prunedAppIds = staleEntries.map((entry) => entry.appId);
|
|
56
|
+
(0, localConfig_1.removeLocalTokens)(prunedAppIds);
|
|
57
|
+
(0, utils_1.logSuccess)(`Pruned ${prunedAppIds.length} stale local App Check debug token(s) from ${clc.bold((0, localConfig_1.getLocalConfigPath)())}: ${prunedAppIds.join(", ")}`);
|
|
58
|
+
return { prunedAppIds };
|
|
59
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const js_yaml_1 = require("js-yaml");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const commandUtils_1 = require("../crashlytics/commandUtils");
|
|
7
|
+
const events_1 = require("../crashlytics/events");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const requireAuth_1 = require("../requireAuth");
|
|
11
|
+
exports.command = new command_1.Command("crashlytics:events:get <eventIds...>")
|
|
12
|
+
.description("get one or more Crashlytics events by event ID or resource name")
|
|
13
|
+
.option("--app <appId>", "the Firebase App ID")
|
|
14
|
+
.option("--max-frames <number>", `maximum stack frames per thread or exception (default: ${events_1.DEFAULT_MAX_FRAMES}, ignored when --full is set)`)
|
|
15
|
+
.option("--full", "include all threads, stack frames, logs, and breadcrumbs without truncation")
|
|
16
|
+
.option("-o, --output <path>", "write raw JSON output to a file")
|
|
17
|
+
.withForce("overwrite output file without prompting")
|
|
18
|
+
.before(requireAuth_1.requireAuth)
|
|
19
|
+
.action(async (eventIds, options) => {
|
|
20
|
+
const appId = (0, commandUtils_1.requireAppId)(options);
|
|
21
|
+
const rawIds = Array.isArray(eventIds)
|
|
22
|
+
? eventIds.map((id) => String(id).trim()).filter(Boolean)
|
|
23
|
+
: [];
|
|
24
|
+
if (rawIds.length === 0) {
|
|
25
|
+
throw new error_1.FirebaseError("Must specify at least one '<eventId>'.", { exit: 1 });
|
|
26
|
+
}
|
|
27
|
+
if (rawIds.length > 100) {
|
|
28
|
+
throw new error_1.FirebaseError("Cannot request more than 100 events in a single call.", {
|
|
29
|
+
exit: 1,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const maxFrames = (0, commandUtils_1.parsePositiveIntOption)(options.maxFrames, "--max-frames", {
|
|
33
|
+
defaultValue: events_1.DEFAULT_MAX_FRAMES,
|
|
34
|
+
});
|
|
35
|
+
const resourceNames = rawIds.map((id) => (0, events_1.normalizeEventResourceName)(appId, id));
|
|
36
|
+
const response = await (0, events_1.batchGetEvents)(appId, resourceNames);
|
|
37
|
+
if (!(await (0, commandUtils_1.writeOutputFileIfRequested)(response, options))) {
|
|
38
|
+
const events = response.events || [];
|
|
39
|
+
if (events.length === 0) {
|
|
40
|
+
logger_1.logger.info("No matching events found.");
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const formatted = events.map((e) => (0, events_1.toText)(e, { maxFrames, full: Boolean(options.full) }));
|
|
44
|
+
logger_1.logger.info((0, js_yaml_1.dump)(formatted, events_1.EVENT_DUMP_OPTIONS));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return response;
|
|
48
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const js_yaml_1 = require("js-yaml");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const commandUtils_1 = require("../crashlytics/commandUtils");
|
|
7
|
+
const events_1 = require("../crashlytics/events");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const requireAuth_1 = require("../requireAuth");
|
|
11
|
+
const DEFAULT_LIMIT = 10;
|
|
12
|
+
const MAX_LIMIT = 100;
|
|
13
|
+
exports.command = (0, commandUtils_1.withEventFilterOptions)(new command_1.Command("crashlytics:events:list"))
|
|
14
|
+
.description("list the most recent Crashlytics events matching the given filters")
|
|
15
|
+
.option("--app <appId>", "the Firebase App ID")
|
|
16
|
+
.option("--filter <expression>", "AIP-160 filter expression for custom keys (e.g. 'custom_keys.env = \"prod\"')")
|
|
17
|
+
.option("-n, --limit <number>", `maximum number of events to return (1-${MAX_LIMIT}, default: ${DEFAULT_LIMIT})`)
|
|
18
|
+
.option("--max-frames <number>", `maximum stack frames per thread or exception (default: ${events_1.DEFAULT_MAX_FRAMES}, ignored when --full is set)`)
|
|
19
|
+
.option("--full", "include all threads, stack frames, logs, and breadcrumbs without truncation")
|
|
20
|
+
.option("-o, --output <path>", "write raw JSON output to a file")
|
|
21
|
+
.withForce("overwrite output file without prompting")
|
|
22
|
+
.help(`Lists the most recent Crashlytics events matching the specified filters.
|
|
23
|
+
Requires --issue-id. For Android/Apple apps, add --variant-id to narrow results to one issue variant.
|
|
24
|
+
|
|
25
|
+
Custom Key Filtering (--filter):
|
|
26
|
+
Filter events by Crashlytics custom keys using AIP-160 syntax:
|
|
27
|
+
- Exact match: --filter 'custom_keys.env = "prod"'
|
|
28
|
+
- Key presence: --filter 'custom_keys.experiment_id:*'
|
|
29
|
+
- Multiple keys: --filter 'custom_keys.env = "prod" AND custom_keys.role = "admin"'
|
|
30
|
+
- Multiple vals: --filter 'custom_keys.env = "prod" OR custom_keys.env = "staging"'
|
|
31
|
+
OR is only supported between values of the same key.`)
|
|
32
|
+
.before(requireAuth_1.requireAuth)
|
|
33
|
+
.action(async (options) => {
|
|
34
|
+
const appId = (0, commandUtils_1.requireAppId)(options);
|
|
35
|
+
const filter = (0, commandUtils_1.parseEventFilters)(options, appId);
|
|
36
|
+
if (!filter?.issueId) {
|
|
37
|
+
throw new error_1.FirebaseError(`Must specify '--issue-id <id>' to list events. Run 'firebase crashlytics:reports:get --app ${appId} topIssues' to find issue IDs.`, { exit: 1 });
|
|
38
|
+
}
|
|
39
|
+
const limit = (0, commandUtils_1.parsePositiveIntOption)(options.limit, "--limit", {
|
|
40
|
+
defaultValue: DEFAULT_LIMIT,
|
|
41
|
+
max: MAX_LIMIT,
|
|
42
|
+
});
|
|
43
|
+
const maxFrames = (0, commandUtils_1.parsePositiveIntOption)(options.maxFrames, "--max-frames", {
|
|
44
|
+
defaultValue: events_1.DEFAULT_MAX_FRAMES,
|
|
45
|
+
});
|
|
46
|
+
const filterExpression = typeof options.filter === "string" ? options.filter.trim() || undefined : undefined;
|
|
47
|
+
let response;
|
|
48
|
+
try {
|
|
49
|
+
response = await (0, events_1.listEvents)(appId, filter, limit, filterExpression);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
const status = (0, error_1.getErrStatus)(err);
|
|
53
|
+
const message = (0, error_1.getErrMsg)(err);
|
|
54
|
+
if (filterExpression && (status === 400 || message.includes("INVALID_ARGUMENT"))) {
|
|
55
|
+
throw new error_1.FirebaseError(`${message}\nSee 'firebase crashlytics:events:list --help' for --filter syntax and examples.`, { exit: 1, status, original: (0, error_1.getError)(err) });
|
|
56
|
+
}
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
if (!(await (0, commandUtils_1.writeOutputFileIfRequested)(response, options))) {
|
|
60
|
+
const events = response.events || [];
|
|
61
|
+
if (events.length === 0) {
|
|
62
|
+
logger_1.logger.info("No matching events found.");
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const formatted = events.map((e) => (0, events_1.toText)(e, { maxFrames, full: Boolean(options.full) }));
|
|
66
|
+
logger_1.logger.info((0, js_yaml_1.dump)(formatted, events_1.EVENT_DUMP_OPTIONS));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return response;
|
|
70
|
+
});
|
|
@@ -14,12 +14,12 @@ const profilingManager_1 = require("../crashlytics/profilingManager");
|
|
|
14
14
|
exports.command = new command_1.Command("crashlytics:heapdumps:enable")
|
|
15
15
|
.description("enable Crashlytics heap dump collection for an Android app")
|
|
16
16
|
.option("--app <appID>", "the app id of your Firebase Android app")
|
|
17
|
-
.option("--location <location>",
|
|
17
|
+
.option("--location <location>", "the location for the Cloud Storage bucket", profilingManager_1.DEFAULT_BUCKET_LOCATION)
|
|
18
18
|
.withForce("automatically configure without prompting for confirmation")
|
|
19
19
|
.before(requireAuth_1.requireAuth)
|
|
20
20
|
.action(async (options) => {
|
|
21
21
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
22
|
-
const appId = await (0, profilingManager_1.
|
|
22
|
+
const { appId, packageName } = await (0, profilingManager_1.resolveAndroidApp)(projectId, options);
|
|
23
23
|
const location = options.location || profilingManager_1.DEFAULT_BUCKET_LOCATION;
|
|
24
24
|
const isBillingEnabled = await cloudbilling.checkBillingEnabled(projectId);
|
|
25
25
|
if (!isBillingEnabled) {
|
|
@@ -29,7 +29,6 @@ exports.command = new command_1.Command("crashlytics:heapdumps:enable")
|
|
|
29
29
|
const bucketName = (0, profilingManager_1.createBucketName)(appId);
|
|
30
30
|
const confirmed = await (0, prompt_1.confirm)({
|
|
31
31
|
message: `Enable Crashlytics heap dump collection for ${appId} using Cloud Storage bucket '${bucketName}' in ${location} (with ${profilingManager_1.DEFAULT_FILE_TTL_DAYS}-day file TTL)?`,
|
|
32
|
-
default: true,
|
|
33
32
|
force: options.force,
|
|
34
33
|
nonInteractive: options.nonInteractive,
|
|
35
34
|
});
|
|
@@ -45,7 +44,7 @@ exports.command = new command_1.Command("crashlytics:heapdumps:enable")
|
|
|
45
44
|
logger_1.logger.info(` File TTL: ${clc.cyan(`${profilingManager_1.DEFAULT_FILE_TTL_DAYS} days`)}`);
|
|
46
45
|
logger_1.logger.info(` Status: ${clc.green("Enabled")}`);
|
|
47
46
|
logger_1.logger.info("");
|
|
48
|
-
logger_1.logger.info(`View collected heap dumps in the Firebase Console: ${(0,
|
|
47
|
+
logger_1.logger.info(`View collected heap dumps in the Firebase Console: ${(0, profilingManager_1.getCrashlyticsConsoleUrl)(projectId, packageName)}`);
|
|
49
48
|
return {
|
|
50
49
|
appId,
|
|
51
50
|
bucketName,
|
|
@@ -16,17 +16,19 @@ exports.command = new command_1.Command("crashlytics:heapdumps:status")
|
|
|
16
16
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
17
17
|
const appId = await (0, profilingManager_1.resolveAndroidAppId)(projectId, options);
|
|
18
18
|
const config = await (0, profilingManager_1.getProfilingManagerConfig)(appId);
|
|
19
|
+
const heapDumpCollectionEnabled = Boolean(config?.heapDumpCollectionEnabled);
|
|
19
20
|
const tableHead = ["App ID", "Collection Status", "Cloud Storage Bucket"];
|
|
20
21
|
const table = new Table({ head: tableHead, style: { head: ["green"] } });
|
|
21
22
|
table.push([
|
|
22
23
|
appId,
|
|
23
|
-
|
|
24
|
-
config
|
|
24
|
+
heapDumpCollectionEnabled ? clc.green("Enabled") : clc.red("Disabled"),
|
|
25
|
+
config?.bucket || clc.yellow("(none)"),
|
|
25
26
|
]);
|
|
26
27
|
logger_1.logger.info("");
|
|
27
28
|
logger_1.logger.info(table.toString());
|
|
28
29
|
return {
|
|
29
30
|
appId,
|
|
30
|
-
...config,
|
|
31
|
+
...(config ?? {}),
|
|
32
|
+
heapDumpCollectionEnabled,
|
|
31
33
|
};
|
|
32
34
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const commandUtils_1 = require("../crashlytics/commandUtils");
|
|
7
|
+
const issues_1 = require("../crashlytics/issues");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const requireAuth_1 = require("../requireAuth");
|
|
11
|
+
function logIssue(issue) {
|
|
12
|
+
const table = new Table({
|
|
13
|
+
head: ["Field", "Value"],
|
|
14
|
+
style: { head: ["green"] },
|
|
15
|
+
});
|
|
16
|
+
const rows = [
|
|
17
|
+
["Issue ID", issue.id],
|
|
18
|
+
["Title", issue.title],
|
|
19
|
+
["Subtitle", issue.subtitle],
|
|
20
|
+
["State", issue.state],
|
|
21
|
+
["Error Type", issue.errorType],
|
|
22
|
+
["First Seen Version", issue.firstSeenVersion],
|
|
23
|
+
["Last Seen Version", issue.lastSeenVersion],
|
|
24
|
+
["First Seen Time", issue.firstSeenTime],
|
|
25
|
+
["Last Seen Time", issue.lastSeenTime],
|
|
26
|
+
[
|
|
27
|
+
"Signals",
|
|
28
|
+
issue.signals
|
|
29
|
+
?.map((s) => s.signal)
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(", "),
|
|
32
|
+
],
|
|
33
|
+
["Notes Count", issue.notesCount !== undefined ? String(issue.notesCount) : undefined],
|
|
34
|
+
["Sample Event", issue.sampleEvent],
|
|
35
|
+
["Console URI", issue.uri],
|
|
36
|
+
];
|
|
37
|
+
for (const [label, value] of rows) {
|
|
38
|
+
if (value !== undefined && value !== "") {
|
|
39
|
+
table.push([label, value]);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
logger_1.logger.info(table.toString());
|
|
43
|
+
}
|
|
44
|
+
exports.command = new command_1.Command("crashlytics:issues:get <issueId>")
|
|
45
|
+
.description("get details for a Crashlytics issue")
|
|
46
|
+
.option("--app <appId>", "the Firebase App ID")
|
|
47
|
+
.option("-o, --output <path>", "write raw JSON output to a file")
|
|
48
|
+
.withForce("overwrite output file without prompting")
|
|
49
|
+
.before(requireAuth_1.requireAuth)
|
|
50
|
+
.action(async (issueId, options) => {
|
|
51
|
+
const appId = (0, commandUtils_1.requireAppId)(options);
|
|
52
|
+
const trimmedIssueId = typeof issueId === "string" ? issueId.trim() : "";
|
|
53
|
+
if (!trimmedIssueId) {
|
|
54
|
+
throw new error_1.FirebaseError("Must specify '<issueId>'.", { exit: 1 });
|
|
55
|
+
}
|
|
56
|
+
const issue = await (0, issues_1.getIssue)(appId, trimmedIssueId);
|
|
57
|
+
if (!(await (0, commandUtils_1.writeOutputFileIfRequested)(issue, options))) {
|
|
58
|
+
logIssue(issue);
|
|
59
|
+
}
|
|
60
|
+
return issue;
|
|
61
|
+
});
|