firebase-tools 14.15.2 → 14.17.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.
Files changed (83) hide show
  1. package/lib/commands/firestore-bulkdelete.js +73 -0
  2. package/lib/commands/firestore-operations-cancel.js +44 -0
  3. package/lib/commands/firestore-operations-describe.js +29 -0
  4. package/lib/commands/firestore-operations-list.js +29 -0
  5. package/lib/commands/firestore-utils.js +15 -0
  6. package/lib/commands/functions-config-export.js +5 -2
  7. package/lib/commands/index.js +5 -0
  8. package/lib/config.js +16 -4
  9. package/lib/crashlytics/{listNotes.js → events.js} +11 -9
  10. package/lib/crashlytics/filters.js +77 -0
  11. package/lib/crashlytics/issues.js +50 -0
  12. package/lib/crashlytics/notes.js +67 -0
  13. package/lib/crashlytics/reports.js +47 -0
  14. package/lib/crashlytics/types.js +60 -0
  15. package/lib/dataconnect/ensureApis.js +3 -3
  16. package/lib/deploy/apphosting/deploy.js +2 -1
  17. package/lib/deploy/apphosting/util.js +5 -8
  18. package/lib/deploy/functions/deploy.js +4 -3
  19. package/lib/deploy/functions/prepare.js +8 -6
  20. package/lib/emulator/apphosting/developmentServer.js +3 -3
  21. package/lib/emulator/apphosting/serve.js +29 -29
  22. package/lib/emulator/commandUtils.js +7 -1
  23. package/lib/emulator/controller.js +15 -31
  24. package/lib/emulator/downloadableEmulatorInfo.json +18 -18
  25. package/lib/emulator/hub.js +7 -1
  26. package/lib/emulator/initEmulators.js +1 -1
  27. package/lib/extensions/runtimes/common.js +3 -2
  28. package/lib/firestore/api.js +45 -0
  29. package/lib/firestore/pretty-print.js +23 -0
  30. package/lib/functions/projectConfig.js +69 -9
  31. package/lib/gcp/cloudfunctions.js +1 -6
  32. package/lib/gcp/cloudfunctionsv2.js +1 -9
  33. package/lib/gcp/cloudsql/cloudsqladmin.js +2 -2
  34. package/lib/init/features/dataconnect/create_app.js +7 -2
  35. package/lib/init/features/dataconnect/index.js +101 -60
  36. package/lib/init/features/dataconnect/sdk.js +35 -17
  37. package/lib/mcp/errors.js +2 -10
  38. package/lib/mcp/index.js +0 -3
  39. package/lib/mcp/prompts/crashlytics/connect.js +114 -0
  40. package/lib/mcp/prompts/crashlytics/index.js +2 -3
  41. package/lib/mcp/tools/auth/disable_user.js +1 -1
  42. package/lib/mcp/tools/auth/get_user.js +9 -2
  43. package/lib/mcp/tools/core/index.js +4 -0
  44. package/lib/mcp/tools/core/init.js +11 -2
  45. package/lib/mcp/tools/core/login.js +46 -0
  46. package/lib/mcp/tools/core/logout.js +62 -0
  47. package/lib/mcp/tools/crashlytics/events.js +42 -0
  48. package/lib/mcp/tools/crashlytics/index.js +16 -20
  49. package/lib/mcp/tools/crashlytics/issues.js +56 -0
  50. package/lib/mcp/tools/crashlytics/notes.js +78 -0
  51. package/lib/mcp/tools/crashlytics/reports.js +100 -0
  52. package/lib/mcp/tools/dataconnect/index.js +2 -2
  53. package/lib/mcp/tools/dataconnect/{info.js → list_services.js} +5 -5
  54. package/lib/mcp/util.js +1 -17
  55. package/lib/serve/functions.js +4 -3
  56. package/lib/unzip.js +13 -0
  57. package/lib/utils.js +17 -1
  58. package/package.json +1 -1
  59. package/schema/firebase-config.json +160 -59
  60. package/lib/crashlytics/addNote.js +0 -27
  61. package/lib/crashlytics/deleteNote.js +0 -23
  62. package/lib/crashlytics/getIssueDetails.js +0 -26
  63. package/lib/crashlytics/getSampleCrash.js +0 -34
  64. package/lib/crashlytics/listTopDevices.js +0 -33
  65. package/lib/crashlytics/listTopIssues.js +0 -30
  66. package/lib/crashlytics/listTopOperatingSystems.js +0 -32
  67. package/lib/crashlytics/listTopVersions.js +0 -32
  68. package/lib/crashlytics/updateIssue.js +0 -35
  69. package/lib/mcp/prompts/crashlytics/common.js +0 -10
  70. package/lib/mcp/prompts/crashlytics/fix_issue.js +0 -89
  71. package/lib/mcp/prompts/crashlytics/prioritize_issues.js +0 -79
  72. package/lib/mcp/tools/crashlytics/add_note.js +0 -32
  73. package/lib/mcp/tools/crashlytics/constants.js +0 -11
  74. package/lib/mcp/tools/crashlytics/delete_note.js +0 -35
  75. package/lib/mcp/tools/crashlytics/get_issue_details.js +0 -31
  76. package/lib/mcp/tools/crashlytics/get_sample_crash.js +0 -43
  77. package/lib/mcp/tools/crashlytics/list_notes.js +0 -37
  78. package/lib/mcp/tools/crashlytics/list_top_devices.js +0 -33
  79. package/lib/mcp/tools/crashlytics/list_top_issues.js +0 -38
  80. package/lib/mcp/tools/crashlytics/list_top_operating_systems.js +0 -33
  81. package/lib/mcp/tools/crashlytics/list_top_versions.js +0 -33
  82. package/lib/mcp/tools/crashlytics/update_issue.js +0 -37
  83. package/lib/mcp/tools/database/set_rules.js +0 -41
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.info = void 0;
3
+ exports.list_services = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const path = require("path");
6
6
  const tool_1 = require("../../tool");
