Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue where `firebase init dataconnect` didn't enable the Data Connect API by default (#8927).
1 change: 1 addition & 0 deletions src/dataconnect/ensureApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@

const prefix = "dataconnect";

export async function ensureApis(projectId: string): Promise<void> {

Check warning on line 6 in src/dataconnect/ensureApis.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
await ensure(projectId, api.dataconnectOrigin(), prefix);
await ensure(projectId, api.cloudSQLAdminOrigin(), prefix);
await ensure(projectId, api.computeOrigin(), prefix);
}

export async function ensureSparkApis(projectId: string): Promise<void> {

Check warning on line 12 in src/dataconnect/ensureApis.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
// These are the APIs that can be enabled without a billing account.
await ensure(projectId, api.cloudSQLAdminOrigin(), prefix);
await ensure(projectId, api.dataconnectOrigin(), prefix);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider executing these ensure calls in parallel using Promise.all, as they are independent network operations. This could potentially speed up the init process.

Suggested change
await ensure(projectId, api.dataconnectOrigin(), prefix);
await Promise.all([
ensure(projectId, api.cloudSQLAdminOrigin(), prefix),
ensure(projectId, api.dataconnectOrigin(), prefix),
]);

}

export async function ensureGIFApis(projectId: string): Promise<void> {

Check warning on line 18 in src/dataconnect/ensureApis.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
await ensure(projectId, api.cloudAiCompanionOrigin(), prefix);
}
Loading