Skip to content

Revert TS4 and Firestore 5.x updates #1557

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

Merged
merged 2 commits into from
Jan 21, 2022
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
8 changes: 0 additions & 8 deletions etc/firebase-admin.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,6 @@ export namespace firestore {
import WhereFilterOp = _firestore.WhereFilterOp;
import WriteBatch = _firestore.WriteBatch;
import WriteResult = _firestore.WriteResult;
import PartialWithFieldValue = _firestore.PartialWithFieldValue;
import WithFieldValue = _firestore.WithFieldValue;
import Primitive = _firestore.Primitive;
import NestedUpdateFields = _firestore.NestedUpdateFields;
import ChildUpdateFields = _firestore.ChildUpdateFields;
import AddPrefixToKeys = _firestore.AddPrefixToKeys;
import UnionToIntersection = _firestore.UnionToIntersection;
import ReadOnlyTransactionOptions = _firestore.ReadOnlyTransactionOptions;
import setLogFunction = _firestore.setLogFunction;
}

Expand Down
24 changes: 0 additions & 24 deletions etc/firebase-admin.firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

/// <reference types="node" />

import { AddPrefixToKeys } from '@google-cloud/firestore';
import { Agent } from 'http';
import { BulkWriter } from '@google-cloud/firestore';
import { BulkWriterOptions } from '@google-cloud/firestore';
import { BundleBuilder } from '@google-cloud/firestore';
import { ChildUpdateFields } from '@google-cloud/firestore';
import { CollectionGroup } from '@google-cloud/firestore';
import { CollectionReference } from '@google-cloud/firestore';
import { DocumentChange } from '@google-cloud/firestore';
Expand All @@ -25,40 +23,30 @@ import { Firestore } from '@google-cloud/firestore';
import { FirestoreDataConverter } from '@google-cloud/firestore';
import { GeoPoint } from '@google-cloud/firestore';
import { GrpcStatus } from '@google-cloud/firestore';
import { NestedUpdateFields } from '@google-cloud/firestore';
import { OrderByDirection } from '@google-cloud/firestore';
import { PartialWithFieldValue } from '@google-cloud/firestore';
import { Precondition } from '@google-cloud/firestore';
import { Primitive } from '@google-cloud/firestore';
import { Query } from '@google-cloud/firestore';
import { QueryDocumentSnapshot } from '@google-cloud/firestore';
import { QueryPartition } from '@google-cloud/firestore';
import { QuerySnapshot } from '@google-cloud/firestore';
import { ReadOnlyTransactionOptions } from '@google-cloud/firestore';
import { ReadOptions } from '@google-cloud/firestore';
import { setLogFunction } from '@google-cloud/firestore';
import { SetOptions } from '@google-cloud/firestore';
import { Settings } from '@google-cloud/firestore';
import { Timestamp } from '@google-cloud/firestore';
import { Transaction } from '@google-cloud/firestore';
import { UnionToIntersection } from '@google-cloud/firestore';
import { UpdateData } from '@google-cloud/firestore';
import { v1 } from '@google-cloud/firestore';
import { WhereFilterOp } from '@google-cloud/firestore';
import { WithFieldValue } from '@google-cloud/firestore';
import { WriteBatch } from '@google-cloud/firestore';
import { WriteResult } from '@google-cloud/firestore';

export { AddPrefixToKeys }

export { BulkWriter }

export { BulkWriterOptions }

export { BundleBuilder }

export { ChildUpdateFields }

export { CollectionGroup }

export { CollectionReference }
Expand Down Expand Up @@ -90,16 +78,10 @@ export function getFirestore(app?: App): Firestore;

export { GrpcStatus }

export { NestedUpdateFields }

export { OrderByDirection }

export { PartialWithFieldValue }

export { Precondition }

export { Primitive }

export { Query }

export { QueryDocumentSnapshot }
Expand All @@ -108,8 +90,6 @@ export { QueryPartition }

export { QuerySnapshot }

export { ReadOnlyTransactionOptions }

export { ReadOptions }

export { setLogFunction }
Expand All @@ -122,16 +102,12 @@ export { Timestamp }

export { Transaction }

export { UnionToIntersection }

export { UpdateData }

export { v1 }

export { WhereFilterOp }

export { WithFieldValue }

export { WriteBatch }

export { WriteResult }
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"node-forge": "^1.0.0"
},
"optionalDependencies": {
"@google-cloud/firestore": "^5.0.1",
"@google-cloud/firestore": "^4.5.0",
"@google-cloud/storage": "^5.3.0"
},
"devDependencies": {
Expand Down Expand Up @@ -218,7 +218,7 @@
"sinon": "^9.0.0",
"sinon-chai": "^3.0.0",
"ts-node": "^10.2.0",
"typescript": "^4.4.3",
"typescript": "^3.7.3",
"yargs": "^17.0.1"
}
}
8 changes: 0 additions & 8 deletions src/firestore/firestore-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ export namespace firestore {
export import WhereFilterOp = _firestore.WhereFilterOp;
export import WriteBatch = _firestore.WriteBatch;
export import WriteResult = _firestore.WriteResult;
export import PartialWithFieldValue = _firestore.PartialWithFieldValue;
export import WithFieldValue = _firestore.WithFieldValue;
export import Primitive = _firestore.Primitive;
export import NestedUpdateFields = _firestore.NestedUpdateFields;
export import ChildUpdateFields = _firestore.ChildUpdateFields;
export import AddPrefixToKeys = _firestore.AddPrefixToKeys;
export import UnionToIntersection = _firestore.UnionToIntersection;
export import ReadOnlyTransactionOptions = _firestore.ReadOnlyTransactionOptions;

export import setLogFunction = _firestore.setLogFunction;
}
8 changes: 0 additions & 8 deletions src/firestore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import { FirebaseApp } from '../app/firebase-app';
import { FirestoreService } from './firestore-internal';

