firebase-tools-with-isolate 15.26.0 → 15.28.1

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 (74) 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 +140 -3
  12. package/lib/commands/ext-uninstall.js +35 -1
  13. package/lib/commands/functions-delete.js +19 -5
  14. package/lib/commands/functions-kits-install.js +417 -0
  15. package/lib/commands/functions-kits-list.js +27 -0
  16. package/lib/commands/index.js +11 -0
  17. package/lib/crashlytics/filters.js +12 -4
  18. package/lib/crashlytics/reports.js +2 -0
  19. package/lib/crashlytics/types.js +8 -1
  20. package/lib/dataconnect/client.js +11 -0
  21. package/lib/dataconnect/schemaMigration.js +16 -5
  22. package/lib/deploy/extensions/secrets.js +18 -0
  23. package/lib/deploy/functions/backend.js +11 -1
  24. package/lib/deploy/functions/build.js +1 -1
  25. package/lib/deploy/functions/functionsDeployHelper.js +39 -15
  26. package/lib/deploy/functions/params.js +5 -1
  27. package/lib/deploy/functions/prepare.js +69 -22
  28. package/lib/deploy/functions/prompts.js +1 -1
  29. package/lib/deploy/functions/release/lifecycle.js +11 -0
  30. package/lib/deploy/functions/release/planner.js +5 -2
  31. package/lib/deploy/functions/runtimes/dart/features.js +51 -0
  32. package/lib/deploy/functions/runtimes/dart/index.js +60 -16
  33. package/lib/emulator/controller.js +1 -0
  34. package/lib/emulator/downloadableEmulatorInfo.json +31 -31
  35. package/lib/emulator/functionsEmulator.js +7 -2
  36. package/lib/experiments.js +17 -5
  37. package/lib/extensions/export.js +73 -0
  38. package/lib/extensions/replacementRegistry.js +30 -0
  39. package/lib/extensions/replacements.json +464 -0
  40. package/lib/fetchMOTD.js +3 -0
  41. package/lib/functions/env.js +31 -7
  42. package/lib/functions/iac/export.js +16 -1
  43. package/lib/functions/kits/config.js +8 -0
  44. package/lib/functions/projectConfig.js +19 -11
  45. package/lib/functions/python.js +1 -1
  46. package/lib/gcp/runv2.js +1 -0
  47. package/lib/gcp/secretManager.js +3 -3
  48. package/lib/init/features/functions/dart.js +1 -1
  49. package/lib/mcp/onemcp/index.js +2 -1
  50. package/lib/mcp/onemcp/onemcp_server.js +38 -11
  51. package/lib/mcp/prompts/crashlytics/connect.js +1 -1
  52. package/lib/mcp/resources/guides/crashlytics_issues.js +3 -3
  53. package/lib/mcp/resources/guides/crashlytics_reports.js +32 -11
  54. package/lib/mcp/tool.js +5 -0
  55. package/lib/mcp/tools/core/deploy.js +2 -0
  56. package/lib/mcp/tools/core/login.js +59 -4
  57. package/lib/mcp/tools/crashlytics/notes.js +3 -3
  58. package/lib/mcp/tools/crashlytics/reports.js +2 -0
  59. package/lib/mcp/tools/dataconnect/compile.js +23 -2
  60. package/lib/mcp/tools/dataconnect/list_services.js +3 -4
  61. package/lib/mcp/util/crashlytics/availability.js +54 -1
  62. package/lib/serve/functions.js +1 -1
  63. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  64. package/lib/unzip.js +12 -2
  65. package/package.json +2 -1
  66. package/schema/firebase-config.json +3 -3
  67. package/templates/init/functions/dart/_gitignore +1 -0
  68. package/templates/init/functions/typescript/index-kit-migration.ts +49 -0
  69. package/templates/init/functions/typescript/index-kit.ts +35 -0
  70. package/templates/init/functions/typescript/index.ts +3 -3
  71. package/templates/init/functions/typescript/package-ongraphrequest.lint.json +3 -3
  72. package/templates/init/functions/typescript/package.lint.json +3 -3
  73. package/templates/init/functions/typescript/tsconfig.dev.json +4 -0
  74. package/lib/appcheck/prompts.js +0 -41
@@ -44,46 +44,46 @@
44
44
  }
45
45
  },
