firebase-tools-with-isolate 15.28.2 → 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/api.js +4 -2
- package/lib/apphosting/config.js +10 -8
- package/lib/apphosting/localbuilds.js +8 -0
- package/lib/apphosting/yaml.js +27 -0
- package/lib/bin/cli.js +1 -1
- package/lib/bin/mcp.js +8 -3
- package/lib/commands/ext-export.js +52 -14
- package/lib/commands/ext-migrate.js +70 -4
- package/lib/commands/ext-uninstall.js +2 -28
- package/lib/commands/functions-delete.js +6 -67
- package/lib/commands/functions-kits-install.js +7 -0
- package/lib/commands/functions-kits-uninstall.js +30 -86
- package/lib/crashlytics/onboarding.js +23 -2
- package/lib/deploy/apphosting/deploy.js +2 -1
- package/lib/deploy/apphosting/prepare.js +12 -3
- package/lib/deploy/apphosting/release.js +3 -0
- package/lib/deploy/apphosting/util.js +3 -1
- package/lib/deploy/extensions/secrets.js +10 -0
- package/lib/deploy/functions/delete.js +105 -0
- 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/emulator/types.js +3 -1
- package/lib/extensions/askUserForParam.js +9 -8
- package/lib/extensions/export.js +47 -10
- package/lib/extensions/extensionsHelper.js +29 -2
- package/lib/extensions/manifest.js +5 -4
- package/lib/extensions/migrate.js +176 -2
- package/lib/extensions/paramHelper.js +78 -25
- package/lib/extensions/secretsUtils.js +3 -0
- package/lib/extensions/updateHelper.js +3 -1
- package/lib/functions/kits/install.js +322 -70
- package/lib/gcp/apikeys.js +89 -0
- package/lib/gcp/resourceManager.js +31 -22
- package/lib/gcp/run.js +2 -2
- package/lib/gcp/storage.js +3 -2
- package/lib/logger.js +83 -9
- package/lib/mcp/onemcp/index.js +19 -0
- package/lib/mcp/onemcp/onemcp_server.js +12 -7
- package/lib/mcp/tools/apphosting/fetch_logs.js +1 -0
- package/lib/mcp/tools/apphosting/list_backends.js +1 -0
- package/lib/mcp/tools/apptesting/tests.js +2 -0
- package/lib/mcp/tools/auth/get_users.js +1 -0
- package/lib/mcp/tools/auth/set_sms_region_policy.js +1 -0
- package/lib/mcp/tools/auth/update_user.js +1 -0
- package/lib/mcp/tools/core/create_android_sha.js +1 -0
- package/lib/mcp/tools/core/create_app.js +1 -0
- package/lib/mcp/tools/core/create_project.js +1 -0
- package/lib/mcp/tools/core/deploy.js +1 -0
- package/lib/mcp/tools/core/deploy_status.js +1 -0
- package/lib/mcp/tools/core/get_environment.js +1 -0
- package/lib/mcp/tools/core/get_project.js +1 -0
- package/lib/mcp/tools/core/get_sdk_config.js +1 -0
- package/lib/mcp/tools/core/get_security_rules.js +1 -0
- package/lib/mcp/tools/core/init.js +1 -0
- package/lib/mcp/tools/core/list_apps.js +1 -0
- package/lib/mcp/tools/core/list_projects.js +1 -0
- package/lib/mcp/tools/core/login.js +1 -0
- package/lib/mcp/tools/core/logout.js +1 -0
- package/lib/mcp/tools/core/read_resources.js +1 -0
- package/lib/mcp/tools/core/update_environment.js +1 -0
- package/lib/mcp/tools/core/validate_security_rules.js +1 -0
- package/lib/mcp/tools/crashlytics/events.js +2 -0
- package/lib/mcp/tools/crashlytics/issues.js +2 -0
- package/lib/mcp/tools/crashlytics/notes.js +3 -0
- package/lib/mcp/tools/crashlytics/reports.js +1 -0
- package/lib/mcp/tools/dataconnect/compile.js +1 -0
- package/lib/mcp/tools/dataconnect/execute.js +34 -19
- package/lib/mcp/tools/dataconnect/index.js +1 -1
- package/lib/mcp/tools/dataconnect/list_services.js +1 -0
- package/lib/mcp/tools/firestore/query_collection.js +1 -0
- package/lib/mcp/tools/functions/get_logs.js +1 -0
- package/lib/mcp/tools/functions/list_functions.js +1 -0
- package/lib/mcp/tools/index.js +3 -1
- package/lib/mcp/tools/messaging/send_message.js +1 -0
- package/lib/mcp/tools/realtime_database/get_data.js +1 -0
- package/lib/mcp/tools/realtime_database/set_data.js +1 -0
- package/lib/mcp/tools/remoteconfig/get_template.js +1 -0
- package/lib/mcp/tools/remoteconfig/update_template.js +1 -0
- package/lib/mcp/tools/storage/get_download_url.js +1 -0
- package/lib/prompt.js +10 -1
- package/lib/throttler/throttler.js +2 -11
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/lib/utils.js +26 -0
- package/package.json +5 -5
- package/templates/init/functions/typescript/index-kit-migration.ts +21 -2
- package/templates/init/functions/typescript/index-kit.ts +1 -0
- package/templates/init/functions/typescript/package-kit.json +21 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.30.0",
|
|
4
4
|
"description": "Command-Line Interface for Firebase with monorepo support",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"mcpName": "io.github.firebase/firebase-mcp",
|
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
"cross-env": "^7.0.3",
|
|
130
130
|
"cross-spawn": "^7.0.5",
|
|
131
131
|
"csv-parse": "^5.0.4",
|
|
132
|
+
"detect-monorepo": "^1.2.0",
|
|
132
133
|
"exegesis": "^4.2.0",
|
|
133
134
|
"exegesis-express": "^4.0.0",
|
|
134
135
|
"express": "^4.16.4",
|
|
@@ -139,6 +140,7 @@
|
|
|
139
140
|
"glob": "^10.5.0",
|
|
140
141
|
"google-auth-library": "^9.11.0",
|
|
141
142
|
"ignore": "^7.0.4",
|
|
143
|
+
"isolate-package": "1.37.0",
|
|
142
144
|
"js-yaml": "^4.2.0",
|
|
143
145
|
"jsonwebtoken": "^9.0.2",
|
|
144
146
|
"libsodium-wrappers": "^0.7.10",
|
|
@@ -168,16 +170,14 @@
|
|
|
168
170
|
"tcp-port-used": "^1.0.2",
|
|
169
171
|
"tmp": "^0.2.3",
|
|
170
172
|
"triple-beam": "^1.3.0",
|
|
173
|
+
"undici": "^6.19.0",
|
|
171
174
|
"universal-analytics": "^0.5.3",
|
|
172
175
|
"update-notifier-cjs": "^5.1.6",
|
|
173
|
-
"undici": "^6.19.0",
|
|
174
176
|
"winston": "^3.0.0",
|
|
175
177
|
"winston-transport": "^4.4.0",
|
|
176
178
|
"ws": "^8.21.1",
|
|
177
179
|
"yaml": "^2.8.3",
|
|
178
|
-
"zod": "^4.0.0"
|
|
179
|
-
"isolate-package": "1.35.0",
|
|
180
|
-
"detect-monorepo": "^1.2.0"
|
|
180
|
+
"zod": "^4.0.0"
|
|
181
181
|
},
|
|
182
182
|
"devDependencies": {
|
|
183
183
|
"@angular-devkit/architect": "^0.1402.2",
|
|
@@ -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
|
|
|
@@ -31,7 +32,10 @@ setGlobalOptions({
|
|
|
31
32
|
? Number(process.env.EXT_MIGRATED_SYSTEM_TIMEOUTSECONDS)
|
|
32
33
|
: undefined,
|
|
33
34
|
vpcConnectorEgressSettings:
|
|
34
|
-
|
|
35
|
+
process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOREGRESSSETTINGS &&
|
|
36
|
+
process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOREGRESSSETTINGS !== "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED"
|
|
37
|
+
? (process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOREGRESSSETTINGS as VpcEgressSetting)
|
|
38
|
+
: undefined,
|
|
35
39
|
vpcConnector: process.env.EXT_MIGRATED_SYSTEM_VPCCONNECTOR ?? undefined,
|
|
36
40
|
maxInstances: process.env.EXT_MIGRATED_SYSTEM_MAXINSTANCES
|
|
37
41
|
? Number(process.env.EXT_MIGRATED_SYSTEM_MAXINSTANCES)
|
|
@@ -40,8 +44,23 @@ setGlobalOptions({
|
|
|
40
44
|
? Number(process.env.EXT_MIGRATED_SYSTEM_MININSTANCES)
|
|
41
45
|
: undefined,
|
|
42
46
|
ingressSettings: (process.env.EXT_MIGRATED_SYSTEM_INGRESSSETTINGS as IngressSetting) ?? undefined,
|
|
47
|
+
// Parses a comma-separated string of key:value pairs into a key-value object
|
|
48
|
+
// (e.g. "key1:value1,key2:value2" -> { key1: "value1", key2: "value2" }).
|
|
43
49
|
labels: process.env.EXT_MIGRATED_SYSTEM_LABELS
|
|
44
|
-
?
|
|
50
|
+
? process.env.EXT_MIGRATED_SYSTEM_LABELS.split(",").reduce<Record<string, string> | undefined>(
|
|
51
|
+
(acc, curr) => {
|
|
52
|
+
const [key, value] = curr.split(":");
|
|
53
|
+
const trimmedKey = key?.trim();
|
|
54
|
+
const trimmedValue = value?.trim();
|
|
55
|
+
if (!trimmedKey || !trimmedValue) {
|
|
56
|
+
return acc;
|
|
57
|
+
}
|
|
58
|
+
acc = acc ?? {};
|
|
59
|
+
acc[trimmedKey] = trimmedValue;
|
|
60
|
+
return acc;
|
|
61
|
+
},
|
|
62
|
+
undefined,
|
|
63
|
+
)
|
|
45
64
|
: undefined,
|
|
46
65
|
});
|
|
47
66
|
|
|
@@ -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
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "functions",
|
|
3
|
+
"scripts": {
|
|
4
|
+
"build": "tsc",
|
|
5
|
+
"build:watch": "tsc --watch",
|
|
6
|
+
"serve": "npm run build && firebase emulators:start --only functions",
|
|
7
|
+
"shell": "npm run build && firebase functions:shell",
|
|
8
|
+
"start": "npm run shell",
|
|
9
|
+
"deploy": "firebase deploy --only functions",
|
|
10
|
+
"logs": "firebase functions:log"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "{{RUNTIME}}"
|
|
14
|
+
},
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"dependencies": {},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^6.0.0"
|
|
19
|
+
},
|
|
20
|
+
"private": true
|
|
21
|
+
}
|