firebase-tools 14.15.1 → 14.16.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 (63) hide show
  1. package/lib/commands/dataconnect-sdk-generate.js +28 -24
  2. package/lib/commands/firestore-bulkdelete.js +73 -0
  3. package/lib/commands/firestore-operations-cancel.js +44 -0
  4. package/lib/commands/firestore-operations-describe.js +29 -0
  5. package/lib/commands/firestore-operations-list.js +29 -0
  6. package/lib/commands/firestore-utils.js +15 -0
  7. package/lib/commands/functions-config-export.js +5 -2
  8. package/lib/commands/index.js +5 -0
  9. package/lib/config.js +16 -4
  10. package/lib/dataconnect/ensureApis.js +3 -3
  11. package/lib/deploy/functions/build.js +2 -13
  12. package/lib/deploy/functions/deploy.js +4 -3
  13. package/lib/deploy/functions/prepare.js +10 -7
  14. package/lib/deploy/functions/runtimes/discovery/index.js +1 -1
  15. package/lib/emulator/auth/operations.js +10 -1
  16. package/lib/emulator/commandUtils.js +7 -1
  17. package/lib/emulator/controller.js +15 -31
  18. package/lib/emulator/dataconnectEmulator.js +27 -24
  19. package/lib/emulator/downloadableEmulatorInfo.json +18 -18
  20. package/lib/emulator/functionsEmulator.js +1 -1
  21. package/lib/emulator/hub.js +9 -5
  22. package/lib/extensions/runtimes/common.js +3 -2
  23. package/lib/firestore/api.js +45 -0
  24. package/lib/firestore/pretty-print.js +23 -0
  25. package/lib/functions/env.js +12 -1
  26. package/lib/functions/projectConfig.js +69 -9
  27. package/lib/gcp/cloudfunctions.js +1 -6
  28. package/lib/gcp/cloudfunctionsv2.js +1 -9
  29. package/lib/gcp/cloudsql/cloudsqladmin.js +2 -2
  30. package/lib/init/features/dataconnect/create_app.js +7 -2
  31. package/lib/init/features/dataconnect/index.js +72 -56
  32. package/lib/init/features/dataconnect/sdk.js +23 -11
  33. package/lib/mcp/errors.js +2 -10
  34. package/lib/mcp/index.js +1 -4
  35. package/lib/mcp/prompts/core/deploy.js +1 -1
  36. package/lib/mcp/prompts/crashlytics/connect.js +114 -0
  37. package/lib/mcp/prompts/crashlytics/index.js +2 -3
  38. package/lib/mcp/tools/auth/disable_user.js +1 -1
  39. package/lib/mcp/tools/auth/get_user.js +9 -2
  40. package/lib/mcp/tools/core/index.js +4 -0
  41. package/lib/mcp/tools/core/init.js +11 -2
  42. package/lib/mcp/tools/core/login.js +46 -0
  43. package/lib/mcp/tools/core/logout.js +62 -0
  44. package/lib/mcp/tools/dataconnect/execute.js +71 -0
  45. package/lib/mcp/tools/dataconnect/index.js +3 -13
  46. package/lib/mcp/tools/dataconnect/list_services.js +104 -7
  47. package/lib/mcp/util.js +1 -17
  48. package/lib/serve/functions.js +4 -3
  49. package/lib/track.js +16 -0
  50. package/lib/unzip.js +13 -0
  51. package/lib/utils.js +17 -1
  52. package/package.json +1 -1
  53. package/schema/firebase-config.json +160 -59
  54. package/lib/mcp/prompts/crashlytics/common.js +0 -10
  55. package/lib/mcp/prompts/crashlytics/fix_issue.js +0 -89
  56. package/lib/mcp/prompts/crashlytics/prioritize_issues.js +0 -79
  57. package/lib/mcp/tools/database/set_rules.js +0 -41
  58. package/lib/mcp/tools/dataconnect/execute_graphql.js +0 -48
  59. package/lib/mcp/tools/dataconnect/execute_graphql_read.js +0 -48
  60. package/lib/mcp/tools/dataconnect/execute_mutation.js +0 -62
  61. package/lib/mcp/tools/dataconnect/execute_query.js +0 -62
  62. package/lib/mcp/tools/dataconnect/get_connector.js +0 -31
  63. package/lib/mcp/tools/dataconnect/get_schema.js +0 -31
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execute_query = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const dataplane = require("../../../dataconnect/dataplaneClient");
8
- const load_1 = require("../../../dataconnect/load");
9
- const converter_1 = require("../../util/dataconnect/converter");
10
- const emulator_1 = require("../../util/dataconnect/emulator");
11
- exports.execute_query = (0, tool_1.tool)({
12
- name: "execute_query",
13
- description: "Executes a deployed Data Connect query against a service or its emulator. Cannot write any data.",
14
- inputSchema: zod_1.z.object({
15
- operationName: zod_1.z.string().describe("The name of the deployed operation you want to execute"),
16
- service_id: zod_1.z
17
- .string()
18
- .nullable()
19
- .describe("The Firebase Data Connect service ID to look for. If there is only one service defined in firebase.json, this can be omitted and that will be used."),
20
- connector_id: zod_1.z
21
- .string()
22
- .nullable()
23
- .describe("The Firebase Data Connect connector ID to look for. If there is only one connector defined in dataconnect.yaml, this can be omitted and that will be used."),
24
- variables: zod_1.z
25
- .string()
26
- .optional()
27
- .describe("A stringified JSON object containing the variables needed to execute the operation. The value MUST be able to be parsed as a JSON object."),
28
- use_emulator: zod_1.z.boolean().default(false).describe("Target the DataConnect emulator if true."),
29
- }),
30
- annotations: {
31
- title: "Executes a deployed Data Connect query.",
32
- readOnlyHint: true,
33
- },
34
- _meta: {
35
- requiresProject: true,
36
- requiresAuth: true,
37
- },
38
- }, async ({ operationName, service_id, connector_id, variables: unparsedVariables, use_emulator }, { projectId, config, host }) => {
39
- const serviceInfo = await (0, load_1.pickService)(projectId, config, service_id || undefined);
40
- let apiClient;
41
- if (!connector_id) {
42
- if (serviceInfo.connectorInfo.length === 0) {
43
- return (0, util_1.mcpError)(`Service ${serviceInfo.serviceName} has no connectors`, "NO_CONNECTORS_FOUND");
44
- }
45
- if (serviceInfo.connectorInfo.length > 1) {
46
- return (0, util_1.mcpError)(`Service ${serviceInfo.serviceName} has more than one connector. Please use the connector_id argument to specify which connector this operation is part of.`, "MULTIPLE_CONNECTORS_FOUND");
47
- }
48
- connector_id = serviceInfo.connectorInfo[0].connectorYaml.connectorId;
49
- }
50
- const connectorPath = `${serviceInfo.serviceName}/connectors/${connector_id}`;
51
- if (use_emulator) {
52
- apiClient = await (0, emulator_1.getDataConnectEmulatorClient)(host);
53
- }
54
- else {
55
- apiClient = dataplane.dataconnectDataplaneClient();
56
- }
57
- const response = await dataplane.executeGraphQLQuery(apiClient, connectorPath, {
58
- operationName,
59
- variables: (0, converter_1.parseVariables)(unparsedVariables),
60
- });
61
- return (0, converter_1.graphqlResponseToToolResponse)(response.body);
62
- });
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_connectors = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const client = require("../../../dataconnect/client");
8
- const load_1 = require("../../../dataconnect/load");
9
- const converter_1 = require("../../util/dataconnect/converter");
10
- exports.get_connectors = (0, tool_1.tool)({
11
- name: "get_connectors",
12
- description: "Get the Firebase Data Connect Connectors in the project, which includes the pre-defined GraphQL queries accessible to client SDKs.",
13
- inputSchema: zod_1.z.object({
14
- service_id: zod_1.z
15
- .string()
16
- .nullable()
17
- .describe("The Firebase Data Connect service ID to look for. If there is only one service defined in firebase.json, this can be omitted and that will be used."),
18
- }),
19
- annotations: {
20
- title: "Get Data Connect Connectors",
21
- readOnlyHint: true,
22
- },
23
- _meta: {
24
- requiresProject: true,
25
- requiresAuth: true,
26
- },
27
- }, async ({ service_id }, { projectId, config }) => {
28
- const serviceInfo = await (0, load_1.pickService)(projectId, config, service_id || undefined);
29
- const connectors = await client.listConnectors(serviceInfo.serviceName, ["*"]);
30
- return (0, util_1.toContent)(connectors.map(converter_1.connectorToText).join("\n\n"));
31
- });
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_schema = void 0;
4
- const zod_1 = require("zod");
5
- const tool_1 = require("../../tool");
6
- const util_1 = require("../../util");
7
- const client = require("../../../dataconnect/client");
8
- const load_1 = require("../../../dataconnect/load");
9
- const converter_1 = require("../../util/dataconnect/converter");
10
- exports.get_schema = (0, tool_1.tool)({
11
- name: "get_schema",
12
- description: "Retrieve information about the Firebase Data Connect Schema in the project, including Cloud SQL data sources and the GraphQL Schema describing the data model.",
13
- inputSchema: zod_1.z.object({
14
- service_id: zod_1.z
15
- .string()
16
- .nullable()
17
- .describe("The Firebase Data Connect service ID to look for. If there is only one service defined in firebase.json, this can be omitted and that will be used."),
18
- }),
19
- annotations: {
20
- title: "Get Data Connect Schemas",
21
- readOnlyHint: true,
22
- },
23
- _meta: {
24
- requiresProject: true,
25
- requiresAuth: true,
26
- },
27
- }, async ({ service_id }, { projectId, config }) => {
28
- const serviceInfo = await (0, load_1.pickService)(projectId, config, service_id || undefined);
29
- const schemas = await client.listSchemas(serviceInfo.serviceName, ["*"]);
30
- return (0, util_1.toContent)(schemas === null || schemas === void 0 ? void 0 : schemas.map(converter_1.schemaToText).join("\n\n"));
31
- });