firebase-tools 14.9.0 → 14.10.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.
@@ -152,7 +152,7 @@ async function createGitRepoLink(projectId, location, connectionId) {
152
152
  await githubConnections.linkGitHubRepository(projectId, location, connectionId);
153
153
  }
154
154
  exports.createGitRepoLink = createGitRepoLink;
155
- async function ensureAppHostingComputeServiceAccount(projectId, serviceAccount, deployFromSource = false) {
155
+ async function ensureAppHostingComputeServiceAccount(projectId, serviceAccount) {
156
156
  const sa = serviceAccount || defaultComputeServiceAccountEmail(projectId);
157
157
  const name = `projects/${projectId}/serviceAccounts/${sa}`;
158
158
  try {
@@ -162,21 +162,11 @@ async function ensureAppHostingComputeServiceAccount(projectId, serviceAccount,
162
162
  if (!(err instanceof error_1.FirebaseError)) {
163
163
  throw err;
164
164
  }
165
- if (err.status === 404) {
166
- await provisionDefaultComputeServiceAccount(projectId);
167
- }
168
165
  else if (err.status === 403) {
169
166
  throw new error_1.FirebaseError(`Failed to create backend due to missing delegation permissions for ${sa}. Make sure you have the iam.serviceAccounts.actAs permission.`, { original: err });
170
167
  }
171
168
  }
172
- if (deployFromSource) {
173
- const policy = await (0, resourceManager_1.getIamPolicy)(projectId);
174
- const objectViewerBinding = policy.bindings.find((binding) => binding.role === "roles/storage.objectViewer");
175
- if (!objectViewerBinding ||
176
- !objectViewerBinding.members.includes(`serviceAccount:${defaultComputeServiceAccountEmail(projectId)}`)) {
177
- await (0, resourceManager_1.addServiceAccountToRoles)(projectId, defaultComputeServiceAccountEmail(projectId), ["roles/storage.objectViewer"], true);
178
- }
179
- }
169
+ await provisionDefaultComputeServiceAccount(projectId);
180
170
  }
181
171
  exports.ensureAppHostingComputeServiceAccount = ensureAppHostingComputeServiceAccount;
182
172
  async function promptNewBackendId(projectId, location) {
@@ -232,12 +222,22 @@ async function provisionDefaultComputeServiceAccount(projectId) {
232
222
  throw err;
233
223
  }
234
224
  }
235
- await (0, resourceManager_1.addServiceAccountToRoles)(projectId, defaultComputeServiceAccountEmail(projectId), [
236
- "roles/firebaseapphosting.computeRunner",
237
- "roles/firebase.sdkAdminServiceAgent",
238
- "roles/developerconnect.readTokenAccessor",
239
- "roles/storage.objectViewer",
240
- ], true);
225
+ try {
226
+ await (0, resourceManager_1.addServiceAccountToRoles)(projectId, defaultComputeServiceAccountEmail(projectId), [
227
+ "roles/firebaseapphosting.computeRunner",
228
+ "roles/firebase.sdkAdminServiceAgent",
229
+ "roles/developerconnect.readTokenAccessor",
230
+ "roles/storage.objectViewer",
231
+ ], true);
232
+ }
233
+ catch (err) {
234
+ if ((0, error_1.getErrStatus)(err) === 400) {
235
+ (0, utils_1.logWarning)("Your App Hosting compute service account is still being provisioned in the background; you may continue with the init flow.");
236
+ }
237
+ else {
238
+ throw err;
239
+ }
240
+ }
241
241
  }
242
242
  async function setDefaultTrafficPolicy(projectId, location, backendId, codebaseBranch) {
243
243
  const traffic = {
@@ -14,7 +14,7 @@ async function default_1(context, options) {
14
14
  await (0, apphosting_1.ensureApiEnabled)(options);
15
15
  await (0, backend_1.ensureRequiredApisEnabled)(projectId);
16
16
  try {
17
- await (0, backend_1.ensureAppHostingComputeServiceAccount)(projectId, "", true);
17
+ await (0, backend_1.ensureAppHostingComputeServiceAccount)(projectId, "");
18
18
  }
19
19
  catch (err) {
20
20
  if (err.status === 400) {
@@ -358,6 +358,7 @@ async function startAll(options, showUI = true, runningTestScript = false) {
358
358
  if (extensionEmulator) {
359
359
  await startEmulator(extensionEmulator);
360
360
  }
361
+ const account = (0, auth_1.getProjectDefaultAccount)(options.projectRoot);
361
362
  if (emulatableBackends.length) {
362
363
  if (!listenForEmulator.functions || !listenForEmulator.eventarc || !listenForEmulator.tasks) {
363
364
  listenForEmulator = await (0, portUtils_1.resolveHostAndAssignPorts)(Object.assign(Object.assign({}, listenForEmulator), { functions: (_h = listenForEmulator.functions) !== null && _h !== void 0 ? _h : getListenConfig(options, types_1.Emulators.FUNCTIONS), eventarc: (_j = listenForEmulator.eventarc) !== null && _j !== void 0 ? _j : getListenConfig(options, types_1.Emulators.EVENTARC), tasks: (_k = listenForEmulator.eventarc) !== null && _k !== void 0 ? _k : getListenConfig(options, types_1.Emulators.TASKS) }));
@@ -378,7 +379,6 @@ async function startAll(options, showUI = true, runningTestScript = false) {
378
379
  if (emulatorsNotRunning.length > 0 && !constants_1.Constants.isDemoProject(projectId)) {
379
380
  functionsLogger.logLabeled("WARN", "functions", `The following emulators are not running, calls to these services from the Functions emulator will affect production: ${clc.bold(emulatorsNotRunning.join(", "))}`);
380
381
  }
381
- const account = (0, auth_1.getProjectDefaultAccount)(options.projectRoot);
382
382
  const functionsEmulator = new functionsEmulator_1.FunctionsEmulator({
383
383
  projectId,
384
384
  projectDir,
@@ -574,6 +574,7 @@ async function startAll(options, showUI = true, runningTestScript = false) {
574
574
  enable_output_generated_sdk: true,
575
575
  enable_output_schema_extensions: true,
576
576
  debug: options.debug,
577
+ account,
577
578
  };
578
579
  if (exportMetadata.dataconnect) {
579
580
  utils.assertIsString(options.import);
@@ -250,7 +250,6 @@ class DataConnectEmulator {
250
250
  if (account) {
251
251
  const defaultCredPath = await (0, defaultCredentials_1.getCredentialPathAsync)(account);
252
252
  if (defaultCredPath) {
253
- logger_1.logger.log("DEBUG", `Setting GAC to ${defaultCredPath}`);
254
253
  credsEnv.GOOGLE_APPLICATION_CREDENTIALS = defaultCredPath;
255
254
  }
256
255
  }
@@ -54,28 +54,28 @@
54
54
  },
55
55
  "dataconnect": {
56
56
  "darwin": {
57
- "version": "2.8.0",
58
- "expectedSize": 29279072,
59
- "expectedChecksum": "0381ba8dd2eb67629cbbf4a88b276850",
60
- "expectedChecksumSHA256": "bc88bca96c83df21f7ed4b66c2a518ca48a21ba259fe481c0911fb5010d2fa0f",
61
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-v2.8.0",
62
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.8.0"
57
+ "version": "2.9.0",
58
+ "expectedSize": 27415296,
59
+ "expectedChecksum": "5814d22b06b1321409f40693dfe47288",
60
+ "expectedChecksumSHA256": "8df1cfac6ef747909b3c18b57ba52b70a11d53b9d0a22b197011d6550ceca133",
61
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-macos-v2.9.0",
62
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.9.0"
63
63
  },
64
64
  "win32": {
65
- "version": "2.8.0",
66
- "expectedSize": 29769216,
67
- "expectedChecksum": "622e7c7e23b0bd7592ad5a0ca0934987",
68
- "expectedChecksumSHA256": "c23484eaf8f1ac68653bb29bb307de9d1c47a1fc4005610b094772e7ac368512",
69
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-v2.8.0",
70
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.8.0.exe"
65
+ "version": "2.9.0",
66
+ "expectedSize": 27875328,
67
+ "expectedChecksum": "21381052c2bf767ee84fb85975cfd4d5",
68
+ "expectedChecksumSHA256": "6bebaa9575b460c4fa170b191d94722923a3c869bc1eca24c7e444428e6b7a70",
69
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-windows-v2.9.0",
70
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.9.0.exe"
71
71
  },
72
72
  "linux": {
73
- "version": "2.8.0",
74
- "expectedSize": 29208760,
75
- "expectedChecksum": "dd9b1b9a55761f4d763a11bb7b84cbff",
76
- "expectedChecksumSHA256": "7ffe98a28e9c185ddb07cdbf1610dc86747083afca9ac8cb850214ca8f1147c4",
77
- "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-v2.8.0",
78
- "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.8.0"
73
+ "version": "2.9.0",
74
+ "expectedSize": 27332760,
75
+ "expectedChecksum": "0480a92f5af8e8441e680dc4e7995263",
76
+ "expectedChecksumSHA256": "4f60baf4649c670227314302056f50b1c40ccc8d673b98d16935977508342a67",
77
+ "remoteUrl": "https://storage.googleapis.com/firemat-preview-drop/emulator/dataconnect-emulator-linux-v2.9.0",
78
+ "downloadPathRelativeToCacheDir": "dataconnect-emulator-2.9.0"
79
79
  }
80
80
  }
81
81
  }
@@ -33,7 +33,8 @@ function setNewDefaults(params, newDefaults) {
33
33
  if (newDefaults[param.param]) {
34
34
  param.default = newDefaults[param.param];
35
35
  }
36
- else if ((param.param = `firebaseextensions.v1beta.function/location` && newDefaults["LOCATION"])) {
36
+ else if (param.param === `firebaseextensions.v1beta.function/location` &&
37
+ newDefaults["LOCATION"]) {
37
38
  param.default = newDefaults["LOCATION"];
38
39
  }
39
40
  }
@@ -22,17 +22,7 @@ async function doSetup(setup, config) {
22
22
  }
23
23
  await (0, apphosting_1.ensureApiEnabled)({ projectId });
24
24
  await (0, backend_1.ensureRequiredApisEnabled)(projectId);
25
- const spinner = ora("Checking your App Hosting compute service account...").start();
26
- try {
27
- await (0, backend_1.ensureAppHostingComputeServiceAccount)(projectId, "", true);
28
- spinner.succeed("App Hosting compute Service account is ready");
29
- }
30
- catch (err) {
31
- if (err.status === 400) {
32
- spinner.warn("Your App Hosting compute service account is still being provisioned. Please try again in a few moments.");
33
- }
34
- throw err;
35
- }
25
+ await (0, backend_1.ensureAppHostingComputeServiceAccount)(projectId, "");
36
26
  utils.logBullet("This command links your local project to Firebase App Hosting. You will be able to deploy your web app with `firebase deploy` after setup.");
37
27
  const backendConfig = {
38
28
  backendId: "",
@@ -12,7 +12,7 @@ exports.list_top_issues = (0, tool_js_1.tool)({
12
12
  app_id: zod_1.z
13
13
  .string()
14
14
  .optional()
15
- .describe("AppId for which the issues list is fetched. Defaults to the first appId provided by firebase_list_apps."),
15
+ .describe("AppId for which the issues list should be fetched. For an Android application, read the mobilesdk_app_id value specified in the google-services.json file for the current package name. For an iOS Application, read the GOOGLE_APP_ID from GoogleService-Info.plist. If neither is available, use the `firebase_list_apps` tool to find an app_id to pass to this tool."),
16
16
  issue_count: zod_1.z
17
17
  .number()
18
18
  .optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "14.9.0",
3
+ "version": "14.10.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {