firebase-tools 15.26.0 → 15.27.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 (48) hide show
  1. package/lib/appcheck/api.js +19 -0
  2. package/lib/appcheck/providers.js +240 -0
  3. package/lib/commands/appcheck-apps-list.js +78 -0
  4. package/lib/commands/appcheck-debugtokens-create.js +2 -2
  5. package/lib/commands/appcheck-debugtokens-delete.js +2 -2
  6. package/lib/commands/appcheck-debugtokens-list.js +2 -2
  7. package/lib/commands/appcheck-prompts.js +55 -0
  8. package/lib/commands/appcheck-providers-get.js +73 -0
  9. package/lib/commands/appcheck-providers-list.js +67 -0
  10. package/lib/commands/appcheck-providers-set.js +96 -0
  11. package/lib/commands/ext-export.js +75 -3
  12. package/lib/commands/functions-kits-install.js +294 -0
  13. package/lib/commands/index.js +10 -0
  14. package/lib/crashlytics/filters.js +12 -4
  15. package/lib/crashlytics/reports.js +2 -0
  16. package/lib/crashlytics/types.js +8 -1
  17. package/lib/deploy/functions/backend.js +11 -1
  18. package/lib/deploy/functions/build.js +1 -1
  19. package/lib/deploy/functions/params.js +5 -1
  20. package/lib/deploy/functions/prepare.js +26 -13
  21. package/lib/deploy/functions/prompts.js +1 -1
  22. package/lib/deploy/functions/release/lifecycle.js +11 -0
  23. package/lib/deploy/functions/release/planner.js +5 -2
  24. package/lib/emulator/controller.js +1 -0
  25. package/lib/emulator/functionsEmulator.js +3 -1
  26. package/lib/experiments.js +11 -5
  27. package/lib/extensions/export.js +47 -0
  28. package/lib/functions/env.js +20 -7
  29. package/lib/functions/projectConfig.js +19 -11
  30. package/lib/functions/python.js +1 -1
  31. package/lib/gcp/runv2.js +1 -0
  32. package/lib/mcp/onemcp/index.js +2 -1
  33. package/lib/mcp/onemcp/onemcp_server.js +38 -11
  34. package/lib/mcp/prompts/crashlytics/connect.js +1 -1
  35. package/lib/mcp/resources/guides/crashlytics_issues.js +3 -3
  36. package/lib/mcp/resources/guides/crashlytics_reports.js +32 -11
  37. package/lib/mcp/tool.js +5 -0
  38. package/lib/mcp/tools/crashlytics/notes.js +3 -3
  39. package/lib/mcp/tools/crashlytics/reports.js +2 -0
  40. package/lib/mcp/util/crashlytics/availability.js +54 -1
  41. package/lib/serve/functions.js +1 -1
  42. package/lib/tsconfig.compile.tsbuildinfo +1 -1
  43. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  44. package/package.json +1 -1
  45. package/schema/firebase-config.json +3 -3
  46. package/templates/init/functions/typescript/index-kit-migration.ts +49 -0
  47. package/templates/init/functions/typescript/index-kit.ts +35 -0
  48. package/lib/appcheck/prompts.js +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "15.26.0",
3
+ "version": "15.27.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "mcpName": "io.github.firebase/firebase-mcp",
@@ -1017,13 +1017,13 @@
1017
1017
  "additionalProperties": false,
1018
1018
  "description": "Package details when resolved from a package repository.",
1019
1019
  "properties": {
1020
- "id": {
1021
- "description": "Package identifier (e.g., \"@firebase-functions-kits/firestore-bigquery-export\")",
1020
+ "name": {
1021
+ "description": "Package name (e.g., \"@firebase-functions-kits/firestore-bigquery-export\")",
1022
1022
  "type": "string"
1023
1023
  }
1024
1024
  },
1025
1025
  "required": [
1026
- "id"
1026
+ "name"
1027
1027
  ],
1028
1028
  "type": "object"
1029
1029
  }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Export functions from a function kit.
