firebase-tools 15.29.0 → 15.30.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.
- package/lib/commands/ext-export.js +18 -1
- package/lib/commands/ext-migrate.js +67 -4
- package/lib/commands/ext-uninstall.js +2 -28
- package/lib/commands/functions-kits-uninstall.js +23 -15
- package/lib/deploy/functions/delete.js +47 -22
- package/lib/deploy/functions/release/executor.js +14 -8
- package/lib/deploy/functions/release/fabricator.js +42 -20
- package/lib/deploy/functions/release/sourceTokenScraper.js +16 -2
- package/lib/emulator/downloadableEmulatorInfo.json +24 -24
- package/lib/emulator/tasksEmulator.js +2 -2
- package/lib/extensions/export.js +1 -1
- package/lib/extensions/extensionsHelper.js +1 -2
- package/lib/extensions/manifest.js +5 -4
- package/lib/extensions/migrate.js +55 -0
- package/lib/functions/kits/install.js +6 -4
- package/lib/gcp/resourceManager.js +31 -22
- package/lib/gcp/run.js +2 -2
- package/lib/mcp/onemcp/index.js +19 -0
- package/lib/mcp/onemcp/onemcp_server.js +12 -7
- package/lib/mcp/tools/dataconnect/execute.js +33 -19
- package/lib/mcp/tools/dataconnect/index.js +1 -1
- package/lib/throttler/throttler.js +2 -11
- package/lib/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/utils.js +26 -0
- package/package.json +1 -1
- package/templates/init/functions/typescript/index-kit-migration.ts +1 -0
- package/templates/init/functions/typescript/index-kit.ts +1 -0
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
|
@@ -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
|
|