firebase-tools 14.11.1 → 14.11.2

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 (58) hide show
  1. package/lib/apptesting/ensureProjectConfigured.js +4 -3
  2. package/lib/commands/ext-export.js +1 -1
  3. package/lib/commands/login.js +2 -2
  4. package/lib/deploy/functions/params.js +4 -0
  5. package/lib/mcp/errors.js +7 -1
  6. package/lib/mcp/index.js +46 -45
  7. package/lib/mcp/tools/apphosting/fetch_logs.js +22 -22
  8. package/lib/mcp/tools/apphosting/list_backends.js +10 -10
  9. package/lib/mcp/tools/auth/disable_user.js +7 -7
  10. package/lib/mcp/tools/auth/get_user.js +6 -6
  11. package/lib/mcp/tools/auth/index.js +10 -10
  12. package/lib/mcp/tools/auth/list_users.js +6 -6
  13. package/lib/mcp/tools/auth/set_claims.js +7 -7
  14. package/lib/mcp/tools/auth/set_sms_region_policy.js +6 -6
  15. package/lib/mcp/tools/core/consult_assistant.js +6 -6
  16. package/lib/mcp/tools/core/create_android_sha.js +9 -9
  17. package/lib/mcp/tools/core/create_app.js +7 -7
  18. package/lib/mcp/tools/core/create_project.js +13 -13
  19. package/lib/mcp/tools/core/get_admin_sdk_config.js +7 -7
  20. package/lib/mcp/tools/core/get_environment.js +8 -8
  21. package/lib/mcp/tools/core/get_project.js +5 -5
  22. package/lib/mcp/tools/core/get_sdk_config.js +9 -9
  23. package/lib/mcp/tools/core/index.js +24 -24
  24. package/lib/mcp/tools/core/init.js +8 -8
  25. package/lib/mcp/tools/core/list_apps.js +6 -6
  26. package/lib/mcp/tools/core/list_projects.js +6 -6
  27. package/lib/mcp/tools/core/update_environment.js +10 -10
  28. package/lib/mcp/tools/crashlytics/index.js +2 -2
  29. package/lib/mcp/tools/crashlytics/list_top_issues.js +6 -6
  30. package/lib/mcp/tools/dataconnect/emulator.js +6 -6
  31. package/lib/mcp/tools/dataconnect/execute_graphql.js +10 -10
  32. package/lib/mcp/tools/dataconnect/execute_graphql_read.js +10 -10
  33. package/lib/mcp/tools/dataconnect/execute_mutation.js +13 -13
  34. package/lib/mcp/tools/dataconnect/execute_query.js +13 -13
  35. package/lib/mcp/tools/dataconnect/generate_operation.js +8 -8
  36. package/lib/mcp/tools/dataconnect/generate_schema.js +6 -6
  37. package/lib/mcp/tools/dataconnect/get_connector.js +8 -8
  38. package/lib/mcp/tools/dataconnect/get_schema.js +8 -8
  39. package/lib/mcp/tools/dataconnect/index.js +18 -18
  40. package/lib/mcp/tools/dataconnect/list_services.js +5 -5
  41. package/lib/mcp/tools/firestore/delete_document.js +13 -13
  42. package/lib/mcp/tools/firestore/get_documents.js +13 -13
  43. package/lib/mcp/tools/firestore/list_collections.js +9 -9
  44. package/lib/mcp/tools/firestore/query_collection.js +13 -13
  45. package/lib/mcp/tools/index.js +18 -18
  46. package/lib/mcp/tools/messaging/index.js +2 -2
  47. package/lib/mcp/tools/messaging/send_message.js +7 -7
  48. package/lib/mcp/tools/remoteconfig/get_template.js +5 -5
  49. package/lib/mcp/tools/remoteconfig/index.js +4 -4
  50. package/lib/mcp/tools/remoteconfig/publish_template.js +7 -7
  51. package/lib/mcp/tools/remoteconfig/rollback_template.js +6 -6
  52. package/lib/mcp/tools/rules/get_rules.js +8 -8
  53. package/lib/mcp/tools/rules/validate_rules.js +10 -10
  54. package/lib/mcp/tools/storage/get_download_url.js +8 -8
  55. package/lib/mcp/tools/storage/get_rules.js +8 -8
  56. package/package.json +1 -1
  57. package/templates/init/dataconnect/mutations.gql +1 -1
  58. package/templates/init/dataconnect/queries.gql +3 -3
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.execute_query = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const dataplane = require("../../../dataconnect/dataplaneClient.js");
8
- const fileUtils_js_1 = require("../../../dataconnect/fileUtils.js");
9
- const converter_js_1 = require("./converter.js");
10
- const emulator_js_1 = require("./emulator.js");
11
- exports.execute_query = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const dataplane = require("../../../dataconnect/dataplaneClient");
8
+ const fileUtils_1 = require("../../../dataconnect/fileUtils");
9
+ const converter_1 = require("./converter");
10
+ const emulator_1 = require("./emulator");
11
+ exports.execute_query = (0, tool_1.tool)({
12
12
  name: "execute_query",
13
13
  description: "Executes a deployed Data Connect query against a service or its emulator. Cannot write any data.",
14
14
  inputSchema: zod_1.z.object({
@@ -36,27 +36,27 @@ exports.execute_query = (0, tool_js_1.tool)({
36
36
  requiresAuth: true,
37
37
  },
38
38
  }, async ({ operationName, service_id, connector_id, variables: unparsedVariables, use_emulator }, { projectId, config, host }) => {
39
- const serviceInfo = await (0, fileUtils_js_1.pickService)(projectId, config, service_id || undefined);
39
+ const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
40
40
  let apiClient;
41
41
  if (!connector_id) {
42
42
  if (serviceInfo.connectorInfo.length === 0) {
43
- return (0, util_js_1.mcpError)(`Service ${serviceInfo.serviceName} has no connectors`, "NO_CONNECTORS_FOUND");
43
+ return (0, util_1.mcpError)(`Service ${serviceInfo.serviceName} has no connectors`, "NO_CONNECTORS_FOUND");
44
44
  }
45
45
  if (serviceInfo.connectorInfo.length > 1) {
46
- return (0, util_js_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");
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
47
  }
48
48
  connector_id = serviceInfo.connectorInfo[0].connectorYaml.connectorId;
49
49
  }
50
50
  const connectorPath = `${serviceInfo.serviceName}/connectors/${connector_id}`;
51
51
  if (use_emulator) {
52
- apiClient = await (0, emulator_js_1.getDataConnectEmulatorClient)(host);
52
+ apiClient = await (0, emulator_1.getDataConnectEmulatorClient)(host);
53
53
  }
54
54
  else {
55
55
  apiClient = dataplane.dataconnectDataplaneClient();
56
56
  }
57
57
  const response = await dataplane.executeGraphQLQuery(apiClient, connectorPath, {
58
58
  operationName,
59
- variables: (0, converter_js_1.parseVariables)(unparsedVariables),
59
+ variables: (0, converter_1.parseVariables)(unparsedVariables),
60
60
  });
61
- return (0, converter_js_1.graphqlResponseToToolResponse)(response.body);
61
+ return (0, converter_1.graphqlResponseToToolResponse)(response.body);
62
62
  });
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate_operation = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const fdcExperience_js_1 = require("../../../gemini/fdcExperience.js");
8
- const fileUtils_js_1 = require("../../../dataconnect/fileUtils.js");
9
- exports.generate_operation = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const fdcExperience_1 = require("../../../gemini/fdcExperience");
8
+ const fileUtils_1 = require("../../../dataconnect/fileUtils");
9
+ exports.generate_operation = (0, tool_1.tool)({
10
10
  name: "generate_operation",
11
11
  description: "Generates a single Firebase Data Connect query or mutation based on the currently deployed schema and the provided prompt.",
12
12
  inputSchema: zod_1.z.object({
@@ -28,7 +28,7 @@ exports.generate_operation = (0, tool_js_1.tool)({
28
28
  requiresGemini: true,
29
29
  },
30
30
  }, async ({ prompt, service_id }, { projectId, config }) => {
31
- const serviceInfo = await (0, fileUtils_js_1.pickService)(projectId, config, service_id || undefined);
32
- const schema = await (0, fdcExperience_js_1.generateOperation)(prompt, serviceInfo.serviceName, projectId);
33
- return (0, util_js_1.toContent)(schema);
31
+ const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
32
+ const schema = await (0, fdcExperience_1.generateOperation)(prompt, serviceInfo.serviceName, projectId);
33
+ return (0, util_1.toContent)(schema);
34
34
  });
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generate_schema = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const fdcExperience_js_1 = require("../../../gemini/fdcExperience.js");
8
- exports.generate_schema = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const fdcExperience_1 = require("../../../gemini/fdcExperience");
8
+ exports.generate_schema = (0, tool_1.tool)({
9
9
  name: "generate_schema",
10
10
  description: "Generates a Firebase Data Connect Schema based on the users description of an app.",
11
11
  inputSchema: zod_1.z.object({
@@ -21,6 +21,6 @@ exports.generate_schema = (0, tool_js_1.tool)({
21
21
  requiresGemini: true,
22
22
  },
23
23
  }, async ({ prompt }, { projectId }) => {
24
- const schema = await (0, fdcExperience_js_1.generateSchema)(prompt, projectId);
25
- return (0, util_js_1.toContent)(schema);
24
+ const schema = await (0, fdcExperience_1.generateSchema)(prompt, projectId);
25
+ return (0, util_1.toContent)(schema);
26
26
  });
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_connectors = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const client = require("../../../dataconnect/client.js");
8
- const fileUtils_js_1 = require("../../../dataconnect/fileUtils.js");
9
- const converter_js_1 = require("./converter.js");
10
- exports.get_connectors = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const client = require("../../../dataconnect/client");
8
+ const fileUtils_1 = require("../../../dataconnect/fileUtils");
9
+ const converter_1 = require("./converter");
10
+ exports.get_connectors = (0, tool_1.tool)({
11
11
  name: "get_connectors",
12
12
  description: "Get the Firebase Data Connect Connectors in the project, which includes the pre-defined GraphQL queries accessible to client SDKs.",
13
13
  inputSchema: zod_1.z.object({
@@ -25,7 +25,7 @@ exports.get_connectors = (0, tool_js_1.tool)({
25
25
  requiresAuth: true,
26
26
  },
27
27
  }, async ({ service_id }, { projectId, config }) => {
28
- const serviceInfo = await (0, fileUtils_js_1.pickService)(projectId, config, service_id || undefined);
28
+ const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
29
29
  const connectors = await client.listConnectors(serviceInfo.serviceName, ["*"]);
30
- return (0, util_js_1.toContent)(connectors.map(converter_js_1.connectorToText).join("\n\n"));
30
+ return (0, util_1.toContent)(connectors.map(converter_1.connectorToText).join("\n\n"));
31
31
  });
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_schema = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const client = require("../../../dataconnect/client.js");
8
- const fileUtils_js_1 = require("../../../dataconnect/fileUtils.js");
9
- const converter_js_1 = require("./converter.js");
10
- exports.get_schema = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const client = require("../../../dataconnect/client");
8
+ const fileUtils_1 = require("../../../dataconnect/fileUtils");
9
+ const converter_1 = require("./converter");
10
+ exports.get_schema = (0, tool_1.tool)({
11
11
  name: "get_schema",
12
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
13
  inputSchema: zod_1.z.object({
@@ -25,7 +25,7 @@ exports.get_schema = (0, tool_js_1.tool)({
25
25
  requiresAuth: true,
26
26
  },
27
27
  }, async ({ service_id }, { projectId, config }) => {
28
- const serviceInfo = await (0, fileUtils_js_1.pickService)(projectId, config, service_id || undefined);
28
+ const serviceInfo = await (0, fileUtils_1.pickService)(projectId, config, service_id || undefined);
29
29
  const schemas = await client.listSchemas(serviceInfo.serviceName, ["*"]);
30
- return (0, util_js_1.toContent)(schemas === null || schemas === void 0 ? void 0 : schemas.map(converter_js_1.schemaToText).join("\n\n"));
30
+ return (0, util_1.toContent)(schemas === null || schemas === void 0 ? void 0 : schemas.map(converter_1.schemaToText).join("\n\n"));
31
31
  });
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dataconnectTools = void 0;
4
- const generate_operation_js_1 = require("./generate_operation.js");
5
- const generate_schema_js_1 = require("./generate_schema.js");
6
- const list_services_js_1 = require("./list_services.js");
7
- const get_schema_js_1 = require("./get_schema.js");
8
- const get_connector_js_1 = require("./get_connector.js");
9
- const execute_graphql_js_1 = require("./execute_graphql.js");
10
- const execute_graphql_read_js_1 = require("./execute_graphql_read.js");
11
- const execute_query_js_1 = require("./execute_query.js");
12
- const execute_mutation_js_1 = require("./execute_mutation.js");
4
+ const generate_operation_1 = require("./generate_operation");
5
+ const generate_schema_1 = require("./generate_schema");
6
+ const list_services_1 = require("./list_services");
7
+ const get_schema_1 = require("./get_schema");
8
+ const get_connector_1 = require("./get_connector");
9
+ const execute_graphql_1 = require("./execute_graphql");
10
+ const execute_graphql_read_1 = require("./execute_graphql_read");
11
+ const execute_query_1 = require("./execute_query");
12
+ const execute_mutation_1 = require("./execute_mutation");
13
13
  exports.dataconnectTools = [
14
- list_services_js_1.list_services,
15
- generate_schema_js_1.generate_schema,
16
- generate_operation_js_1.generate_operation,
17
- get_schema_js_1.get_schema,
18
- get_connector_js_1.get_connectors,
19
- execute_graphql_js_1.execute_graphql,
20
- execute_graphql_read_js_1.execute_graphql_read,
21
- execute_mutation_js_1.execute_mutation,
22
- execute_query_js_1.execute_query,
14
+ list_services_1.list_services,
15
+ generate_schema_1.generate_schema,
16
+ generate_operation_1.generate_operation,
17
+ get_schema_1.get_schema,
18
+ get_connector_1.get_connectors,
19
+ execute_graphql_1.execute_graphql,
20
+ execute_graphql_read_1.execute_graphql_read,
21
+ execute_mutation_1.execute_mutation,
22
+ execute_query_1.execute_query,
23
23
  ];
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.list_services = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const client = require("../../../dataconnect/client.js");
8
- exports.list_services = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const client = require("../../../dataconnect/client");
8
+ exports.list_services = (0, tool_1.tool)({
9
9
  name: "list_services",
10
10
  description: "List the Firebase Data Connect services available in the current project.",
11
11
  inputSchema: zod_1.z.object({}),
@@ -19,5 +19,5 @@ exports.list_services = (0, tool_js_1.tool)({
19
19
  },
20
20
  }, async (_, { projectId }) => {
21
21
  const services = await client.listAllServices(projectId);
22
- return (0, util_js_1.toContent)(services, { format: "yaml" });
22
+ return (0, util_1.toContent)(services, { format: "yaml" });
23
23
  });
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.delete_document = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const firestore_js_1 = require("../../../gcp/firestore.js");
8
- const delete_js_1 = require("../../../firestore/delete.js");
9
- const types_js_1 = require("../../../emulator/types.js");
10
- exports.delete_document = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const firestore_1 = require("../../../gcp/firestore");
8
+ const delete_1 = require("../../../firestore/delete");
9
+ const types_1 = require("../../../emulator/types");
10
+ exports.delete_document = (0, tool_1.tool)({
11
11
  name: "delete_document",
12
12
  description: "Deletes a Firestore documents from a database in the current project by full document paths. Use this if you know the exact path of a document.",
13
13
  inputSchema: zod_1.z.object({
@@ -31,20 +31,20 @@ exports.delete_document = (0, tool_js_1.tool)({
31
31
  }, async ({ path, database, use_emulator }, { projectId, host }) => {
32
32
  let emulatorUrl;
33
33
  if (use_emulator) {
34
- emulatorUrl = await host.getEmulatorUrl(types_js_1.Emulators.FIRESTORE);
34
+ emulatorUrl = await host.getEmulatorUrl(types_1.Emulators.FIRESTORE);
35
35
  }
36
- const { documents, missing } = await (0, firestore_js_1.getDocuments)(projectId, [path], database, emulatorUrl);
36
+ const { documents, missing } = await (0, firestore_1.getDocuments)(projectId, [path], database, emulatorUrl);
37
37
  if (missing.length > 0 && documents && documents.length === 0) {
38
- return (0, util_js_1.mcpError)(`None of the specified documents were found in project '${projectId}'`);
38
+ return (0, util_1.mcpError)(`None of the specified documents were found in project '${projectId}'`);
39
39
  }
40
- const firestoreDelete = new delete_js_1.FirestoreDelete(projectId, path, {
40
+ const firestoreDelete = new delete_1.FirestoreDelete(projectId, path, {
41
41
  databaseId: database !== null && database !== void 0 ? database : "(default)",
42
42
  urlPrefix: emulatorUrl,
43
43
  });
44
44
  await firestoreDelete.execute();
45
- const { documents: postDeleteDocuments, missing: postDeleteMissing } = await (0, firestore_js_1.getDocuments)(projectId, [path], emulatorUrl);
45
+ const { documents: postDeleteDocuments, missing: postDeleteMissing } = await (0, firestore_1.getDocuments)(projectId, [path], emulatorUrl);
46
46
  if (postDeleteMissing.length > 0 && postDeleteDocuments.length === 0) {
47
- return (0, util_js_1.toContent)(`Successfully removed document located at : ${path}`);
47
+ return (0, util_1.toContent)(`Successfully removed document located at : ${path}`);
48
48
  }
49
- return (0, util_js_1.mcpError)(`Failed to remove document located at : ${path}`);
49
+ return (0, util_1.mcpError)(`Failed to remove document located at : ${path}`);
50
50
  });
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_documents = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const firestore_js_1 = require("../../../gcp/firestore.js");
8
- const converter_js_1 = require("./converter.js");
9
- const types_js_1 = require("../../../emulator/types.js");
10
- exports.get_documents = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const firestore_1 = require("../../../gcp/firestore");
8
+ const converter_1 = require("./converter");
9
+ const types_1 = require("../../../emulator/types");
10
+ exports.get_documents = (0, tool_1.tool)({
11
11
  name: "get_documents",
12
12
  description: "Retrieves one or more Firestore documents from a database in the current project by full document paths. Use this if you know the exact path of a document.",
13
13
  inputSchema: zod_1.z.object({
@@ -30,20 +30,20 @@ exports.get_documents = (0, tool_js_1.tool)({
30
30
  },
31
31
  }, async ({ paths, database, use_emulator }, { projectId, host }) => {
32
32
  if (!paths || !paths.length)
33
- return (0, util_js_1.mcpError)("Must supply at least one document path.");
33
+ return (0, util_1.mcpError)("Must supply at least one document path.");
34
34
  let emulatorUrl;
35
35
  if (use_emulator) {
36
- emulatorUrl = await host.getEmulatorUrl(types_js_1.Emulators.FIRESTORE);
36
+ emulatorUrl = await host.getEmulatorUrl(types_1.Emulators.FIRESTORE);
37
37
  }
38
- const { documents, missing } = await (0, firestore_js_1.getDocuments)(projectId, paths, database, emulatorUrl);
38
+ const { documents, missing } = await (0, firestore_1.getDocuments)(projectId, paths, database, emulatorUrl);
39
39
  if (missing.length > 0 && documents && documents.length === 0) {
40
- return (0, util_js_1.mcpError)(`None of the specified documents were found in project '${projectId}'`);
40
+ return (0, util_1.mcpError)(`None of the specified documents were found in project '${projectId}'`);
41
41
  }
42
- const docs = documents.map(converter_js_1.firestoreDocumentToJson);
42
+ const docs = documents.map(converter_1.firestoreDocumentToJson);
43
43
  if (documents.length === 1 && missing.length === 0) {
44
- return (0, util_js_1.toContent)(docs[0]);
44
+ return (0, util_1.toContent)(docs[0]);
45
45
  }
46
- const docsContent = (0, util_js_1.toContent)(docs);
46
+ const docsContent = (0, util_1.toContent)(docs);
47
47
  if (missing.length) {
48
48
  docsContent.content = [
49
49
  { type: "text", text: "Retrieved documents:\n\n" },
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.list_collections = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const firestore_js_1 = require("../../../gcp/firestore.js");
8
- const errors_js_1 = require("../../errors.js");
9
- const types_js_1 = require("../../../emulator/types.js");
10
- exports.list_collections = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const firestore_1 = require("../../../gcp/firestore");
8
+ const errors_1 = require("../../errors");
9
+ const types_1 = require("../../../emulator/types");
10
+ exports.list_collections = (0, tool_1.tool)({
11
11
  name: "list_collections",
12
12
  description: "Retrieves a list of collections from a Firestore database in the current project.",
13
13
  inputSchema: zod_1.z.object({
@@ -28,9 +28,9 @@ exports.list_collections = (0, tool_js_1.tool)({
28
28
  }, async ({ database, use_emulator }, { projectId, host }) => {
29
29
  let emulatorUrl;
30
30
  if (use_emulator) {
31
- emulatorUrl = await host.getEmulatorUrl(types_js_1.Emulators.FIRESTORE);
31
+ emulatorUrl = await host.getEmulatorUrl(types_1.Emulators.FIRESTORE);
32
32
  }
33
33
  if (!projectId)
34
- return errors_js_1.NO_PROJECT_ERROR;
35
- return (0, util_js_1.toContent)(await (0, firestore_js_1.listCollectionIds)(projectId, database, emulatorUrl));
34
+ return errors_1.NO_PROJECT_ERROR;
35
+ return (0, util_1.toContent)(await (0, firestore_1.listCollectionIds)(projectId, database, emulatorUrl));
36
36
  });
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.query_collection = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const firestore_js_1 = require("../../../gcp/firestore.js");
8
- const converter_js_1 = require("./converter.js");
9
- const types_js_1 = require("../../../emulator/types.js");
10
- exports.query_collection = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const firestore_1 = require("../../../gcp/firestore");
8
+ const converter_1 = require("./converter");
9
+ const types_1 = require("../../../emulator/types");
10
+ exports.query_collection = (0, tool_1.tool)({
11
11
  name: "query_collection",
12
12
  description: "Retrieves one or more Firestore documents from a collection is a database in the current project by a collection with a full document path. Use this if you know the exact path of a collection and the filtering clause you would like for the document.",
13
13
  inputSchema: zod_1.z.object({
@@ -82,7 +82,7 @@ exports.query_collection = (0, tool_js_1.tool)({
82
82
  },
83
83
  }, async ({ collection_path, filters, order, limit, database, use_emulator }, { projectId, host }) => {
84
84
  if (!collection_path || !collection_path.length)
85
- return (0, util_js_1.mcpError)("Must supply at least one collection path.");
85
+ return (0, util_1.mcpError)("Must supply at least one collection path.");
86
86
  const structuredQuery = {
87
87
  from: [{ collectionId: collection_path, allDescendants: false }],
88
88
  };
@@ -96,7 +96,7 @@ exports.query_collection = (0, tool_js_1.tool)({
96
96
  f.compare_value.integer_value &&
97
97
  f.compare_value.string_array_value &&
98
98
  f.compare_value.string_value) {
99
- throw (0, util_js_1.mcpError)("One and only one value may be specified per filters object.");
99
+ throw (0, util_1.mcpError)("One and only one value may be specified per filters object.");
100
100
  }
101
101
  const out = Object.entries(f.compare_value).filter(([, value]) => {
102
102
  return value !== null && value !== undefined;
@@ -105,7 +105,7 @@ exports.query_collection = (0, tool_js_1.tool)({
105
105
  fieldFilter: {
106
106
  field: { fieldPath: f.field },
107
107
  op: f.op,
108
- value: (0, converter_js_1.convertInputToValue)(out[0][1]),
108
+ value: (0, converter_1.convertInputToValue)(out[0][1]),
109
109
  },
110
110
  };
111
111
  }),
@@ -123,10 +123,10 @@ exports.query_collection = (0, tool_js_1.tool)({
123
123
  structuredQuery.limit = limit ? limit : 10;
124
124
  let emulatorUrl;
125
125
  if (use_emulator) {
126
- emulatorUrl = await host.getEmulatorUrl(types_js_1.Emulators.FIRESTORE);
126
+ emulatorUrl = await host.getEmulatorUrl(types_1.Emulators.FIRESTORE);
127
127
  }
128
- const { documents } = await (0, firestore_js_1.queryCollection)(projectId, structuredQuery, database, emulatorUrl);
129
- const docs = documents.map(converter_js_1.firestoreDocumentToJson);
130
- const docsContent = (0, util_js_1.toContent)(docs);
128
+ const { documents } = await (0, firestore_1.queryCollection)(projectId, structuredQuery, database, emulatorUrl);
129
+ const docs = documents.map(converter_1.firestoreDocumentToJson);
130
+ const docsContent = (0, util_1.toContent)(docs);
131
131
  return docsContent;
132
132
  });
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.markdownDocsOfTools = exports.availableTools = void 0;
4
- const index_js_1 = require("./auth/index.js");
5
- const index_js_2 = require("./dataconnect/index.js");
6
- const index_js_3 = require("./firestore/index.js");
7
- const index_js_4 = require("./core/index.js");
8
- const index_js_5 = require("./storage/index.js");
9
- const index_js_6 = require("./messaging/index.js");
10
- const index_js_7 = require("./remoteconfig/index.js");
11
- const index_js_8 = require("./crashlytics/index.js");
12
- const index_js_9 = require("./apphosting/index.js");
4
+ const index_1 = require("./auth/index");
5
+ const index_2 = require("./dataconnect/index");
6
+ const index_3 = require("./firestore/index");
7
+ const index_4 = require("./core/index");
8
+ const index_5 = require("./storage/index");
9
+ const index_6 = require("./messaging/index");
10
+ const index_7 = require("./remoteconfig/index");
11
+ const index_8 = require("./crashlytics/index");
12
+ const index_9 = require("./apphosting/index");
13
13
  function availableTools(activeFeatures) {
14
- const toolDefs = addFeaturePrefix("firebase", index_js_4.coreTools);
14
+ const toolDefs = addFeaturePrefix("firebase", index_4.coreTools);
15
15
  if (!(activeFeatures === null || activeFeatures === void 0 ? void 0 : activeFeatures.length)) {
16
16
  activeFeatures = Object.keys(tools);
17
17
  }
@@ -22,14 +22,14 @@ function availableTools(activeFeatures) {
22
22
  }
23
23
  exports.availableTools = availableTools;
24
24
  const tools = {
25
- firestore: addFeaturePrefix("firestore", index_js_3.firestoreTools),
26
- auth: addFeaturePrefix("auth", index_js_1.authTools),
27
- dataconnect: addFeaturePrefix("dataconnect", index_js_2.dataconnectTools),
28
- storage: addFeaturePrefix("storage", index_js_5.storageTools),
29
- messaging: addFeaturePrefix("messaging", index_js_6.messagingTools),
30
- remoteconfig: addFeaturePrefix("remoteconfig", index_js_7.remoteConfigTools),
31
- crashlytics: addFeaturePrefix("crashlytics", index_js_8.crashlyticsTools),
32
- apphosting: addFeaturePrefix("apphosting", index_js_9.appHostingTools),
25
+ firestore: addFeaturePrefix("firestore", index_3.firestoreTools),
26
+ auth: addFeaturePrefix("auth", index_1.authTools),
27
+ dataconnect: addFeaturePrefix("dataconnect", index_2.dataconnectTools),
28
+ storage: addFeaturePrefix("storage", index_5.storageTools),
29
+ messaging: addFeaturePrefix("messaging", index_6.messagingTools),
30
+ remoteconfig: addFeaturePrefix("remoteconfig", index_7.remoteConfigTools),
31
+ crashlytics: addFeaturePrefix("crashlytics", index_8.crashlyticsTools),
32
+ apphosting: addFeaturePrefix("apphosting", index_9.appHostingTools),
33
33
  };
34
34
  function addFeaturePrefix(feature, tools) {
35
35
  return tools.map((tool) => (Object.assign(Object.assign({}, tool), { mcp: Object.assign(Object.assign({}, tool.mcp), { name: `${feature}_${tool.mcp.name}`, _meta: Object.assign(Object.assign({}, tool.mcp._meta), { feature }) }) })));
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.messagingTools = void 0;
4
- const send_message_js_1 = require("./send_message.js");
5
- exports.messagingTools = [send_message_js_1.send_message];
4
+ const send_message_1 = require("./send_message");
5
+ exports.messagingTools = [send_message_1.send_message];
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.send_message = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const sendMessage_js_1 = require("../../../messaging/sendMessage.js");
8
- exports.send_message = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const sendMessage_1 = require("../../../messaging/sendMessage");
8
+ exports.send_message = (0, tool_1.tool)({
9
9
  name: "send_message",
10
10
  description: "Sends a message to a Firebase Cloud Messaging registration token or topic. ONLY ONE of `registration_token` or `topic` may be supplied in a specific call.",
11
11
  inputSchema: zod_1.z.object({
@@ -33,10 +33,10 @@ exports.send_message = (0, tool_js_1.tool)({
33
33
  },
34
34
  }, async ({ registration_token, topic, title, body }, { projectId }) => {
35
35
  if (!registration_token && !topic) {
36
- return (0, util_js_1.mcpError)("Must supply either a `registration_token` or `topic` parameter to `send_message`.");
36
+ return (0, util_1.mcpError)("Must supply either a `registration_token` or `topic` parameter to `send_message`.");
37
37
  }
38
38
  if (registration_token && topic) {
39
- return (0, util_js_1.mcpError)("Cannot supply both `registration_token` and `topic` in a single `send_message` request.");
39
+ return (0, util_1.mcpError)("Cannot supply both `registration_token` and `topic` in a single `send_message` request.");
40
40
  }
41
- return (0, util_js_1.toContent)(await (0, sendMessage_js_1.sendFcmMessage)(projectId, { token: registration_token, topic, title, body }));
41
+ return (0, util_1.toContent)(await (0, sendMessage_1.sendFcmMessage)(projectId, { token: registration_token, topic, title, body }));
42
42
  });
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.get_template = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const get_js_1 = require("../../../remoteconfig/get.js");
8
- exports.get_template = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const get_1 = require("../../../remoteconfig/get");
8
+ exports.get_template = (0, tool_1.tool)({
9
9
  name: "get_template",
10
10
  description: "Retrieves a remote config template for the project",
11
11
  inputSchema: zod_1.z.object({
@@ -23,5 +23,5 @@ exports.get_template = (0, tool_js_1.tool)({
23
23
  requiresProject: true,
24
24
  },
25
25
  }, async ({ version_number }, { projectId }) => {
26
- return (0, util_js_1.toContent)(await (0, get_js_1.getTemplate)(projectId, version_number));
26
+ return (0, util_1.toContent)(await (0, get_1.getTemplate)(projectId, version_number));
27
27
  });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.remoteConfigTools = void 0;
4
- const get_template_js_1 = require("./get_template.js");
5
- const rollback_template_js_1 = require("./rollback_template.js");
6
- const publish_template_js_1 = require("./publish_template.js");
7
- exports.remoteConfigTools = [get_template_js_1.get_template, publish_template_js_1.publish_template, rollback_template_js_1.rollback_template];
4
+ const get_template_1 = require("./get_template");
5
+ const rollback_template_1 = require("./rollback_template");
6
+ const publish_template_1 = require("./publish_template");
7
+ exports.remoteConfigTools = [get_template_1.get_template, publish_template_1.publish_template, rollback_template_1.rollback_template];
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.publish_template = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const publish_js_1 = require("../../../remoteconfig/publish.js");
8
- exports.publish_template = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const publish_1 = require("../../../remoteconfig/publish");
8
+ exports.publish_template = (0, tool_1.tool)({
9
9
  name: "publish_template",
10
10
  description: "Publishes a new remote config template for the project",
11
11
  inputSchema: zod_1.z.object({
@@ -25,10 +25,10 @@ exports.publish_template = (0, tool_js_1.tool)({
25
25
  },
26
26
  }, async ({ template, force }, { projectId }) => {
27
27
  if (template === undefined) {
28
- return (0, util_js_1.mcpError)(`No template specified in the publish requests`);
28
+ return (0, util_1.mcpError)(`No template specified in the publish requests`);
29
29
  }
30
30
  if (force === undefined) {
31
- return (0, util_js_1.toContent)(await (0, publish_js_1.publishTemplate)(projectId, template));
31
+ return (0, util_1.toContent)(await (0, publish_1.publishTemplate)(projectId, template));
32
32
  }
33
- return (0, util_js_1.toContent)(await (0, publish_js_1.publishTemplate)(projectId, template, { force }));
33
+ return (0, util_1.toContent)(await (0, publish_1.publishTemplate)(projectId, template, { force }));
34
34
  });
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rollback_template = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_js_1 = require("../../tool.js");
6
- const util_js_1 = require("../../util.js");
7
- const rollback_js_1 = require("../../../remoteconfig/rollback.js");
8
- exports.rollback_template = (0, tool_js_1.tool)({
5
+ const tool_1 = require("../../tool");
6
+ const util_1 = require("../../util");
7
+ const rollback_1 = require("../../../remoteconfig/rollback");
8
+ exports.rollback_template = (0, tool_1.tool)({
9
9
  name: "rollback_template",
10
10
  description: "Rollback to a specific version of Remote Config template for a project",
11
11
  inputSchema: zod_1.z.object({
@@ -23,7 +23,7 @@ exports.rollback_template = (0, tool_js_1.tool)({
23
23
  },
24
24
  }, async ({ version_number }, { projectId }) => {
25
25
  if (version_number === undefined) {
26
- return (0, util_js_1.mcpError)(`No version number specified in the rollback requests`);
26
+ return (0, util_1.mcpError)(`No version number specified in the rollback requests`);
27
27
  }
28
- return (0, util_js_1.toContent)(await (0, rollback_js_1.rollbackTemplate)(projectId, version_number));
28
+ return (0, util_1.toContent)(await (0, rollback_1.rollbackTemplate)(projectId, version_number));
29
29
  });