3
+ *
4
+ * This template is intended for users migrating from using a Firebase
5
+ * Extension to its equivalent function kit. It will set the global options for
6
+ * the function kit to equal what is configured for the Extension instance.
7
+ * Configuration from the Extension instance to migrate can be exported using
8
+ * the `firebase ext:export --mode functions --instance <ext-instance-id>`
9
+ * command.
10
+ */
11
+
12
+ import { setGlobalOptions } from "firebase-functions";
13
+ import { MemoryOption, VpcEgressSetting, IngressSetting } from "firebase-functions/v2/options";
14
+ import { defineString } from "firebase-functions/params";
15
+
16
+ // This is how you create a "param". A param is a placeholder for a value
17
+ // which is determined at install/deploy time. Use a param whenever you want
18
+ // the value to differ. Learn more at
19
+ // https://firebase.google.com/docs/functions/config-env#params
20
+ export const regionParam = defineString("FUNCTION_DEFAULT_REGION", {
21
+ description: "Global default region where functions should be deployed. Can be overriden per-function.",
22
+ });
23
+
24
+ // This allows you to set default options that apply to all functions in this
25
+ // kit. Learn more about these options and additional configurations at:
26
+ // https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.globaloptions
27
+ setGlobalOptions({
28
+ region: regionParam,
29
+ memory: (process.env.EXT_MIGRATED_SYSTEM_MEMORY as MemoryOption) ?? undefined,
30
+ timeoutSeconds: process.env.EXT_MIGRATED_SYSTEM_TIMEOUTSECONDS
31
+ ? Number(process.env.EXT_MIGRATED_SYSTEM_TIMEOUTSECONDS)
32
+ : undefined,
33
+ vpcConnectorEgressSettings:
34
+ (process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOREGRESSSETTINGS as VpcEgressSetting) ?? undefined,
35
+ vpcConnector: process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOR ?? undefined,
36
+ maxInstances: process.env.EXT_MIGRATED_SYSTEM_MAXINSTANCES
37
+ ? Number(process.env.EXT_MIGRATED_SYSTEM_MAXINSTANCES)
38
+ : undefined,
39
+ minInstances: process.env.EXT_MIGRATED_SYSTEM_MININSTANCES
40
+ ? Number(process.env.EXT_MIGRATED_SYSTEM_MININSTANCES)
41
+ : undefined,
42
+ ingressSettings: (process.env.EXT_MIGRATED_SYSTEM_INGRESSSETTINGS as IngressSetting) ?? undefined,
43
+ labels: process.env.EXT_MIGRATED_SYSTEM_LABELS
44
+ ? (JSON.parse(process.env.EXT_MIGRATED_SYSTEM_LABELS) as Record<string, string>)
45
+ : undefined,
46
+ });
47
+
48
+ // Exports the functions located in the kit.
49
+ export * from "{{PACKAGE_NAME}}";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This exports all functions in the kit so that the Firebase CLI can see it. The
3
+ * kit may expose additional, optional features that you can configure after importing,
4
+ * such as registering a callback. Check the kit's README for more information.
5
+ */
6
+
7
+ import { setGlobalOptions } from "firebase-functions";
8
+ import * as params from "firebase-functions/params";
9
+
10
+ // This is how you create a "param". A param is a placeholder for a value
11
+ // which is determined at install/deploy time. Use a param whenever you want
12
+ // the value to differ. Learn more at
13
+ // https://firebase.google.com/docs/functions/config-env#params
14
+ export const regionParam = params.defineString("FUNCTION_DEFAULT_REGION", {
15
+ description: "Global default region where functions should be deployed. Can be overriden per-function.",
16
+ });
17
+
18
+
19
+ // This allows you to set default options that apply to all functions in this
20
+ // kit. Learn more about these options and additional configurations at:
21
+ // https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.globaloptions
22
+ setGlobalOptions({
23
+ // If you pass a parameter, you will be prompted for new values on each instance.
24
+ region: regionParam,
25
+ // If you want the same value for all instances across your kit, you can pass a
26
+ // normal value.
27
+ // For cost control, you can set the maximum number of containers that can be
28
+ // running at the same time. This helps mitigate the impact of unexpected
29
+ // traffic spikes by instead downgrading performance. This limit is a
30
+ // per-function limit.
31
+ maxInstances: 10,
32
+ });
33
+
34
+ // Exports the functions located in the kit.
35
+ export * from "{{PACKAGE_NAME}}";
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOrPromptProjectAndAppId = void 0;
4
- exports.getOrPromptAppId = getOrPromptAppId;
5
- const apps_1 = require("../management/apps");
6
- const projectUtils_1 = require("../projectUtils");
7
- const appUtils_1 = require("../appUtils");
8
- const error_1 = require("../error");
9
- const logger_1 = require("../logger");
10
- const clc = require("colorette");
11
- async function getOrPromptAppId(options, message = "Select the app to register a debug token for:") {
12
- const projectId = (0, projectUtils_1.needProjectId)(options);
13
- logger_1.logger.info(`Active Project: ${clc.bold(projectId)}`);
14
- if (options.app) {
15
- return { projectId, appId: options.app };
16
- }
17
- const projectDir = options.cwd || process.cwd();
18
- let apps = await (0, apps_1.listFirebaseApps)(projectId, apps_1.AppPlatform.ANY);
19
- if (!apps.length) {
20
- throw new error_1.FirebaseError(`There are no apps associated with project ${projectId}.`);
21
- }
22
- const localApps = await (0, appUtils_1.detectApps)(projectDir);
23
- const localAppIds = localApps.map((a) => a.appId).filter(Boolean);
24
- if (localAppIds.length > 0) {
25
- const filteredApps = apps.filter((app) => localAppIds.includes(app.appId));
26
- if (filteredApps.length > 0) {
27
- apps = filteredApps;
28
- }
29
- }
30
- if (apps.length === 1) {
31
- return { projectId, appId: apps[0].appId };
32
- }
33
- else if (options.nonInteractive) {
34
- throw new error_1.FirebaseError(`Project ${projectId} has multiple apps, must specify an app id.`);
35
- }
36
- const selectedApp = await (0, apps_1.selectAppInteractively)(apps, apps_1.AppPlatform.ANY, {
37
- message,
38
- });
39
- return { projectId, appId: selectedApp.appId };
40
- }
41
- exports.getOrPromptProjectAndAppId = getOrPromptAppId;