@@ -9,12 +9,12 @@ const client = require("../../../dataconnect/client");
9
9
  const load_1 = require("../../../dataconnect/load");
10
10
  const js_yaml_1 = require("js-yaml");
11
11
  const logger_1 = require("../../../logger");
12
- exports.info = (0, tool_1.tool)({
13
- name: "info",
14
- description: "Get information about the Firebase Data Connect local and deployed resources.",
12
+ exports.list_services = (0, tool_1.tool)({
13
+ name: "list_services",
14
+ description: "List existing local and backend Firebase Data Connect services",
15
15
  inputSchema: zod_1.z.object({}),
16
16
  annotations: {
17
- title: "Get information about Firebase Data Connect",
17
+ title: "List existing Firebase Data Connect services",
18
18
  readOnlyHint: true,
19
19
  },
20
20
  _meta: {
package/lib/mcp/util.js CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanSchema = exports.checkFeatureActive = exports.commandExistsSync = exports.mcpError = exports.toContent = void 0;
4
- const child_process_1 = require("child_process");
3
+ exports.cleanSchema = exports.checkFeatureActive = exports.mcpError = exports.toContent = void 0;
5
4
  const js_yaml_1 = require("js-yaml");
6
- const os_1 = require("os");
7
5
  const api_1 = require("../api");
8
6
  const ensureApiEnabled_1 = require("../ensureApiEnabled");
9
7
  const timeout_1 = require("../timeout");
@@ -41,20 +39,6 @@ function mcpError(message, code) {
41
39
  };
42
40
  }
43
41
  exports.mcpError = mcpError;
44
- function commandExistsSync(command) {
45
- try {
46
- const isWindows = (0, os_1.platform)() === "win32";
47
- const commandToCheck = isWindows
48
- ? `where "${command}" > nul 2> nul`
49
- : `which "${command}" > /dev/null 2> /dev/null`;
50
- (0, child_process_1.execSync)(commandToCheck);
51
- return true;
52
- }
53
- catch (error) {
54
- return false;
55
- }
56
- }
57
- exports.commandExistsSync = commandExistsSync;
58
42
  const SERVER_FEATURE_APIS = {
59
43
  core: "",
60
44
  firestore: (0, api_1.firestoreOrigin)(),
@@ -21,11 +21,12 @@ class FunctionsServer {
21
21
  const config = projectConfig.normalizeAndValidate(options.config.src.functions);
22
22
  const backends = [];
23
23
  for (const cfg of config) {
24
- const functionsDir = path.join(options.config.projectDir, cfg.source);
24
+ const localCfg = projectConfig.requireLocal(cfg, "Remote sources are not supported in the Functions emulator.");
25
+ const functionsDir = path.join(options.config.projectDir, localCfg.source);
25
26
  backends.push({
26
27
  functionsDir,
27
- codebase: cfg.codebase,
28
- runtime: cfg.runtime,
28
+ codebase: localCfg.codebase,
29
+ runtime: localCfg.runtime,
29
30
  env: {},
30
31
  secretEnv: [],
31
32
  });
package/lib/unzip.js CHANGED
@@ -57,6 +57,9 @@ const extractEntriesFromBuffer = async (data, outputDir) => {
57
57
  logger_1.logger.debug(`[unzip] Entry: ${entry.fileName} (compressed_size=${entry.compressedSize} bytes, uncompressed_size=${entry.uncompressedSize} bytes)`);
58
58
  entry.fileName = entry.fileName.replace(/\//g, path.sep);
59
59
  const outputFilePath = path.normalize(path.join(outputDir, entry.fileName));
60
+ if (!isChildDir(outputDir, outputFilePath)) {
61
+ throw new error_1.FirebaseError(`ZIP contained an entry for ${outputFilePath}, a path outside of ${outputDir}`);
62
+ }
60
63
  logger_1.logger.debug(`[unzip] Processing entry: ${entry.fileName}`);
61
64
  if (entry.fileName.endsWith(path.sep)) {
62
65
  logger_1.logger.debug(`[unzip] mkdir: ${outputFilePath}`);
@@ -82,6 +85,16 @@ const extractEntriesFromBuffer = async (data, outputDir) => {
82
85
  position += entry.headerSize + entry.compressedSize + dataDescriptorSize;
83
86
  }
84
87
  };
88
+ function isChildDir(parentDir, potentialChild) {
89
+ try {
90
+ const resolvedParent = path.resolve(parentDir);
91
+ const resolvedChild = path.resolve(potentialChild);
92
+ return resolvedChild.startsWith(resolvedParent) && resolvedChild !== resolvedParent;
93
+ }
94
+ catch (error) {
95
+ return false;
96
+ }
97
+ }
85
98
  const unzip = async (inputPath, outputDir) => {
86
99
  const data = await fs.promises.readFile(inputPath);
87
100
  await extractEntriesFromBuffer(data, outputDir);
package/lib/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.openInBrowserPopup = exports.openInBrowser = exports.connectableHostname = exports.randomInt = exports.debounce = exports.last = exports.cloneDeep = exports.groupBy = exports.assertIsStringOrUndefined = exports.assertIsNumber = exports.assertIsString = exports.thirtyDaysFromNow = exports.isRunningInWSL = exports.isCloudEnvironment = exports.datetimeString = exports.createDestroyer = exports.sleep = exports.promiseWithSpinner = exports.tryParse = exports.promiseProps = exports.withTimeout = exports.promiseWhile = exports.promiseAllSettled = exports.getFunctionsEventProvider = exports.endpoint = exports.makeActiveProject = exports.streamToString = exports.stringToStream = exports.explainStdin = exports.allSettled = exports.reject = exports.logLabeledError = exports.logLabeledWarning = exports.logWarningToStderr = exports.logWarning = exports.logLabeledBullet = exports.logBullet = exports.logLabeledSuccess = exports.logSuccess = exports.addSubdomain = exports.addDatabaseNamespace = exports.getDatabaseViewDataUrl = exports.getDatabaseUrl = exports.envOverride = exports.setVSCodeEnvVars = exports.getInheritedOption = exports.consoleUrl = exports.vscodeEnvVars = exports.envOverrides = exports.IS_WINDOWS = void 0;
4
- exports.newUniqueId = exports.deepEqual = exports.promptForDirectory = exports.updateOrCreateGitignore = exports.readSecretValue = exports.generatePassword = exports.generateId = exports.wrappedSafeLoad = exports.readFileFromDirectory = exports.getHostnameFromUrl = void 0;
4
+ exports.commandExistsSync = exports.newUniqueId = exports.deepEqual = exports.promptForDirectory = exports.updateOrCreateGitignore = exports.readSecretValue = exports.generatePassword = exports.generateId = exports.wrappedSafeLoad = exports.readFileFromDirectory = exports.getHostnameFromUrl = void 0;
5
5
  const fs = require("fs-extra");
6
6
  const tty = require("tty");
7
7
  const path = require("node:path");
@@ -24,6 +24,8 @@ const prompt_1 = require("./prompt");
24
24
  const templates_1 = require("./templates");
25
25
  const vsCodeUtils_1 = require("./vsCodeUtils");
26
26
  const fsutils_1 = require("./fsutils");
27
+ const node_os_1 = require("node:os");
28
+ const node_child_process_1 = require("node:child_process");
27
29
  exports.IS_WINDOWS = process.platform === "win32";
28
30
  const SUCCESS_CHAR = exports.IS_WINDOWS ? "+" : "✔";
29
31
  const WARNING_CHAR = exports.IS_WINDOWS ? "!" : "⚠";
@@ -657,3 +659,17 @@ function newUniqueId(recommended, existingIDs) {
657
659
  return id;
658
660
  }
659
661
  exports.newUniqueId = newUniqueId;
662
+ function commandExistsSync(command) {
663
+ try {
664
+ const isWindows = (0, node_os_1.platform)() === "win32";
665
+ const commandToCheck = isWindows
666
+ ? `where "${command}" > nul 2> nul`
667
+ : `which "${command}" > /dev/null 2> /dev/null`;
668
+ (0, node_child_process_1.execSync)(commandToCheck);
669
+ return true;
670
+ }
671
+ catch (error) {
672
+ return false;
673
+ }
674
+ }
675
+ exports.commandExistsSync = commandExistsSync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "14.15.2",
3
+ "version": "14.17.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -2,6 +2,18 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "additionalProperties": false,
4
4
  "definitions": {
5
+ "ActiveRuntime": {
6
+ "enum": [
7
+ "nodejs18",
8
+ "nodejs20",
9
+ "nodejs22",
10
+ "python310",
11
+ "python311",
12
+ "python312",
13
+ "python313"
14
+ ],
15
+ "type": "string"
16
+ },
5
17
  "DataConnectSingle": {
6
18
  "additionalProperties": false,
7
19
  "properties": {
@@ -242,66 +254,14 @@
242
254
  "type": "object"
243
255
  },
244
256
  "FunctionConfig": {
245
- "additionalProperties": false,
246
- "properties": {
247
- "codebase": {
248
- "type": "string"
249
- },
250
- "configDir": {
251
- "type": "string"
252
- },
253
- "ignore": {
254
- "items": {
255
- "type": "string"
256
- },
257
- "type": "array"
258
- },
259
- "postdeploy": {
260
- "anyOf": [
261
- {
262
- "items": {
263
- "type": "string"
264
- },
265
- "type": "array"
266
- },
267
- {
268
- "type": "string"
269
- }
270
- ]
271
- },
272
- "predeploy": {
273
- "anyOf": [
274
- {
275
- "items": {
276
- "type": "string"
277
- },
278
- "type": "array"
279
- },
280
- {
281
- "type": "string"
282
- }
283
- ]
284
- },
285
- "prefix": {
286
- "type": "string"
287
- },
288
- "runtime": {
289
- "enum": [
290
- "nodejs18",
291
- "nodejs20",
292
- "nodejs22",
293
- "python310",
294
- "python311",
295
- "python312",
296
- "python313"
297
- ],
298
- "type": "string"
257
+ "anyOf": [
258
+ {
259
+ "$ref": "#/definitions/LocalFunctionConfig"
299
260
  },
300
- "source": {
301
- "type": "string"
261
+ {
262
+ "$ref": "#/definitions/RemoteFunctionConfig"
302
263
  }
303
- },
304
- "type": "object"
264
+ ]
305
265
  },
306
266
  "HostingHeaders": {
307
267
  "anyOf": [
@@ -903,6 +863,71 @@
903
863
  },
904
864
  "type": "object"
905
865
  },
866
+ "LocalFunctionConfig": {
867
+ "additionalProperties": false,
868
+ "properties": {
869
+ "codebase": {
870
+ "type": "string"
871
+ },
872
+ "configDir": {
873
+ "type": "string"
874
+ },
875
+ "ignore": {
876
+ "items": {
877
+ "type": "string"
878
+ },
879
+ "type": "array"
880
+ },
881
+ "postdeploy": {
882
+ "anyOf": [
883
+ {
884
+ "items": {
885
+ "type": "string"
886
+ },
887
+ "type": "array"
888
+ },
889
+ {
890
+ "type": "string"
891
+ }
892
+ ]
893
+ },
894
+ "predeploy": {
895
+ "anyOf": [
896
+ {
897
+ "items": {
898
+ "type": "string"
899
+ },
900
+ "type": "array"
901
+ },
902
+ {
903
+ "type": "string"
904
+ }
905
+ ]
906
+ },
907
+ "prefix": {
908
+ "type": "string"
909
+ },
910
+ "runtime": {
911
+ "enum": [
912
+ "nodejs18",
913
+ "nodejs20",
914
+ "nodejs22",
915
+ "python310",
916
+ "python311",
917
+ "python312",
918
+ "python313"
919
+ ],
920
+ "type": "string"
921
+ },
922
+ "source": {
923
+ "type": "string"
924
+ }
925
+ },
926
+ "required": [
927
+ "source"
928
+ ],
929
+ "type": "object"
930
+ },
906
931
  "Record<string,string>": {
907
932
  "additionalProperties": false,
908
933
  "type": "object"
@@ -945,6 +970,79 @@
945
970
  ],
946
971
  "type": "object"
947
972
  },
973
+ "RemoteFunctionConfig": {
974
+ "additionalProperties": false,
975
+ "properties": {
976
+ "codebase": {
977
+ "type": "string"
978
+ },
979
+ "configDir": {
980
+ "type": "string"
981
+ },
982
+ "ignore": {
983
+ "items": {
984
+ "type": "string"
985
+ },
986
+ "type": "array"
987
+ },
988
+ "postdeploy": {
989
+ "anyOf": [
990
+ {
991
+ "items": {
992
+ "type": "string"
993
+ },
994
+ "type": "array"
995
+ },
996
+ {
997
+ "type": "string"
998
+ }
999
+ ]
1000
+ },
1001
+ "predeploy": {
1002
+ "anyOf": [
1003
+ {
1004
+ "items": {
1005
+ "type": "string"
1006
+ },
1007
+ "type": "array"
1008
+ },
1009
+ {
1010
+ "type": "string"
1011
+ }
1012
+ ]
1013
+ },
1014
+ "prefix": {
1015
+ "type": "string"
1016
+ },
1017
+ "remoteSource": {
1018
+ "additionalProperties": false,
1019
+ "properties": {
1020
+ "dir": {
1021
+ "type": "string"
1022
+ },
1023
+ "ref": {
1024
+ "type": "string"
1025
+ },
1026
+ "repository": {
1027
+ "type": "string"
1028
+ }
1029
+ },
1030
+ "required": [
1031
+ "ref",
1032
+ "repository"
1033
+ ],
1034
+ "type": "object"
1035
+ },
1036
+ "runtime": {
1037
+ "$ref": "#/definitions/ActiveRuntime"
1038
+ }
1039
+ },
1040
+ "required": [
1041
+ "remoteSource",
1042
+ "runtime"
1043
+ ],
1044
+ "type": "object"
1045
+ },
948
1046
  "StorageSingle": {
949
1047
  "additionalProperties": false,
950
1048
  "properties": {
@@ -1487,7 +1585,10 @@
1487
1585
  "functions": {
1488
1586
  "anyOf": [
1489
1587
  {
1490
- "$ref": "#/definitions/FunctionConfig"
1588
+ "$ref": "#/definitions/LocalFunctionConfig"
1589
+ },
1590
+ {
1591
+ "$ref": "#/definitions/RemoteFunctionConfig"
1491
1592
  },
1492
1593
  {
1493
1594
  "items": {
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addNote = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function addNote(appId, issueId, note) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- logger_1.logger.debug(`[mcp][crashlytics] addNote called with appId: ${appId}, issueId: ${issueId}, note: ${note}`);
10
- try {
11
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
12
- method: "POST",
13
- headers: {
14
- "Content-Type": "application/json",
15
- },
16
- path: `/projects/${requestProjectNumber}/apps/${appId}/issues/${issueId}/notes`,
17
- body: { body: note },
18
- timeout: utils_1.TIMEOUT,
19
- });
20
- return response.body;
21
- }
22
- catch (err) {
23
- logger_1.logger.debug(err.message);
24
- throw new error_1.FirebaseError(`Failed to add note to issue ${issueId} for app ${appId}. Error: ${err}.`, { original: err });
25
- }
26
- }
27
- exports.addNote = addNote;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteNote = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function deleteNote(appId, issueId, noteId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- logger_1.logger.debug(`[mcp][crashlytics] deleteNote called with appId: ${appId}, issueId: ${issueId}, noteId: ${noteId}`);
10
- try {
11
- await utils_1.CRASHLYTICS_API_CLIENT.request({
12
- method: "DELETE",
13
- path: `/projects/${requestProjectNumber}/apps/${appId}/issues/${issueId}/notes/${noteId}`,
14
- timeout: utils_1.TIMEOUT,
15
- });
16
- return `Successfully deleted note ${noteId} from issue ${issueId}.`;
17
- }
18
- catch (err) {
19
- logger_1.logger.debug(err.message);
20
- throw new error_1.FirebaseError(`Failed to delete note ${noteId} from issue ${issueId} for app ${appId}. Error: ${err}.`, { original: err });
21
- }
22
- }
23
- exports.deleteNote = deleteNote;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIssueDetails = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function getIssueDetails(appId, issueId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- logger_1.logger.debug(`[mcp][crashlytics] getIssueDetails called with appId: ${appId}, issueId: ${issueId}`);
10
- try {
11
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
12
- method: "GET",
13
- headers: {
14
- "Content-Type": "application/json",
15
- },
16
- path: `/projects/${requestProjectNumber}/apps/${appId}/issues/${issueId}`,
17
- timeout: utils_1.TIMEOUT,
18
- });
19
- return response.body;
20
- }
21
- catch (err) {
22
- logger_1.logger.debug(err.message);
23
- throw new error_1.FirebaseError(`Failed to fetch the issue details for the Firebase AppId ${appId}, IssueId ${issueId}. Error: ${err}.`, { original: err });
24
- }
25
- }
26
- exports.getIssueDetails = getIssueDetails;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSampleCrash = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function getSampleCrash(appId, issueId, sampleCount, variantId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- logger_1.logger.debug(`[mcp][crashlytics] getSampleCrash called with appId: ${appId}, issueId: ${issueId}, sampleCount: ${sampleCount}, variantId: ${variantId}`);
10
- try {
11
- const queryParams = new URLSearchParams();
12
- queryParams.set("filter.issue.id", issueId);
13
- queryParams.set("page_size", String(sampleCount));
14
- if (variantId) {
15
- queryParams.set("filter.issue.variant_id", variantId);
16
- }
17
- logger_1.logger.debug(`[mcp][crashlytics] getSampleCrash query paramaters: ${queryParams}`);
18
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
19
- method: "GET",
20
- headers: {
21
- "Content-Type": "application/json",
22
- },
23
- path: `/projects/${requestProjectNumber}/apps/${appId}/events`,
24
- queryParams: queryParams,
25
- timeout: utils_1.TIMEOUT,
26
- });
27
- return response.body;
28
- }
29
- catch (err) {
30
- logger_1.logger.debug(err.message);
31
- throw new error_1.FirebaseError(`Failed to fetch the same crash for the Firebase AppId ${appId}, IssueId ${issueId}. Error: ${err}.`, { original: err });
32
- }
33
- }
34
- exports.getSampleCrash = getSampleCrash;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listTopDevices = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function listTopDevices(appId, deviceCount, issueId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- const platformPath = (0, utils_1.parsePlatform)(appId);
10
- try {
11
- const queryParams = new URLSearchParams();
12
- queryParams.set("page_size", `${deviceCount}`);
13
- if (issueId) {
14
- queryParams.set("filter.issue.id", issueId);
15
- }
16
- logger_1.logger.debug(`[mcp][crashlytics] listTopDevices called with appId: ${appId}, deviceCount: ${deviceCount}, issueId: ${issueId}`);
17
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
18
- method: "GET",
19
- headers: {
20
- "Content-Type": "application/json",
21
- },
22
- path: `/projects/${requestProjectNumber}/apps/${appId}/reports/${platformPath}`,
23
- queryParams: queryParams,
24
- timeout: utils_1.TIMEOUT,
25
- });
26
- return response.body;
27
- }
28
- catch (err) {
29
- logger_1.logger.debug(err.message);
30
- throw new error_1.FirebaseError(`Failed to fetch the top devices for the Firebase app id: ${appId}. Error: ${err}.`, { original: err });
31
- }
32
- }
33
- exports.listTopDevices = listTopDevices;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listTopIssues = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function listTopIssues(appId, issueType, issueCount) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- try {
10
- const queryParams = new URLSearchParams();
11
- queryParams.set("page_size", `${issueCount}`);
12
- queryParams.set("filter.issue.error_types", `${issueType}`);
13
- logger_1.logger.debug(`[mcp][crashlytics] listTopIssues called with appId: ${appId}, issueType: ${issueType}, issueCount: ${issueCount}`);
14
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
15
- method: "GET",
16
- headers: {
17
- "Content-Type": "application/json",
18
- },
19
- path: `/projects/${requestProjectNumber}/apps/${appId}/reports/topIssues`,
20
- queryParams: queryParams,
21
- timeout: utils_1.TIMEOUT,
22
- });
23
- return response.body;
24
- }
25
- catch (err) {
26
- logger_1.logger.debug(err.message);
27
- throw new error_1.FirebaseError(`Failed to fetch the top issues for the Firebase app id: ${appId}. Error: ${err}.`, { original: err });
28
- }
29
- }
30
- exports.listTopIssues = listTopIssues;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listTopOperatingSystems = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function listTopOperatingSystems(appId, osCount, issueId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- try {
10
- const queryParams = new URLSearchParams();
11
- queryParams.set("page_size", `${osCount}`);
12
- if (issueId) {
13
- queryParams.set("filter.issue.id", issueId);
14
- }
15
- logger_1.logger.debug(`[mcp][crashlytics] listTopOperatingSystems called with appId: ${appId}, osCount: ${osCount}, issueId: ${issueId}`);
16
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
17
- method: "GET",
18
- headers: {
19
- "Content-Type": "application/json",
20
- },
21
- path: `/projects/${requestProjectNumber}/apps/${appId}/reports/topOperatingSystems`,
22
- queryParams: queryParams,
23
- timeout: utils_1.TIMEOUT,
24
- });
25
- return response.body;
26
- }
27
- catch (err) {
28
- logger_1.logger.debug(err.message);
29
- throw new error_1.FirebaseError(`Failed to fetch the top operating systems for the Firebase app id: ${appId}. Error: ${err}.`, { original: err });
30
- }
31
- }
32
- exports.listTopOperatingSystems = listTopOperatingSystems;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listTopVersions = void 0;
4
- const logger_1 = require("../logger");
5
- const error_1 = require("../error");
6
- const utils_1 = require("./utils");
7
- async function listTopVersions(appId, versionCount, issueId) {
8
- const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
9
- try {
10
- const queryParams = new URLSearchParams();
11
- queryParams.set("page_size", `${versionCount}`);
12
- if (issueId) {
13
- queryParams.set("filter.issue.id", issueId);
14
- }
15
- logger_1.logger.debug(`[mcp][crashlytics] listTopVersions called with appId: ${appId}, versionCount: ${versionCount}, issueId: ${issueId}`);
16
- const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
17
- method: "GET",
18
- headers: {
19
- "Content-Type": "application/json",
20
- },
21
- path: `/projects/${requestProjectNumber}/apps/${appId}/reports/topVersions`,
22
- queryParams: queryParams,
23
- timeout: utils_1.TIMEOUT,
24
- });
25
- return response.body;
26
- }
27
- catch (err) {
28
- logger_1.logger.debug(err.message);
29
- throw new error_1.FirebaseError(`Failed to fetch the top versions for the Firebase app id: ${appId}. Error: ${err}.`, { original: err });
30
- }
31
- }
32
- exports.listTopVersions = listTopVersions;