46
46
  "pubsub": {
47
- "version": "0.8.34",
48
- "expectedSize": 53008019,
49
- "expectedChecksum": "3eb75c292dfa72d48a36428a49bac314",
50
- "expectedChecksumSHA256": "062a71d30cbc0cc29de6e55f22ae9fc7eacb02c60272a2c4692826fdb83f0c25",
51
- "remoteUrl": "https://storage.googleapis.com/firebase-preview-drop/emulator/pubsub-emulator-0.8.34.zip",
52
- "downloadPathRelativeToCacheDir": "pubsub-emulator-0.8.34.zip",
53
- "binaryPathRelativeToCacheDir": "pubsub-emulator-0.8.34/pubsub-emulator/bin/cloud-pubsub-emulator"
47
+ "version": "0.8.35",
48
+ "expectedSize": 53015972,
49
+ "expectedChecksum": "04cb782e3edf7a2b117990af8506453e",
50
+ "expectedChecksumSHA256": "b0f3b73a14b716ecf8925b7b8a0c8c858ffabddcf03df8b2b7fba682f48dc616",
51
+ "remoteUrl": "https://storage.googleapis.com/firebase-preview-drop/emulator/pubsub-emulator-0.8.35.zip",
52
+ "downloadPathRelativeToCacheDir": "pubsub-emulator-0.8.35.zip",
53
+ "binaryPathRelativeToCacheDir": "pubsub-emulator-0.8.35/pubsub-emulator/bin/cloud-pubsub-emulator"
54
54
  },
55
55
  "dataconnect": {
56
56
  "darwin": {
57
- "version": "3.4.17",
58
- "expectedSize": 32968592,
59
- "expectedChecksum": "2658cdff6b7584aea118250a56217464",
60
- "expectedChecksumSHA256": "43d5755fdeb51c6a66725ba45cf3355531bf3516367e54574080b17e2ab5f5b5",
61
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.17",
62
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.17"
57
+ "version": "3.4.18",
58
+ "expectedSize": 33375408,
59
+ "expectedChecksum": "e38f131497fc43df55c3a47ee87e7fd4",
60
+ "expectedChecksumSHA256": "52518fefdd2e52581b0d8d035c6498f304ac493d3757f4fd35851b1f028a9460",
61
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-amd64-v3.4.18",
62
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
63
63
  },
64
64
  "darwin_arm64": {
65
- "version": "3.4.17",
66
- "expectedSize": 31079394,
67
- "expectedChecksum": "fe73494081e3a0319dad298b7d05ff7c",
68
- "expectedChecksumSHA256": "10ef4602874824ecb5ba655e016f44b856ce37374d64a03d58e7c70c75c67f83",
69
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.17",
70
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.17"
65
+ "version": "3.4.18",
66
+ "expectedSize": 31505922,
67
+ "expectedChecksum": "6a7cfdd68a7671bb660eb8489372a890",
68
+ "expectedChecksumSHA256": "96cdec1fd6561af5c10f915f6f3bfd59a7405bf5e9b8fabfedb40cd57d6d5d76",
69
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-arm64-v3.4.18",
70
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
71
71
  },
72
72
  "win32": {
73
- "version": "3.4.17",
74
- "expectedSize": 33011200,
75
- "expectedChecksum": "8648cad58f7f2c0f9854825f4811cc03",
76
- "expectedChecksumSHA256": "7bab1aba01d16dfbea53f476fc50b49000abe123387208dc3584c9486ac9c73a",
77
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.17",
78
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.17.exe"
73
+ "version": "3.4.18",
74
+ "expectedSize": 33414144,
75
+ "expectedChecksum": "d2504c643ac8355b90aa31be7575807c",
76
+ "expectedChecksumSHA256": "a92f2d01950af613d28b92c2cd7baa85e7629fa201b8ff8dddce73d5584dccc5",
77
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-amd64-v3.4.18",
78
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18.exe"
79
79
  },
80
80
  "linux": {
81
- "version": "3.4.17",
82
- "expectedSize": 32121016,
83
- "expectedChecksum": "da3601940de713b05e783f40799db567",
84
- "expectedChecksumSHA256": "9878cd2116d03fedd5085d8233563920c2fbf2b0926319aeaff21b81293b7330",
85
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.17",
86
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.17"
81
+ "version": "3.4.18",
82
+ "expectedSize": 32510136,
83
+ "expectedChecksum": "c8b4640f3ea59c813a708814bd2c0f8c",
84
+ "expectedChecksumSHA256": "bb381de594485653812bee518ddae025c13e1050670d6fa186f6003c3c9b71ec",
85
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-amd64-v3.4.18",
86
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-3.4.18"
87
87
  }
88
88
  }
89
89
  }
@@ -367,9 +367,13 @@ class FunctionsEmulator {
367
367
  projectAlias: this.args.projectAlias,
368
368
  isEmulator: true,
369
369
  configDir: emulatableBackend.configDir,
370
+ projectDir: this.args.projectDir,
370
371
  };
371
372
  const userEnvs = functionsEnv.loadUserEnvs(userEnvOpt);