export {
AddPrefixToKeys,
BulkWriter,
BulkWriterOptions,
BundleBuilder,
ChildUpdateFields,
CollectionGroup,
CollectionReference,
DocumentChange,
Expand All @@ -44,25 +42,19 @@ export {
FirestoreDataConverter,
GeoPoint,
GrpcStatus,
NestedUpdateFields,
OrderByDirection,
PartialWithFieldValue,
Precondition,
Primitive,
Query,
QueryDocumentSnapshot,
QueryPartition,
QuerySnapshot,
ReadOptions,
ReadOnlyTransactionOptions,
Settings,
SetOptions,
Timestamp,
Transaction,
UpdateData,
UnionToIntersection,
WhereFilterOp,
WithFieldValue,
WriteBatch,
WriteResult,
v1,
Expand Down
12 changes: 6 additions & 6 deletions test/integration/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ describe('admin.auth', () => {
const actualTenantObj = actualTenant.toJSON();
if (authEmulatorHost) {
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete expectedCreatedTenant.testPhoneNumbers;
}
expect(actualTenantObj).to.deep.equal(expectedCreatedTenant);
Expand Down Expand Up @@ -1617,7 +1617,7 @@ describe('admin.auth', () => {
const actualTenantObj = actualTenant.toJSON();
if (authEmulatorHost) {
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete expectedCreatedTenant.testPhoneNumbers;
}
expect(actualTenantObj).to.deep.equal(expectedCreatedTenant);
Expand Down Expand Up @@ -1649,15 +1649,15 @@ describe('admin.auth', () => {
.then((actualTenant) => {
const actualTenantObj = actualTenant.toJSON();
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete expectedUpdatedTenant.testPhoneNumbers;
expect(actualTenantObj).to.deep.equal(expectedUpdatedTenant);
return getAuth().tenantManager().updateTenant(createdTenantId, updatedOptions2);
})
.then((actualTenant) => {
const actualTenantObj = actualTenant.toJSON();
// Not supported in Auth Emulator
delete (actualTenantObj as {testPhoneNumbers?: Record<string, string>}).testPhoneNumbers;
delete (actualTenantObj as {testPhoneNumbers: Record<string, string>}).testPhoneNumbers;
delete expectedUpdatedTenant2.testPhoneNumbers;
expect(actualTenantObj).to.deep.equal(expectedUpdatedTenant2);
});
Expand Down Expand Up @@ -2150,8 +2150,8 @@ describe('admin.auth', () => {
// Not supported in ID token,
delete decodedIdToken.nonce;
// exp and iat may vary depending on network connection latency.
delete (decodedIdToken as any).exp;
delete (decodedIdToken as any).iat;
delete decodedIdToken.exp;
delete decodedIdToken.iat;
expect(decodedIdToken).to.deep.equal(payloadClaims);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/integration/postcheck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"@types/chai": "^4.0.0",
"@types/mocha": "^2.2.48",
"@types/node": "^10.10.0",
"@types/node": ">=12.12.47",
"chai": "^4.2.0",
"mocha": "^8.0.0",
"ts-node": "^9.0.0",
Expand Down
12 changes: 6 additions & 6 deletions test/unit/auth/tenant.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ describe('Tenant', () => {
it('should return the expected server request without multi-factor and phone config', () => {
const tenantOptionsClientRequest = deepCopy(clientRequestWithoutMfa);
const tenantOptionsServerRequest = deepCopy(serverRequestWithoutMfa);
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;
expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
.to.deep.equal(tenantOptionsServerRequest);
});

it('should return the expected server request with multi-factor and phone config', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;
expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
.to.deep.equal(tenantOptionsServerRequest);
});
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('Tenant', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
tenantOptionsClientRequest.testPhoneNumbers = null;
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;
tenantOptionsServerRequest.testPhoneNumbers = {};

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, !createRequest))
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('Tenant', () => {
it('should return the expected server request without multi-factor and phone config', () => {
const tenantOptionsClientRequest: CreateTenantRequest = deepCopy(clientRequestWithoutMfa);
const tenantOptionsServerRequest: TenantServerResponse = deepCopy(serverRequestWithoutMfa);
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest))
.to.deep.equal(tenantOptionsServerRequest);
Expand All @@ -190,7 +190,7 @@ describe('Tenant', () => {
it('should return the expected server request with multi-factor and phone config', () => {
const tenantOptionsClientRequest: CreateTenantRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest: TenantServerResponse = deepCopy(serverRequest);
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;

expect(Tenant.buildServerRequest(tenantOptionsClientRequest, createRequest))
.to.deep.equal(tenantOptionsServerRequest);
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('Tenant', () => {
const tenantOptionsClientRequest = deepCopy(clientRequest);
const tenantOptionsServerRequest = deepCopy(serverRequest);
tenantOptionsClientRequest.testPhoneNumbers = null;
delete (tenantOptionsServerRequest as any).name;
delete tenantOptionsServerRequest.name;
tenantOptionsServerRequest.testPhoneNumbers = {};

expect(() => {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/security-rules/security-rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ describe('SecurityRules', () => {

it('should resolve with RulesetMetadataList when the response contains no page token', () => {
const response = deepCopy(LIST_RULESETS_RESPONSE);
delete (response as any).nextPageToken;
delete response.nextPageToken;
const stub = sinon
.stub(SecurityRulesApiClient.prototype, 'listRulesets')
.resolves(response);
Expand Down