firebase-tools 15.29.0 → 15.30.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 (38) hide show
  1. package/lib/commands/ext-export.js +28 -2
  2. package/lib/commands/ext-migrate.js +73 -4
  3. package/lib/commands/ext-uninstall.js +36 -23
  4. package/lib/commands/functions-kits-install.js +4 -1
  5. package/lib/commands/functions-kits-uninstall.js +25 -16
  6. package/lib/deploy/functions/build.js +9 -7
  7. package/lib/deploy/functions/delete.js +47 -22
  8. package/lib/deploy/functions/ensure.js +42 -2
  9. package/lib/deploy/functions/functionsDeployHelper.js +7 -0
  10. package/lib/deploy/functions/params.js +2 -1
  11. package/lib/deploy/functions/prepare.js +3 -4
  12. package/lib/deploy/functions/release/executor.js +14 -8
  13. package/lib/deploy/functions/release/fabricator.js +42 -20
  14. package/lib/deploy/functions/release/planner.js +2 -4
  15. package/lib/deploy/functions/release/sourceTokenScraper.js +16 -2
  16. package/lib/emulator/downloadableEmulatorInfo.json +31 -31
  17. package/lib/emulator/tasksEmulator.js +2 -2
  18. package/lib/extensions/export.js +64 -2
  19. package/lib/extensions/extensionsHelper.js +1 -2
  20. package/lib/extensions/manifest.js +5 -4
  21. package/lib/extensions/migrate.js +71 -2
  22. package/lib/functions/env.js +21 -4
  23. package/lib/functions/kits/install.js +27 -10
  24. package/lib/gcp/iam.js +8 -17
  25. package/lib/gcp/resourceManager.js +31 -22
  26. package/lib/gcp/run.js +2 -2
  27. package/lib/mcp/onemcp/index.js +19 -0
  28. package/lib/mcp/onemcp/onemcp_server.js +12 -7
  29. package/lib/mcp/tools/dataconnect/execute.js +33 -19
  30. package/lib/mcp/tools/dataconnect/index.js +1 -1
  31. package/lib/throttler/throttler.js +2 -11
  32. package/lib/tsconfig.compile.tsbuildinfo +1 -1
  33. package/lib/tsconfig.publish.tsbuildinfo +1 -1
  34. package/lib/utils.js +26 -0
  35. package/package.json +1 -1
  36. package/templates/init/functions/typescript/index-kit-migration.ts +1 -0
  37. package/templates/init/functions/typescript/index-kit.ts +1 -0
  38. package/templates/init/functions/typescript/tsconfig.json +2 -1
package/lib/utils.js CHANGED
@@ -30,6 +30,9 @@ exports.promiseProps = promiseProps;
30
30
  exports.tryParse = tryParse;
31
31
  exports.promiseWithSpinner = promiseWithSpinner;
32
32
  exports.sleep = sleep;
33
+ exports.timeToWait = timeToWait;
34
+ exports.backoff = backoff;
35
+ exports.retryWithBackoff = retryWithBackoff;
33
36
  exports.createDestroyer = createDestroyer;
34
37
  exports.datetimeString = datetimeString;
35
38
  exports.isCloudEnvironment = isCloudEnvironment;
@@ -338,6 +341,29 @@ async function promiseWithSpinner(action, message) {
338
341
  function sleep(ms) {
339
342
  return new Promise((resolve) => setTimeout(resolve, ms));
340
343
  }
344
+ function timeToWait(retryNumber, delay, maxDelay) {
345
+ return Math.min(delay * Math.pow(2, retryNumber), maxDelay);
346
+ }
347
+ function backoff(retryNumber, delay, maxDelay) {
348
+ return sleep(timeToWait(retryNumber, delay, maxDelay));
349
+ }
350
+ async function retryWithBackoff(fn, options) {
351
+ const retries = options.retries ?? 0;
352
+ const delay = options.delay ?? 200;
353
+ const maxDelay = options.maxDelay ?? 60000;
354
+ for (let attempt = 0;; attempt++) {
355
+ try {
356
+ return await fn();
357
+ }
358
+ catch (err) {
359
+ if (attempt < retries && options.retryPredicate(err)) {
360
+ await backoff(attempt, delay, maxDelay);
361
+ continue;
362
+ }
363
+ throw err;
364
+ }
365
+ }
366
+ }
341
367
  function createDestroyer(server) {
342
368
  const connections = new Set();
343
369
  server.on("connection", (conn) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "15.29.0",
3
+ "version": "15.30.1",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "mcpName": "io.github.firebase/firebase-mcp",
@@ -18,6 +18,7 @@ import { defineString } from "firebase-functions/params";
18
18
  // the value to differ. Learn more at
19
19
  // https://firebase.google.com/docs/functions/config-env#params
20
20
  export const regionParam = defineString("FUNCTION_DEFAULT_REGION", {
21
+ input: { text: { nonEmpty: true } },
21
22
  description: "Global default region where functions should be deployed. Can be overriden per-function.",
22
23
  });
23
24
 
@@ -12,6 +12,7 @@ import * as params from "firebase-functions/params";
12
12
  // the value to differ. Learn more at
13
13
  // https://firebase.google.com/docs/functions/config-env#params
14
14
  export const regionParam = params.defineString("FUNCTION_DEFAULT_REGION", {
15
+ input: { text: { nonEmpty: true } },
15
16
  description: "Global default region where functions should be deployed. Can be overriden per-function.",
16
17
  });
17
18
 
@@ -9,7 +9,8 @@
9
9
  "rootDir": "src",
10
10
  "sourceMap": true,
11
11
  "strict": true,
12
- "target": "es2017"
12
+ "target": "es2017",
13
+ "skipLibCheck": true
13
14
  },
14
15
  "compileOnSave": true,
15
16
  "include": [