firebase-tools 15.28.2-chkuang-sql-connect-onemcp.0 → 15.28.3-feat-firebase-debug-path.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/backend.js +44 -10
- package/lib/apphosting/config.js +10 -8
- package/lib/apphosting/githubConnections.js +1 -1
- package/lib/apphosting/localbuilds.js +8 -0
- package/lib/apphosting/repo.js +1 -1
- package/lib/apphosting/rollout.js +1 -1
- package/lib/apphosting/yaml.js +27 -0
- package/lib/bin/cli.js +4 -1
- package/lib/bin/mcp.js +8 -3
- package/lib/commands/ext-export.js +58 -41
- package/lib/commands/ext-migrate.js +39 -0
- package/lib/commands/functions-delete.js +6 -67
- package/lib/commands/functions-kits-install.js +26 -445
- package/lib/commands/functions-kits-uninstall.js +200 -0
- package/lib/commands/index.js +4 -0
- package/lib/config.js +34 -0
- package/lib/crashlytics/onboarding.js +23 -2
- package/lib/dataconnect/client.js +2 -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 +80 -0
- package/lib/deploy/functions/ensure.js +29 -19
- package/lib/deploy/functions/prepare.js +8 -1
- package/lib/deploy/functions/release/fabricator.js +19 -3
- package/lib/deploy/functions/release/planner.js +8 -0
- package/lib/emulator/types.js +3 -1
- package/lib/extensions/askUserForParam.js +9 -8
- package/lib/extensions/export.js +46 -9
- package/lib/extensions/extensionsHelper.js +28 -0
- package/lib/extensions/listExtensions.js +27 -3
- package/lib/extensions/migrate.js +290 -0
- package/lib/extensions/paramHelper.js +78 -25
- package/lib/extensions/replacementRegistry.js +39 -4
- package/lib/extensions/replacements.json +7 -7
- package/lib/extensions/secretsUtils.js +3 -0
- package/lib/extensions/updateHelper.js +3 -1
- package/lib/functions/kits/env.js +38 -0
- package/lib/functions/kits/index.js +19 -0
- package/lib/functions/kits/install.js +879 -0
- package/lib/gcp/apikeys.js +89 -0
- package/lib/gcp/storage.js +3 -2
- package/lib/logger.js +83 -9
- package/lib/mcp/onemcp/index.js +0 -20
- package/lib/mcp/onemcp/onemcp_server.js +7 -12
- 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 +20 -33
- 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/tsconfig.compile.tsbuildinfo +1 -1
- package/lib/tsconfig.publish.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/schema/firebase-config.json +1 -1
- package/templates/init/functions/typescript/index-kit-migration.ts +20 -2
package/lib/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.developerKnowledgeOrigin = exports.cloudTestingOrigin = exports.appTestingOrigin = exports.aiLogicProxyOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.studioApiOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = exports.storageOrigin = void 0;
|
|
3
|
+
exports.rulesOrigin = exports.resourceManagerOrigin = exports.firebaseTelemetryAdminOrigin = exports.firebaseTelemetryOrigin = exports.crashlyticsApiOrigin = exports.messagingApiOrigin = exports.remoteConfigApiOrigin = exports.rtdbMetadataOrigin = exports.rtdbManagementOrigin = exports.realtimeOrigin = exports.extensionsTOSOrigin = exports.extensionsPublisherOrigin = exports.extensionsOrigin = exports.iamOrigin = exports.identityOrigin = exports.hostingOrigin = exports.googleOrigin = exports.pubsubOrigin = exports.cloudTasksOrigin = exports.cloudschedulerOrigin = exports.cloudbuildOrigin = exports.functionsDefaultRegion = exports.runOrigin = exports.functionsV2Origin = exports.functionsOrigin = exports.firestoreOrigin = exports.firestoreOriginOrEmulator = exports.firedataOrigin = exports.firebaseExtensionsRegistryOrigin = exports.firebaseApiOrigin = exports.eventarcOrigin = exports.consoleOrigin = exports.authManagementOrigin = exports.authOrigin = exports.apphostingGitHubAppInstallationURL = exports.apphostingP4SADomain = exports.apphostingOrigin = exports.appDistributionOrigin = exports.appCheckOrigin = exports.apiKeysOrigin = exports.artifactRegistryDomain = exports.developerConnectP4SADomain = exports.developerConnectOrigin = exports.containerRegistryDomain = exports.cloudMonitoringOrigin = exports.cloudloggingOrigin = exports.cloudbillingOrigin = exports.clientSecret = exports.clientId = exports.authProxyOrigin = void 0;
|
|
4
|
+
exports.developerKnowledgeOrigin = exports.cloudTestingOrigin = exports.appTestingOrigin = exports.aiLogicProxyOrigin = exports.vertexAIOrigin = exports.cloudSQLAdminOrigin = exports.dataConnectLocalConnString = exports.dataconnectP4SADomain = exports.dataconnectOrigin = exports.githubClientSecret = exports.githubClientId = exports.computeOrigin = exports.secretManagerOrigin = exports.githubApiOrigin = exports.githubOrigin = exports.studioApiOrigin = exports.serviceUsageOrigin = exports.cloudRunApiOrigin = exports.hostingApiOrigin = exports.firebaseStorageOrigin = exports.storageOrigin = exports.runtimeconfigOrigin = void 0;
|
|
5
5
|
exports.getScopes = getScopes;
|
|
6
6
|
exports.setScopes = setScopes;
|
|
7
7
|
const constants_1 = require("./emulator/constants");
|
|
@@ -29,6 +29,8 @@ const developerConnectP4SADomain = () => utils.envOverride("DEVELOPERCONNECT_P4S
|
|
|
29
29
|
exports.developerConnectP4SADomain = developerConnectP4SADomain;
|
|
30
30
|
const artifactRegistryDomain = () => utils.envOverride("ARTIFACT_REGISTRY_DOMAIN", "https://artifactregistry.googleapis.com");
|
|
31
31
|
exports.artifactRegistryDomain = artifactRegistryDomain;
|
|
32
|
+
const apiKeysOrigin = () => utils.envOverride("CLOUD_APIKEYS_URL", "https://apikeys.googleapis.com");
|
|
33
|
+
exports.apiKeysOrigin = apiKeysOrigin;
|
|
32
34
|
const appCheckOrigin = () => utils.envOverride("FIREBASE_APPCHECK_URL", "https://firebaseappcheck.googleapis.com");
|
|
33
35
|
exports.appCheckOrigin = appCheckOrigin;
|
|
34
36
|
const appDistributionOrigin = () => utils.envOverride("FIREBASE_APP_DISTRIBUTION_URL", "https://firebaseappdistribution.googleapis.com");
|
|
@@ -7,6 +7,7 @@ exports.createGitRepoLink = createGitRepoLink;
|
|
|
7
7
|
exports.ensureAppHostingComputeServiceAccount = ensureAppHostingComputeServiceAccount;
|
|
8
8
|
exports.promptNewBackendId = promptNewBackendId;
|
|
9
9
|
exports.createBackend = createBackend;
|
|
10
|
+
exports.defaultComputeServiceAccountExists = defaultComputeServiceAccountExists;
|
|
10
11
|
exports.setDefaultTrafficPolicy = setDefaultTrafficPolicy;
|
|
11
12
|
exports.deleteBackendAndPoll = deleteBackendAndPoll;
|
|
12
13
|
exports.promptLocation = promptLocation;
|
|
@@ -39,7 +40,7 @@ const DEFAULT_COMPUTE_SERVICE_ACCOUNT_NAME = "firebase-app-hosting-compute";
|
|
|
39
40
|
const apphostingPollerOptions = {
|
|
40
41
|
apiOrigin: (0, api_1.apphostingOrigin)(),
|
|
41
42
|
apiVersion: apphosting_1.API_VERSION,
|
|
42
|
-
masterTimeout:
|
|
43
|
+
masterTimeout: 60 * 60 * 1000,
|
|
43
44
|
maxBackoff: 10000,
|
|
44
45
|
};
|
|
45
46
|
async function tlsReady(url) {
|
|
@@ -190,6 +191,10 @@ async function createGitRepoLink(projectId, location, connectionId) {
|
|
|
190
191
|
await githubConnections.linkGitHubRepository(projectId, location, connectionId);
|
|
191
192
|
}
|
|
192
193
|
async function ensureAppHostingComputeServiceAccount(projectId, serviceAccount) {
|
|
194
|
+
await verifyRuntimeServiceAccountAccess(projectId, serviceAccount);
|
|
195
|
+
await provisionDefaultComputeServiceAccount(projectId);
|
|
196
|
+
}
|
|
197
|
+
async function verifyRuntimeServiceAccountAccess(projectId, serviceAccount) {
|
|
193
198
|
const sa = serviceAccount || defaultComputeServiceAccountEmail(projectId);
|
|
194
199
|
const name = `projects/${projectId}/serviceAccounts/${sa}`;
|
|
195
200
|
try {
|
|
@@ -206,7 +211,6 @@ async function ensureAppHostingComputeServiceAccount(projectId, serviceAccount)
|
|
|
206
211
|
throw new error_1.FirebaseError("Unexpected error occurred while testing for IAM service account permissions", { original: err });
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
|
-
await provisionDefaultComputeServiceAccount(projectId);
|
|
210
214
|
}
|
|
211
215
|
async function promptNewBackendId(projectId, location) {
|
|
212
216
|
while (true) {
|
|
@@ -266,13 +270,8 @@ async function createBackend(projectId, location, backendId, serviceAccount, rep
|
|
|
266
270
|
return await createBackendAndPoll();
|
|
267
271
|
}
|
|
268
272
|
async function provisionDefaultComputeServiceAccount(projectId) {
|
|
269
|
-
|
|
270
|
-
await
|
|
271
|
-
}
|
|
272
|
-
catch (err) {
|
|
273
|
-
if ((0, error_1.getErrStatus)(err) !== 409) {
|
|
274
|
-
throw err;
|
|
275
|
-
}
|
|
273
|
+
if (!(await defaultComputeServiceAccountExists(projectId))) {
|
|
274
|
+
await createDefaultComputeServiceAccount(projectId);
|
|
276
275
|
}
|
|
277
276
|
try {
|
|
278
277
|
await (0, resourceManager_1.addServiceAccountToRoles)(projectId, defaultComputeServiceAccountEmail(projectId), [
|
|
@@ -283,14 +282,49 @@ async function provisionDefaultComputeServiceAccount(projectId) {
|
|
|
283
282
|
], true);
|
|
284
283
|
}
|
|
285
284
|
catch (err) {
|
|
286
|
-
|
|
285
|
+
const status = (0, error_1.getErrStatus)(err);
|
|
286
|
+
if (status === 400) {
|
|
287
287
|
(0, utils_1.logWarning)("Your App Hosting compute service account is still being provisioned in the background. If you encounter an error, please try again after a few moments.");
|
|
288
288
|
}
|
|
289
|
+
else if (status === 403) {
|
|
290
|
+
(0, utils_1.logWarning)("Failed to grant roles to the default App Hosting compute service account. Make sure you " +
|
|
291
|
+
"have the resourcemanager.projects.setIamPolicy permission. If the service account " +
|
|
292
|
+
"already has these roles, this warning can be safely ignored.");
|
|
293
|
+
}
|
|
289
294
|
else {
|
|
290
295
|
throw err;
|
|
291
296
|
}
|
|
292
297
|
}
|
|
293
298
|
}
|
|
299
|
+
async function defaultComputeServiceAccountExists(projectId) {
|
|
300
|
+
try {
|
|
301
|
+
await iam.getServiceAccount(projectId, defaultComputeServiceAccountEmail(projectId));
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
catch (err) {
|
|
305
|
+
const status = (0, error_1.getErrStatus)(err);
|
|
306
|
+
if (status === 404 || status === 403) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
throw err;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function createDefaultComputeServiceAccount(projectId) {
|
|
313
|
+
try {
|
|
314
|
+
await iam.createServiceAccount(projectId, DEFAULT_COMPUTE_SERVICE_ACCOUNT_NAME, "Default service account used to run builds and deploys for Firebase App Hosting", "Firebase App Hosting compute service account");
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
const status = (0, error_1.getErrStatus)(err);
|
|
318
|
+
if (status === 403) {
|
|
319
|
+
(0, utils_1.logWarning)("Failed to create the default App Hosting compute service account. Make sure you have " +
|
|
320
|
+
"the iam.serviceAccounts.create permission. If the service account already exists, " +
|
|
321
|
+
"this warning can be safely ignored.");
|
|
322
|
+
}
|
|
323
|
+
else if (status !== 409) {
|
|
324
|
+
throw err;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
294
328
|
async function setDefaultTrafficPolicy(projectId, location, backendId, codebaseBranch) {
|
|
295
329
|
const traffic = {
|
|
296
330
|
rolloutPolicy: {
|
package/lib/apphosting/config.js
CHANGED
|
@@ -67,7 +67,7 @@ function load(yamlPath) {
|
|
|
67
67
|
return yaml.parseDocument(raw);
|
|
68
68
|
}
|
|
69
69
|
const dynamicDispatch = exports;
|
|
70
|
-
async function getAppHostingConfiguration(backendDir) {
|
|
70
|
+
async function getAppHostingConfiguration(backendDir, includeLocalConfigs = true) {
|
|
71
71
|
const appHostingConfigPaths = dynamicDispatch.listAppHostingFilesInPath(backendDir);
|
|
72
72
|
const fileNameToPathMap = Object.fromEntries(appHostingConfigPaths.map((path) => [(0, path_1.basename)(path), path]));
|
|
73
73
|
const output = yaml_1.AppHostingYamlConfig.empty();
|
|
@@ -78,13 +78,15 @@ async function getAppHostingConfiguration(backendDir) {
|
|
|
78
78
|
const baseFile = await yaml_1.AppHostingYamlConfig.loadFromFile(baseFilePath);
|
|
79
79
|
output.merge(baseFile, false);
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
if (includeLocalConfigs) {
|
|
82
|
+
if (emulatorsFilePath) {
|
|
83
|
+
const emulatorsConfig = await yaml_1.AppHostingYamlConfig.loadFromFile(emulatorsFilePath);
|
|
84
|
+
output.merge(emulatorsConfig, false);
|
|
85
|
+
}
|
|
86
|
+
if (localFilePath) {
|
|
87
|
+
const localYamlConfig = await yaml_1.AppHostingYamlConfig.loadFromFile(localFilePath);
|
|
88
|
+
output.merge(localYamlConfig, true);
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
return output;
|
|
90
92
|
}
|
|
@@ -48,7 +48,7 @@ function parseConnectionName(name) {
|
|
|
48
48
|
const devConnectPollerOptions = {
|
|
49
49
|
apiOrigin: (0, api_1.developerConnectOrigin)(),
|
|
50
50
|
apiVersion: "v1",
|
|
51
|
-
masterTimeout:
|
|
51
|
+
masterTimeout: 60 * 60 * 1000,
|
|
52
52
|
maxBackoff: 10000,
|
|
53
53
|
};
|
|
54
54
|
function extractRepoSlugFromUri(cloneUri) {
|
|
@@ -114,6 +114,14 @@ async function localBuild(projectId, projectRoot, env = {}, options) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
const addedEnv = await toProcessEnv(projectId, env);
|
|
117
|
+
if (options?.rootDir) {
|
|
118
|
+
const normalizedRootDir = options.rootDir.replace(/\\/g, "/");
|
|
119
|
+
const root = path.resolve(projectRoot);
|
|
120
|
+
const appDir = path.resolve(path.join(projectRoot, normalizedRootDir));
|
|
121
|
+
if (appDir !== root) {
|
|
122
|
+
addedEnv.GOOGLE_BUILDABLE = path.relative(root, appDir).replace(/\\/g, "/");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
117
125
|
const apphostingBuildOutput = await runUniversalMaker(projectRoot, addedEnv);
|
|
118
126
|
const discoveredEnv = apphostingBuildOutput.runConfig.environmentVariables?.map(({ variable, value, availability }) => ({
|
|
119
127
|
variable,
|
package/lib/apphosting/repo.js
CHANGED
|
@@ -36,7 +36,7 @@ function parseConnectionName(name) {
|
|
|
36
36
|
const gcbPollerOptions = {
|
|
37
37
|
apiOrigin: (0, api_1.cloudbuildOrigin)(),
|
|
38
38
|
apiVersion: "v2",
|
|
39
|
-
masterTimeout:
|
|
39
|
+
masterTimeout: 60 * 60 * 1000,
|
|
40
40
|
maxBackoff: 10000,
|
|
41
41
|
};
|
|
42
42
|
function extractRepoSlugFromUri(remoteUri) {
|
|
@@ -14,7 +14,7 @@ const backend_1 = require("./backend");
|
|
|
14
14
|
const apphostingPollerOptions = {
|
|
15
15
|
apiOrigin: (0, api_1.apphostingOrigin)(),
|
|
16
16
|
apiVersion: apphosting.API_VERSION,
|
|
17
|
-
masterTimeout:
|
|
17
|
+
masterTimeout: 60 * 60 * 1000,
|
|
18
18
|
maxBackoff: 10000,
|
|
19
19
|
};
|
|
20
20
|
const GIT_COMMIT_SHA_REGEX = /^(?:[0-9a-f]{40}|[0-9a-f]{7})$/;
|
package/lib/apphosting/yaml.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppHostingYamlConfig = void 0;
|
|
4
4
|
exports.toEnvMap = toEnvMap;
|
|
5
5
|
exports.toEnvList = toEnvList;
|
|
6
|
+
exports.toApiRunConfig = toApiRunConfig;
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
8
9
|
const config_1 = require("./config");
|
|
@@ -26,6 +27,9 @@ class AppHostingYamlConfig {
|
|
|
26
27
|
if (loadedAppHostingYaml.env) {
|
|
27
28
|
config.env = toEnvMap(loadedAppHostingYaml.env);
|
|
28
29
|
}
|
|
30
|
+
if (loadedAppHostingYaml.runConfig) {
|
|
31
|
+
config.runConfig = loadedAppHostingYaml.runConfig;
|
|
32
|
+
}
|
|
29
33
|
return config;
|
|
30
34
|
}
|
|
31
35
|
static empty() {
|
|
@@ -44,6 +48,12 @@ class AppHostingYamlConfig {
|
|
|
44
48
|
...this.env,
|
|
45
49
|
...other.env,
|
|
46
50
|
};
|
|
51
|
+
if (other.runConfig) {
|
|
52
|
+
this.runConfig = {
|
|
53
|
+
...this.runConfig,
|
|
54
|
+
...other.runConfig,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
47
57
|
}
|
|
48
58
|
async upsertFile(filePath) {
|
|
49
59
|
let yamlConfigToWrite = {};
|
|
@@ -52,6 +62,9 @@ class AppHostingYamlConfig {
|
|
|
52
62
|
yamlConfigToWrite = await (0, utils_1.wrappedSafeLoad)(file.source);
|
|
53
63
|
}
|
|
54
64
|
yamlConfigToWrite.env = toEnvList(this.env);
|
|
65
|
+
if (this.runConfig) {
|
|
66
|
+
yamlConfigToWrite.runConfig = this.runConfig;
|
|
67
|
+
}
|
|
55
68
|
(0, config_1.store)(filePath, yaml.parseDocument(jsYaml.dump(yamlConfigToWrite)));
|
|
56
69
|
}
|
|
57
70
|
}
|
|
@@ -67,3 +80,17 @@ function toEnvList(envs) {
|
|
|
67
80
|
return { ...env, variable };
|
|
68
81
|
});
|
|
69
82
|
}
|
|
83
|
+
function toApiRunConfig(runConfig) {
|
|
84
|
+
if (!runConfig) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const { memoryMiB, ...rest } = runConfig;
|
|
88
|
+
const apiConfig = {
|
|
89
|
+
...rest,
|
|
90
|
+
...(memoryMiB !== undefined ? { memoryMib: memoryMiB } : {}),
|
|
91
|
+
};
|
|
92
|
+
if (Object.keys(apiConfig).length === 0) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
return apiConfig;
|
|
96
|
+
}
|
package/lib/bin/cli.js
CHANGED
|
@@ -82,7 +82,10 @@ function cli(pkg) {
|
|
|
82
82
|
help = "Having trouble? Try " + clc.bold("firebase [command] --help");
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
|
|
85
|
+
const logFileDisplay = process.env.FIREBASE_DEBUG_PATH?.trim()
|
|
86
|
+
? logFilename
|
|
87
|
+
: "firebase-debug.log";
|
|
88
|
+
help = `Having trouble? Try again or contact support with contents of ${logFileDisplay}`;
|
|
86
89
|
}
|
|
87
90
|
if (cmd) {
|
|
88
91
|
console.log();
|
package/lib/bin/mcp.js
CHANGED
|
@@ -92,9 +92,14 @@ async function mcp() {
|
|
|
92
92
|
process.exit(1);
|
|
93
93
|
}
|
|
94
94
|
(0, env_1.setFirebaseMcp)(true);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if (process.env.FIREBASE_DEBUG_PATH?.trim()) {
|
|
96
|
+
(0, logger_1.useFileLogger)();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const mcpLogDir = (0, path_1.join)((0, os_1.homedir)(), ".cache", "firebase");
|
|
100
|
+
await (0, promises_1.mkdir)(mcpLogDir, { recursive: true });
|
|
101
|
+
(0, logger_1.useFileLogger)((0, path_1.join)(mcpLogDir, "firebase-debug.log"));
|
|
102
|
+
}
|
|
98
103
|
const activeFeatures = (values.only || "")
|
|
99
104
|
.split(",")
|
|
100
105
|
.map((f) => f.trim())
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
+
exports.handleSecretEjection = handleSecretEjection;
|
|
4
5
|
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
5
6
|
const command_1 = require("../command");
|
|
6
7
|
const planner = require("../deploy/extensions/planner");
|
|
@@ -20,25 +21,22 @@ const utils_1 = require("../utils");
|
|
|
20
21
|
const env_1 = require("../functions/env");
|
|
21
22
|
const fs_1 = require("fs");
|
|
22
23
|
const path_1 = require("path");
|
|
23
|
-
const utils_2 = require("../utils");
|
|
24
24
|
const config_1 = require("../config");
|
|
25
25
|
const projectConfig_1 = require("../functions/projectConfig");
|
|
26
26
|
const error_1 = require("../error");
|
|
27
|
-
const clc = require("colorette");
|
|
28
27
|
const experiments = require("../experiments");
|
|
29
28
|
exports.command = new command_1.Command("ext:export")
|
|
30
29
|
.description("export Extension instances installed on a project to a local Firebase directory")
|
|
31
30
|
.option(`--mode <target>`, `experimental: controls the target system of the export (supports "extensions", "functions")`)
|
|
32
|
-
.option(
|
|
33
|
-
.option(
|
|
31
|
+
.option("--instance <instanceId>", "scope the export to the single instance with the specified instance id")
|
|
32
|
+
.option("-k, --kit-instance <kitId>", "write the .env export from --mode functions to the config path for a kit instance currently defined in firebase.json")
|
|
34
33
|
.option(`--outputDir <path>`, `override the .env export from --mode functions to a specific arbitrary path`)
|
|
35
34
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
36
35
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
37
36
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
38
37
|
.withForce()
|
|
39
38
|
.action(async (options) => {
|
|
40
|
-
if (experiments.isEnabled("extMigrationFeatures") &&
|
|
41
|
-
(options.mode === "functions" || options.mode === "kits")) {
|
|
39
|
+
if (experiments.isEnabled("extMigrationFeatures") && options.mode === "functions") {
|
|
42
40
|
await fnHandler(options);
|
|
43
41
|
}
|
|
44
42
|
else {
|
|
@@ -53,10 +51,10 @@ async function extHandler(options) {
|
|
|
53
51
|
logger_1.logger.info(`No extension instances installed on ${projectId}, so there is nothing to export.`);
|
|
54
52
|
return;
|
|
55
53
|
}
|
|
56
|
-
if (options.
|
|
57
|
-
have = have.filter((s) => s.instanceId === options.
|
|
54
|
+
if (options.instance) {
|
|
55
|
+
have = have.filter((s) => s.instanceId === options.instance);
|
|
58
56
|
if (have.length === 0) {
|
|
59
|
-
logger_1.logger.info(`No extension instances installed on ${projectId} match specified instance ID ${options.
|
|
57
|
+
logger_1.logger.info(`No extension instances installed on ${projectId} match specified instance ID ${options.instance}.`);
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
62
60
|
}
|
|
@@ -97,67 +95,84 @@ async function extHandler(options) {
|
|
|
97
95
|
(0, etags_1.saveEtags)(options.rc, projectId, have);
|
|
98
96
|
}
|
|
99
97
|
async function fnHandler(options) {
|
|
100
|
-
if (!options.
|
|
98
|
+
if (!options.instance) {
|
|
101
99
|
logger_1.logger.info(`ext:export must specify an --instance <instanceId> option when exporting to Functions. Use ext:list to find your instance IDs.`);
|
|
102
100
|
return;
|
|
103
101
|
}
|
|
104
102
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
105
|
-
const instance = await (0, extensionsApi_1.getInstance)(projectId, options.
|
|
103
|
+
const instance = await (0, extensionsApi_1.getInstance)(projectId, options.instance);
|
|
106
104
|
if (typeof instance === "undefined") {
|
|
107
|
-
logger_1.logger.info(`No extension matching instance ID ${options.
|
|
105
|
+
logger_1.logger.info(`No extension matching instance ID ${options.instance} found`);
|
|
108
106
|
return;
|
|
109
107
|
}
|
|
110
108
|
if (instance.state !== "ACTIVE" && !options.force) {
|
|
111
|
-
throw new error_1.FirebaseError(`Extension ${options.
|
|
109
|
+
throw new error_1.FirebaseError(`Extension ${options.instance} is in state ${instance.state}. To export a non-ACTIVE extension, use the --force option.`);
|
|
112
110
|
}
|
|
113
111
|
const instanceId = (0, utils_1.last)(instance.name.split("/")) ?? "";
|
|
114
|
-
if (instanceId !== options.
|
|
112
|
+
if (instanceId !== options.instance) {
|
|
115
113
|
return;
|
|
116
114
|
}
|
|
117
|
-
|
|
115
|
+
await handleSecretEjection(options, instance);
|
|
118
116
|
const convertedEnv = (0, export_1.functionsEnvFromInstance)(instance);
|
|
119
|
-
for (const key of Object.keys(convertedEnv)) {
|
|
120
|
-
if (key.startsWith("FIREBASE_SECRET_REF_")) {
|
|
121
|
-
secretCount += 1;
|
|
122
|
-
}
|
|
123
|
-
console.log(`${key}=${convertedEnv[key]}`);
|
|
124
|
-
}
|
|
125
117
|
const writeLocation = kitExportTarget(instanceId, projectId, options);
|
|
126
118
|
if ((0, env_1.hasUserEnvs)(writeLocation)) {
|
|
127
119
|
logger_1.logger.info(`Exported extensions config appears to already exist in /${instanceId}, aborting write.`);
|
|
128
120
|
}
|
|
129
121
|
else {
|
|
130
|
-
(0,
|
|
131
|
-
|
|
132
|
-
(0, fs_1.mkdirSync)((0, path_1.join)(writeLocation.projectDir, writeLocation.configDir ?? instanceId), {
|
|
122
|
+
(0, utils_1.logLabeledBullet)("functions", `Saving exported extensions config as a Function Kits .env file`);
|
|
123
|
+
(0, fs_1.mkdirSync)((0, path_1.resolve)(writeLocation.projectDir, writeLocation.configDir ?? instanceId), {
|
|
133
124
|
recursive: true,
|
|
134
125
|
});
|
|
135
126
|
(0, env_1.writeUserEnvs)(convertedEnv, writeLocation);
|
|
136
127
|
}
|
|
137
|
-
|
|
128
|
+
}
|
|
129
|
+
async function handleSecretEjection(options, instance) {
|
|
130
|
+
const secrets = await (0, export_1.secretsNeedingEjection)(instance);
|
|
131
|
+
if (secrets.length === 0) {
|
|
138
132
|
return;
|
|
139
133
|
}
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
(0, utils_1.logLabeledBullet)("functions", "Cloud Secret Manager resources still require migration from Extensions lifecycle management to Kits.");
|
|
135
|
+
(0, utils_1.logLabeledWarning)("functions", "Finishing the Extension migration process with extensions:uninstall without migrating bound secrets will result in permanent loss of secrets.");
|
|
136
|
+
const userAllowedEjection = await (0, prompt_1.confirm)({
|
|
137
|
+
message: `Automatically migrate ${secrets.length} Secrets from Extensions to Kits? (Y/n)`,
|
|
142
138
|
nonInteractive: options.nonInteractive,
|
|
143
139
|
force: options.force,
|
|
144
140
|
default: true,
|
|
145
|
-
})
|
|
146
|
-
|
|
141
|
+
});
|
|
142
|
+
if (userAllowedEjection) {
|
|
143
|
+
const results = await (0, export_1.ejectSecretsFromInstance)(instance);
|
|
144
|
+
if (results.fail.length > 0) {
|
|
145
|
+
let resultMsg = "";
|
|
146
|
+
if (results.success.length > 0) {
|
|
147
|
+
resultMsg = `Added functions-managed label to secrets: ${results.success}.`;
|
|
148
|
+
}
|
|
149
|
+
resultMsg += `${results.fail.length} secrets failed to update: ${results.fail}`;
|
|
150
|
+
(0, utils_1.logLabeledError)("functions", resultMsg);
|
|
151
|
+
if (!options.force) {
|
|
152
|
+
throw new error_1.FirebaseError("Secret migration failed.");
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
(0, utils_1.logLabeledWarning)("functions", "Proceeding after secret migration failure in --force mode. Manually remove the 'firebase-extensions-managed' label from the secrets, or risk permanent data loss.");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
(0, utils_1.logLabeledBullet)("functions", `Added functions-managed label to secrets: ${results.success}.`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
(0, utils_1.logLabeledError)("functions", "Proceeding without migrating secrets risks permanent data loss. Manually remove the 'firebase-extensions-managed' label from the secrets before running ext:uninstall.");
|
|
147
164
|
}
|
|
148
|
-
const secretsChanged = await (0, export_1.ejectSecretsFromInstance)(instance);
|
|
149
|
-
(0, utils_2.logBullet)(clc.cyan(clc.bold("functions: ")) +
|
|
150
|
-
`Added functions-managed label to secrets: ${secretsChanged}`);
|
|
151
165
|
}
|
|
152
166
|
function kitExportTarget(instanceId, projectId, options) {
|
|
153
167
|
const firebaseConfig = config_1.Config.load(options, true);
|
|
168
|
+
const cwd = options.cwd ?? process.cwd();
|
|
154
169
|
if (typeof options.outputDir !== "undefined") {
|
|
155
170
|
return {
|
|
156
171
|
functionsSource: instanceId,
|
|
157
|
-
configDir: String(options.outputDir),
|
|
172
|
+
configDir: (0, path_1.resolve)(cwd, String(options.outputDir)),
|
|
158
173
|
projectId: projectId,
|
|
159
174
|
isEmulator: false,
|
|
160
|
-
projectDir:
|
|
175
|
+
projectDir: cwd,
|
|
161
176
|
};
|
|
162
177
|
}
|
|
163
178
|
if (typeof options.kitInstance !== "undefined") {
|
|
@@ -170,23 +185,25 @@ function kitExportTarget(instanceId, projectId, options) {
|
|
|
170
185
|
if (!(0, projectConfig_1.isKitConfig)(fn)) {
|
|
171
186
|
continue;
|
|
172
187
|
}
|
|
173
|
-
for (const [
|
|
174
|
-
if (
|
|
188
|
+
for (const [kitInstanceId, configDirPath] of Object.entries(fn.instances)) {
|
|
189
|
+
if (kitInstanceId === options.kitInstance) {
|
|
190
|
+
const projectDir = options.projectRoot ?? cwd;
|
|
175
191
|
return {
|
|
176
192
|
functionsSource: instanceId,
|
|
177
|
-
configDir: String(
|
|
193
|
+
configDir: (0, path_1.resolve)(projectDir, String(configDirPath)),
|
|
178
194
|
projectId: projectId,
|
|
179
195
|
isEmulator: false,
|
|
180
|
-
projectDir:
|
|
196
|
+
projectDir: projectDir,
|
|
181
197
|
};
|
|
182
198
|
}
|
|
183
199
|
}
|
|
184
200
|
}
|
|
201
|
+
throw new error_1.FirebaseError(`Could not find kit instance "${options.kitInstance}" in firebase.json.`);
|
|
185
202
|
}
|
|
186
203
|
if (typeof options.projectRoot !== "undefined") {
|
|
187
204
|
return {
|
|
188
205
|
functionsSource: instanceId,
|
|
189
|
-
configDir: (0, path_1.
|
|
206
|
+
configDir: (0, path_1.resolve)(options.projectRoot, instanceId),
|
|
190
207
|
projectId: projectId,
|
|
191
208
|
isEmulator: false,
|
|
192
209
|
projectDir: options.projectRoot,
|
|
@@ -195,10 +212,10 @@ function kitExportTarget(instanceId, projectId, options) {
|
|
|
195
212
|
else {
|
|
196
213
|
return {
|
|
197
214
|
functionsSource: instanceId,
|
|
198
|
-
configDir: instanceId,
|
|
215
|
+
configDir: (0, path_1.resolve)(cwd, instanceId),
|
|
199
216
|
projectId: projectId,
|
|
200
217
|
isEmulator: false,
|
|
201
|
-
projectDir:
|
|
218
|
+
projectDir: cwd,
|
|
202
219
|
};
|
|
203
220
|
}
|
|
204
221
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
9
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
10
|
+
const migrate_1 = require("../extensions/migrate");
|
|
11
|
+
const kits_1 = require("../functions/kits");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
|
+
exports.command = new command_1.Command("ext:migrate")
|
|
15
|
+
.description("migrate an extension instance to a function kit")
|
|
16
|
+
.option("-p, --package <package>", "optional kit package override to use")
|
|
17
|
+
.option("-i, --ext-instance <instanceId>", "extension instance ID to migrate")
|
|
18
|
+
.option("-e, --extension <extensionRef>", "extension reference or name to migrate")
|
|
19
|
+
.option("-f, --force", "force update and migration without prompting")
|
|
20
|
+
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.list"])
|
|
21
|
+
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
22
|
+
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
25
|
+
if (options.package) {
|
|
26
|
+
(0, kits_1.validateNpmPackageName)(options.package);
|
|
27
|
+
}
|
|
28
|
+
const plan = await (0, migrate_1.createMigrationPlan)(projectId, {
|
|
29
|
+
package: options.package,
|
|
30
|
+
extInstance: options.extInstance,
|
|
31
|
+
extension: options.extension,
|
|
32
|
+
nonInteractive: options.nonInteractive,
|
|
33
|
+
force: options.force,
|
|
34
|
+
});
|
|
35
|
+
(0, utils_1.logLabeledBullet)(extensionsHelper_1.logPrefix, `Selected instance ${clc.bold(plan.instanceId)} (${plan.kitPackage}) for migration.`);
|
|
36
|
+
plan.instance = await (0, migrate_1.ensureInstanceUpToDate)(projectId, plan.instance, options);
|
|
37
|
+
logger_1.logger.info("TODO: Draw the rest of the owl");
|
|
38
|
+
return plan;
|
|
39
|
+
});
|
|
@@ -2,22 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const functionsConfig = require("../functionsConfig");
|
|
6
5
|
const command_1 = require("../command");
|
|
7
|
-
const error_1 = require("../error");
|
|
8
6
|
const projectUtils_1 = require("../projectUtils");
|
|
9
|
-
const prompt_1 = require("../prompt");
|
|
10
|
-
const functional_1 = require("../functional");
|
|
11
7
|
const requirePermissions_1 = require("../requirePermissions");
|
|
12
8
|
const helper = require("../deploy/functions/functionsDeployHelper");
|
|
13
9
|
const utils = require("../utils");
|
|
14
10
|
const backend = require("../deploy/functions/backend");
|
|
15
11
|
const projectConfig = require("../functions/projectConfig");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const executor = require("../deploy/functions/release/executor");
|
|
19
|
-
const reporter = require("../deploy/functions/release/reporter");
|
|
20
|
-
const getProjectNumber_1 = require("../getProjectNumber");
|
|
12
|
+
const delete_1 = require("../deploy/functions/delete");
|
|
13
|
+
const error_1 = require("../error");
|
|
21
14
|
exports.command = new command_1.Command("functions:delete [filters...]")
|
|
22
15
|
.description("delete one or more Cloud Functions by name, group name, or codebase.")
|
|
23
16
|
.option("--region <region>", "Specify region of the function to be deleted. " +
|
|
@@ -32,13 +25,8 @@ exports.command = new command_1.Command("functions:delete [filters...]")
|
|
|
32
25
|
projectId: (0, projectUtils_1.needProjectId)(options),
|
|
33
26
|
filters: [],
|
|
34
27
|
};
|
|
35
|
-
|
|
36
|
-
functionsConfig.getFirebaseConfig(options),
|
|
37
|
-
backend.existingBackend(context),
|
|
38
|
-
]);
|
|
39
|
-
let existingBackend = letExistingBackend;
|
|
28
|
+
let existingBackend = await backend.existingBackend(context);
|
|
40
29
|
await backend.checkAvailability(context, backend.empty());
|
|
41
|
-
const appEngineLocation = functionsConfig.getAppEngineLocation(firebaseConfig);
|
|
42
30
|
if (options.region) {
|
|
43
31
|
existingBackend = backend.matchingBackend(existingBackend, (ep) => ep.region === options.region);
|
|
44
32
|
}
|
|
@@ -48,63 +36,14 @@ exports.command = new command_1.Command("functions:delete [filters...]")
|
|
|
48
36
|
.map((ep) => ep.codebase || projectConfig.DEFAULT_CODEBASE)),
|
|
49
37
|
];
|
|
50
38
|
context.filters = helper.parseDeleteFilters(filters, activeCodebases);
|
|
51
|
-
const plan = await planner.createDeploymentPlan({
|
|
52
|
-
wantBackend: backend.empty(),
|
|
53
|
-
haveBackend: existingBackend,
|
|
54
|
-
codebase: "",
|
|
55
|
-
projectId: context.projectId,
|
|
56
|
-
filters: context.filters,
|
|
57
|
-
deleteAll: true,
|
|
58
|
-
});
|
|
59
|
-
const allEpToDelete = Object.values(plan.regionalChangesets)
|
|
60
|
-
.map((changes) => changes.endpointsToDelete)
|
|
61
|
-
.reduce(functional_1.reduceFlat, [])
|
|
62
|
-
.sort(backend.compareFunctions);
|
|
63
|
-
if (allEpToDelete.length === 0) {
|
|
64
|
-
throw new error_1.FirebaseError(`The specified filters do not match any existing functions in project ${clc.bold(context.projectId)}.`);
|
|
65
|
-
}
|
|
66
39
|
const allEndpoints = backend.allEndpoints(existingBackend);
|
|
67
40
|
const collisions = helper.detectCodebaseAndIdCollisions(filters, activeCodebases, allEndpoints, projectConfig.DEFAULT_CODEBASE);
|
|
68
41
|
for (const c of collisions) {
|
|
69
42
|
utils.logLabeledBullet("functions", `Target '${clc.bold(c.filter)}' matches both a codebase and a function (${c.functionLabel}). Codebase deletion takes precedence. ` +
|
|
70
43
|
`(To delete the function instead, run: ${clc.bold(c.workaroundCommand)})`);
|
|
71
44
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
deleteList +
|
|
76
|
-
"\n Are you sure?",
|
|
77
|
-
default: false,
|
|
78
|
-
force: options.force,
|
|
79
|
-
nonInteractive: options.nonInteractive,
|
|
80
|
-
});
|
|
81
|
-
if (!confirmDeletion) {
|
|
82
|
-
throw new error_1.FirebaseError("Command aborted.");
|
|
83
|
-
}
|
|
84
|
-
const functionExecutor = new executor.QueueExecutor({
|
|
85
|
-
retries: 30,
|
|
86
|
-
backoff: 20000,
|
|
87
|
-
concurrency: 40,
|
|
88
|
-
maxBackoff: 40000,
|
|
89
|
-
});
|
|
90
|
-
try {
|
|
91
|
-
const fab = new fabricator.Fabricator({
|
|
92
|
-
functionExecutor,
|
|
93
|
-
runFunctionExecutor: functionExecutor,
|
|
94
|
-
appEngineLocation,
|
|
95
|
-
executor: new executor.QueueExecutor({}),
|
|
96
|
-
sources: {},
|
|
97
|
-
projectNumber: options.projectNumber || (await (0, getProjectNumber_1.getProjectNumber)({ projectId: context.projectId })),
|
|
98
|
-
projectId: context.projectId,
|
|
99
|
-
});
|
|
100
|
-
const summary = await fab.applyPlan({ default: plan });
|
|
101
|
-
await reporter.logAndTrackDeployStats(summary);
|
|
102
|
-
reporter.printErrors(summary);
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
throw new error_1.FirebaseError("Failed to delete functions", {
|
|
106
|
-
original: err,
|
|
107
|
-
exit: 1,
|
|
108
|
-
});
|
|
45
|
+
const deletionCount = await (0, delete_1.deleteFunctionsByEndpointFilters)(context, options);
|
|
46
|
+
if (deletionCount === 0) {
|
|
47
|
+
throw new error_1.FirebaseError(`The specified filters do not match any existing functions in project ${clc.bold(context.projectId)}.`);
|
|
109
48
|
}
|
|
110
49
|
});
|