372
- const discoveredBuild = await runtimeDelegate.discoverBuild(runtimeConfig, environment);
373
+ const discoveredBuild = await runtimeDelegate.discoverBuild(runtimeConfig, {
374
+ ...userEnvs,
375
+ ...environment,
376
+ });
373
377
  if (discoveredBuild.extensions && this.args.extensionsEmulator) {
374
378
  await this.args.extensionsEmulator.addDynamicExtensions(emulatableBackend.codebase, discoveredBuild);
375
379
  await this.loadDynamicExtensionBackends();
@@ -379,6 +383,7 @@ class FunctionsEmulator {
379
383
  build: discoveredBuild,
380
384
  firebaseConfig: JSON.parse(firebaseConfig),
381
385
  userEnvs,
386
+ codebase: emulatableBackend.codebase,
382
387
  nonInteractive: false,
383
388
  isEmulator: true,
384
389
  });
@@ -957,6 +962,7 @@ class FunctionsEmulator {
957
962
  projectId: this.args.projectId,
958
963
  projectAlias: this.args.projectAlias,
959
964
  isEmulator: true,
965
+ projectDir: this.args.projectDir,
960
966
  };
961
967
  if (functionsEnv.hasUserEnvs(projectInfo)) {
962
968
  try {
@@ -1134,7 +1140,6 @@ class FunctionsEmulator {
1134
1140
  port: 8081 + (0, utils_1.randomInt)(0, 1000),
1135
1141
  });
1136
1142
  const childProcess = (0, python_1.runWithVirtualEnv)(args, backend.functionsDir, {
1137
- ...process.env,
1138
1143
  ...envs,
1139
1144
  PYTHONUNBUFFERED: "1",
1140
1145
  DEBUG: "False",
@@ -122,11 +122,12 @@ exports.ALL_EXPERIMENTS = experiments({
122
122
  "without a notice.",
123
123
  },
124
124
  appcheckadmin: {
125
- shortDescription: "Manage App Check enforcement from the CLI.",
126
- fullDescription: "Enables the `firebase appcheck:services` commands for reading and changing App Check " +
127
- "enforcement per service. These commands are in preview and may change until the " +
128
- "surface is API council approved. The `firebase appcheck:debugtokens` commands are " +
129
- "generally available and are not affected by this experiment.",
125
+ shortDescription: "Manage App Check enforcement and attestation providers from the CLI.",
126
+ fullDescription: "Enables the `firebase appcheck:services`, `firebase appcheck:providers` and " +
127
+ "`firebase appcheck:apps` commands for reading and changing App Check enforcement per " +
128
+ "service and the attestation providers of each app. These commands are in preview and " +
129
+ "may change until the surface is API council approved. The `firebase appcheck:debugtokens` " +
130
+ "commands are generally available and are not affected by this experiment.",
130
131
  },
131
132
  ailogic: {
132
133
  shortDescription: "Manage Firebase AI Logic from the CLI.",
@@ -215,6 +216,17 @@ exports.ALL_EXPERIMENTS = experiments({
215
216
  default: true,
216
217
  public: true,
217
218
  },
219
+ extMigrationFeatures: {
220
+ shortDescription: "Enable features intended to assist with the migration of Extension instances to Kits.",
221
+ default: false,
222
+ public: false,
223
+ },
224
+ fdcapimigration: {
225
+ shortDescription: "Enable the FDC API schema migration path.",
226
+ fullDescription: "API based Schema Migration behind experimental flag.",
227
+ default: true,
228
+ public: false,
229
+ },
218
230
  });
219
231
  function isValidExperiment(name) {
220
232
  return Object.keys(exports.ALL_EXPERIMENTS).includes(name);
@@ -3,11 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parameterizeProject = parameterizeProject;
4
4
  exports.setSecretParamsToLatest = setSecretParamsToLatest;
5
5
  exports.displayExportInfo = displayExportInfo;
6
+ exports.functionsEnvFromInstance = functionsEnvFromInstance;
7
+ exports.ejectSecretsFromInstance = ejectSecretsFromInstance;
6
8
  const planner_1 = require("../deploy/extensions/planner");
7
9
  const deploymentSummary_1 = require("../deploy/extensions/deploymentSummary");
8
10
  const logger_1 = require("../logger");
9
11
  const secretManager_1 = require("../gcp/secretManager");
10
12
  const secretsUtils_1 = require("./secretsUtils");
13
+ const secrets_1 = require("../deploy/extensions/secrets");
14
+ const error_1 = require("../error");
11
15
  function parameterizeProject(projectId, projectNumber, spec) {
12
16
  const newParams = {};
13
17
  for (const [key, val] of Object.entries(spec.params)) {
@@ -60,3 +64,72 @@ function displaySpecs(specs) {
60
64
  logger_1.logger.info("");
61
65
  }
62
66
  }
67
+ function functionsEnvFromInstance(instance) {
68
+ const liveParams = instance.config?.params || {};
69
+ const liveSystemParams = instance.config?.systemParams || {};
70
+ const specParams = instance.config?.source?.spec?.params || {};
71
+ const specSystemParams = instance.config?.source?.spec?.systemParams || {};
72
+ const envs = {};
73
+ specParams.forEach((specParam) => {
74
+ if (specParam.type === "SECRET") {
75
+ const renamed = "FIREBASE_SECRET_REF_" + specParam.param;
76
+ envs[renamed] = liveParams[specParam.param];
77
+ }
78
+ else if (specParam.param in liveParams) {
79
+ envs[specParam.param] = liveParams[specParam.param];
80
+ }
81
+ else {
82
+ envs[specParam.param] = specParam.default ?? "";
83
+ }
84
+ });
85
+ for (const [sysParamName, sysParamValue] of Object.entries(liveSystemParams)) {
86
+ let renamed = sysParamName
87
+ .replace(/^firebaseextensions\.v1beta\.(v2)?function\//, "EXT_MIGRATED_SYSTEM_")
88
+ .toUpperCase();
89
+ if (renamed === "EXT_MIGRATED_SYSTEM_LOCATION") {
90
+ renamed = "DEFAULT_FUNCTION_REGION";
91
+ }
92
+ envs[renamed] = sysParamValue;
93
+ }
94
+ for (const specSystemParam of Object.values(specSystemParams)) {
95
+ if (specSystemParam.param in liveSystemParams) {
96
+ continue;
97
+ }
98
+ if ("default" in specSystemParam) {
99
+ const renamed = specSystemParam.param
100
+ .replace(/^firebaseextensions\.v1beta\.(v2)?function\//, "EXT_MIGRATED_SYSTEM_")
101
+ .toUpperCase();
102
+ envs[renamed] = specSystemParam.default ?? "";
103
+ }
104
+ }
105
+ if (typeof instance.config.allowedEventTypes !== "undefined") {
106
+ envs["EXT_SELECTED_EVENTS"] = instance.config.allowedEventTypes.toString();
107
+ }
108
+ if (typeof instance.config.eventarcChannel !== "undefined") {
109
+ envs["EVENTARC_CHANNEL"] = instance.config.eventarcChannel;
110
+ }
111
+ return envs;
112
+ }
113
+ async function ejectSecretsFromInstance(instance) {
114
+ const secretsChanged = [];
115
+ const liveParams = instance.config?.params || {};
116
+ for (const specParam of instance.config?.source?.spec?.params ?? []) {
117
+ if (specParam.type !== "SECRET") {
118
+ continue;
119
+ }
120
+ const secretName = specParam.param;
121
+ const resourceName = liveParams[secretName];
122
+ if (!resourceName) {
123
+ throw new error_1.FirebaseError(`Secret ${secretName} was defined in the extension spec, but is missing in live deployed secrets.`, { exit: 1 });
124
+ }
125
+ const match = resourceName.match(secretManager_1.SECRET_VERSION_NAME_REGEX);
126
+ if (!match?.groups) {
127
+ throw new error_1.FirebaseError(`Invalid secret version resource name [${resourceName}].`);
128
+ }
129
+ const projectId = match.groups.project;
130
+ const secretId = match.groups.secret;
131
+ await (0, secrets_1.transferSecretToKits)(projectId, secretId);
132
+ secretsChanged.push(`${projectId}/${secretId}`);
133
+ }
134
+ return secretsChanged;
135
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExtensionReplacement = getExtensionReplacement;
4
+ exports.getDeprecationWarningMessage = getDeprecationWarningMessage;
5
+ const replacementsData = require("./replacements.json");
6
+ const DECOMMISSION_DATE_STR = "March 31, 2027";
7
+ const registry = replacementsData;
8
+ function getExtensionReplacement(extensionRef) {
9
+ if (!extensionRef) {
10
+ return undefined;
11
+ }
12
+ return registry.replacements?.[extensionRef];
13
+ }
14
+ function getDeprecationWarningMessage(extensionRef) {
15
+ const replacement = getExtensionReplacement(extensionRef);
16
+ if (!replacement) {
17
+ return undefined;
18
+ }
19
+ switch (replacement.status) {
20
+ case "REPLACEMENT_AVAILABLE":
21
+ return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
22
+ ` Recommended replacement: ${replacement.npmPackage}`);
23
+ case "CONFIRMED_NO_REPLACEMENT":
24
+ return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
25
+ ` Note: No npm package replacement is planned for this extension.`);
26
+ case "PENDING_PUBLISHER":
27
+ return (`Extension '${extensionRef}' is deprecated and will be decommissioned on ${DECOMMISSION_DATE_STR}.\n` +
28
+ ` A replacement package has not yet been announced by the publisher.`);
29
+ }
30
+ }