Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore Firestore emulator host on functions deploy #6442

Merged
merged 3 commits into from
Oct 11, 2023
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
@@ -1 +1,2 @@
- Ignore `FIRESTORE_EMULATOR_HOST` environment variable on functions deploy. (#6442)
- Added support for enabling, disabling, and displaying Point In Time Recovery enablement state on Firestore databases (#6388)
4 changes: 2 additions & 2 deletions src/gcp/firestore.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { firestoreOriginOrEmulator } from "../api";
import { firestoreOrigin } from "../api";
import { Client } from "../apiv2";
import { logger } from "../logger";

const apiClient = new Client({
auth: true,
apiVersion: "v1",
urlPrefix: firestoreOriginOrEmulator,
urlPrefix: firestoreOrigin,
});

interface Database {
Expand Down Expand Up @@ -57,7 +57,7 @@
pageSize: 2147483647,
};

return apiClient.post<any, { collectionIds?: string[] }>(url, data).then((res) => {

Check warning on line 60 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
return res.body.collectionIds || [];
});
}
Expand All @@ -71,8 +71,8 @@
* @param {object} doc a Document object to delete.
* @return {Promise} a promise for the delete operation.
*/
export async function deleteDocument(doc: any): Promise<any> {

Check warning on line 74 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type

Check warning on line 74 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
return apiClient.delete(doc.name);

Check warning on line 75 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe argument of type `any` assigned to a parameter of type `string`

Check warning on line 75 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .name on an `any` value
}

/**
Expand All @@ -85,14 +85,14 @@
* @param {object[]} docs an array of Document objects to delete.
* @return {Promise<number>} a promise for the number of deleted documents.
*/
export async function deleteDocuments(project: string, docs: any[]): Promise<number> {

Check warning on line 88 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
const url = "projects/" + project + "/databases/(default)/documents:commit";

const writes = docs.map((doc) => {
return { delete: doc.name };

Check warning on line 92 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value

Check warning on line 92 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .name on an `any` value
});
const data = { writes };

const res = await apiClient.post<any, { writeResults: any[] }>(url, data);

Check warning on line 96 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type

Check warning on line 96 in src/gcp/firestore.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unexpected any. Specify a different type
return res.body.writeResults.length;
}
Loading