Skip to content

Commit

Permalink
Global search/replace of "v1beta1" to "v1"
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Lehenbauer committed Jan 11, 2019
1 parent 2062040 commit e5d521b
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions dev/conformance/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as protobufjs from 'protobufjs';
import * as through2 from 'through2';

import * as proto from '../protos/firestore_proto_api';
import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;

import * as Firestore from '../src';

Expand Down Expand Up @@ -58,9 +58,9 @@ const protoDefinition =

const TEST_SUITE_TYPE = protoDefinition.lookupType('tests.TestSuite');
const STRUCTURED_QUERY_TYPE =
protoDefinition.lookupType('google.firestore.v1beta1.StructuredQuery');
protoDefinition.lookupType('google.firestore.v1.StructuredQuery');
const COMMIT_REQUEST_TYPE =
protoDefinition.lookupType('google.firestore.v1beta1.CommitRequest');
protoDefinition.lookupType('google.firestore.v1.CommitRequest');

// Firestore instance initialized by the test runner.
let firestore;
Expand Down
34 changes: 17 additions & 17 deletions dev/conformance/test-definition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ option php_namespace = "Google\\Cloud\\Firestore\\Tests\\Conformance";
option csharp_namespace = "Google.Cloud.Firestore.Tests.Proto";
option java_package = "com.google.cloud.firestore.conformance";

import "google/firestore/v1beta1/common.proto";
import "google/firestore/v1beta1/document.proto";
import "google/firestore/v1beta1/firestore.proto";
import "google/firestore/v1beta1/query.proto";
import "google/firestore/v1/common.proto";
import "google/firestore/v1/document.proto";
import "google/firestore/v1/firestore.proto";
import "google/firestore/v1/query.proto";
import "google/protobuf/timestamp.proto";

// A collection of tests.
Expand Down Expand Up @@ -41,7 +41,7 @@ message GetTest {
string doc_ref_path = 1;

// The request that the call should send to the Firestore service.
google.firestore.v1beta1.GetDocumentRequest request = 2;
google.firestore.v1.GetDocumentRequest request = 2;
}

// Call to DocumentRef.Create.
Expand All @@ -55,7 +55,7 @@ message CreateTest {
string json_data = 2;

// The request that the call should generate.
google.firestore.v1beta1.CommitRequest request = 3;
google.firestore.v1.CommitRequest request = 3;

// If true, the call should result in an error without generating a request.
// If this is true, request should not be set.
Expand All @@ -67,37 +67,37 @@ message SetTest {
string doc_ref_path = 1; // path of doc
SetOption option = 2; // option to the Set call, if any
string json_data = 3; // data (see CreateTest.json_data)
google.firestore.v1beta1.CommitRequest request = 4; // expected request
google.firestore.v1.CommitRequest request = 4; // expected request
bool is_error = 5; // call signals an error
}

// A call to the form of DocumentRef.Update that represents the data as a map
// or dictionary.
message UpdateTest {
string doc_ref_path = 1; // path of doc
google.firestore.v1beta1.Precondition precondition = 2; // precondition in call, if any
google.firestore.v1.Precondition precondition = 2; // precondition in call, if any
string json_data = 3; // data (see CreateTest.json_data)
google.firestore.v1beta1.CommitRequest request = 4; // expected request
google.firestore.v1.CommitRequest request = 4; // expected request
bool is_error = 5; // call signals an error
}

// A call to the form of DocumentRef.Update that represents the data as a list
// of field paths and their values.
message UpdatePathsTest {
string doc_ref_path = 1; // path of doc
google.firestore.v1beta1.Precondition precondition = 2; // precondition in call, if any
google.firestore.v1.Precondition precondition = 2; // precondition in call, if any
// parallel sequences: field_paths[i] corresponds to json_values[i]
repeated FieldPath field_paths = 3; // the argument field paths
repeated string json_values = 4; // the argument values, as JSON
google.firestore.v1beta1.CommitRequest request = 5; // expected rquest
google.firestore.v1.CommitRequest request = 5; // expected rquest
bool is_error = 6; // call signals an error
}

// A call to DocmentRef.Delete
message DeleteTest {
string doc_ref_path = 1; // path of doc
google.firestore.v1beta1.Precondition precondition = 2;
google.firestore.v1beta1.CommitRequest request = 3; // expected rquest
google.firestore.v1.Precondition precondition = 2;
google.firestore.v1.CommitRequest request = 3; // expected rquest
bool is_error = 4; // call signals an error
}

Expand All @@ -110,7 +110,7 @@ message SetOption {
message QueryTest {
string coll_path = 1; // path of collection, e.g. "projects/projectID/databases/(default)/documents/C"
repeated Clause clauses = 2;
google.firestore.v1beta1.StructuredQuery query = 3;
google.firestore.v1.StructuredQuery query = 3;
bool is_error = 4;
}

Expand Down Expand Up @@ -170,13 +170,13 @@ message FieldPath {
// should either change their client's ID for testing,
// or change the ID in the tests before running them.
message ListenTest {
repeated google.firestore.v1beta1.ListenResponse responses = 1;
repeated google.firestore.v1.ListenResponse responses = 1;
repeated Snapshot snapshots = 2;
bool is_error = 3;
}

message Snapshot {
repeated google.firestore.v1beta1.Document docs = 1;
repeated google.firestore.v1.Document docs = 1;
repeated DocChange changes = 2;
google.protobuf.Timestamp read_time = 3;
}
Expand All @@ -190,7 +190,7 @@ message DocChange {
}

Kind kind = 1;
google.firestore.v1beta1.Document doc = 2;
google.firestore.v1.Document doc = 2;
int32 old_index = 3;
int32 new_index = 4;
}
20 changes: 10 additions & 10 deletions dev/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import {google} from '../protos/firestore_proto_api';
import api = google.firestore.v1beta1;
import api = google.firestore.v1;
import {createValidator} from './validate';
import {ProtobufJsValue} from './types';

Expand All @@ -26,7 +26,7 @@ const validate = createValidator();
* @private
*
* This module contains utility functions to convert
* `firestore.v1beta1.Documents` from Proto3 JSON to their equivalent
* `firestore.v1.Documents` from Proto3 JSON to their equivalent
* representation in Protobuf JS. Protobuf JS is the only encoding supported by
* this client, and dependencies that use Proto3 JSON (such as the Google Cloud
* Functions SDK) are supported through this conversion and its usage in
Expand Down Expand Up @@ -97,10 +97,10 @@ function bytesFromJson(bytesValue: string|Uint8Array): Uint8Array {
}

/**
* Detects 'valueType' from a Proto3 JSON `firestore.v1beta1.Value` proto.
* Detects 'valueType' from a Proto3 JSON `firestore.v1.Value` proto.
*
* @private
* @param proto The `firestore.v1beta1.Value` proto.
* @param proto The `firestore.v1.Value` proto.
* @return The string value for 'valueType'.
*/
export function detectValueType(proto: ProtobufJsValue): string {
Expand Down Expand Up @@ -153,12 +153,12 @@ export function detectValueType(proto: ProtobufJsValue): string {
}

/**
* Converts a `firestore.v1beta1.Value` in Proto3 JSON encoding into the
* Converts a `firestore.v1.Value` in Proto3 JSON encoding into the
* Protobuf JS format expected by this client.
*
* @private
* @param fieldValue The `firestore.v1beta1.Value` in Proto3 JSON format.
* @return The `firestore.v1beta1.Value` in Protobuf JS format.
* @param fieldValue The `firestore.v1.Value` in Proto3 JSON format.
* @return The `firestore.v1.Value` in Protobuf JS format.
*/
export function valueFromJson(fieldValue: ProtobufJsValue): api.IValue {
const valueType = detectValueType(fieldValue);
Expand Down Expand Up @@ -212,14 +212,14 @@ export function valueFromJson(fieldValue: ProtobufJsValue): api.IValue {
}

/**
* Converts a `firestore.v1beta1.Document` in Proto3 JSON encoding into the
* Converts a `firestore.v1.Document` in Proto3 JSON encoding into the
* Protobuf JS format expected by this client. This conversion creates a copy of
* the underlying document.
*
* @private
* @param document The `firestore.v1beta1.Document` in Proto3 JSON
* @param document The `firestore.v1.Document` in Proto3 JSON
* format.
* @return The `firestore.v1beta1.Document` in Protobuf JS format.
* @return The `firestore.v1.Document` in Protobuf JS format.
*/
export function documentFromJson(document: api.IDocument): api.IDocument {
const result = {};
Expand Down
2 changes: 1 addition & 1 deletion dev/src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {isPlainObject, Serializer} from './serializer';
import {Timestamp} from './timestamp';
import {AnyDuringMigration, AnyJs, ApiMapValue, DocumentData, UpdateData, UserInput} from './types';

import api = google.firestore.v1beta1;
import api = google.firestore.v1;

/**
* Returns a builder for DocumentSnapshot and QueryDocumentSnapshot instances.
Expand Down
2 changes: 1 addition & 1 deletion dev/src/field-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as proto from '../protos/firestore_proto_api';
import {AnyDuringMigration, AnyJs} from './types';
import {createValidator} from './validate';

import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;
import {Serializer} from './serializer';
import {FieldPath} from './path';

Expand Down
2 changes: 1 addition & 1 deletion dev/src/geo-point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import {google} from '../protos/firestore_proto_api';
import api = google.firestore.v1beta1;
import api = google.firestore.v1;

import {createValidator} from './validate';
import {Serializable} from './serializer';
Expand Down
28 changes: 14 additions & 14 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {customObjectError, Validator} from './validate';
import {WriteBatch} from './write-batch';
import {validateUpdateMap} from './write-batch';

import api = google.firestore.v1beta1;
import api = google.firestore.v1;

export {CollectionReference, DocumentReference, QuerySnapshot, Query} from './reference';
export {DocumentSnapshot, QueryDocumentSnapshot} from './document';
Expand Down Expand Up @@ -71,13 +71,13 @@ setLibVersion(libVersion);
*/

/**
* @namespace google.firestore.v1beta1
* @namespace google.firestore.v1
*/

/*!
* @see v1beta1
* @see v1
*/
let v1beta1; // Lazy-loaded in `_runRequest()`
let v1; // Lazy-loaded in `_runRequest()`

/*!
* HTTP header for the resource prefix to improve routing and project isolation
Expand Down Expand Up @@ -477,7 +477,7 @@ export class Firestore {
/**
* Creates a [DocumentSnapshot]{@link DocumentSnapshot} or a
* [QueryDocumentSnapshot]{@link QueryDocumentSnapshot} from a
* `firestore.v1beta1.Document` proto (or from a resource name for missing
* `firestore.v1.Document` proto (or from a resource name for missing
* documents).
*
* This API is used by Google Cloud Functions and can be called with both
Expand Down Expand Up @@ -865,7 +865,7 @@ follow these steps, YOUR APP MAY BREAK.`);

const clientPool =
new ClientPool(MAX_CONCURRENT_REQUESTS_PER_CLIENT, () => {
const client = new module.exports.v1beta1(this._settings);
const client = new module.exports.v1(this._settings);
logger('Firestore', null, 'Initialized Firestore GAPIC Client');
return client;
});
Expand Down Expand Up @@ -1458,20 +1458,20 @@ module.exports = Firestore;
module.exports = Object.assign(module.exports, existingExports);

/**
* {@link v1beta1} factory function.
* {@link v1} factory function.
*
* @private
* @name Firestore.v1beta1
* @see v1beta1
* @name Firestore.v1
* @see v1
* @type {function}
*/
Object.defineProperty(module.exports, 'v1beta1', {
// The v1beta1 module is very large. To avoid pulling it in from static
Object.defineProperty(module.exports, 'v1', {
// The v1 module is very large. To avoid pulling it in from static
// scope, we lazy-load and cache the module.
get: () => {
if (!v1beta1) {
v1beta1 = require('./v1beta1');
if (!v1) {
v1 = require('./v1');
}
return v1beta1;
return v1;
},
});
2 changes: 1 addition & 1 deletion dev/src/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import {google} from '../protos/firestore_proto_api';
import api = google.firestore.v1beta1;
import api = google.firestore.v1;

import {detectValueType} from './convert';
import {ResourcePath} from './path';
Expand Down
2 changes: 1 addition & 1 deletion dev/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import * as is from 'is';
import {google} from '../protos/firestore_proto_api';
import api = google.firestore.v1beta1;
import api = google.firestore.v1;

import {createValidator, customObjectError} from './validate';
import {AnyDuringMigration} from './types';
Expand Down
2 changes: 1 addition & 1 deletion dev/src/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as is from 'is';
import * as through2 from 'through2';

import * as proto from '../protos/firestore_proto_api';
import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;

import {compare} from './order';
import {logger} from './logger';
Expand Down
2 changes: 1 addition & 1 deletion dev/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as is from 'is';

import * as proto from '../protos/firestore_proto_api';
import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;

import {Timestamp} from './timestamp';
import {FieldTransform} from './field-value';
Expand Down
2 changes: 1 addition & 1 deletion dev/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {AnyDuringMigration, AnyJs, DocumentData, Precondition as PublicPrecondit
import {parseGetAllArguments} from './util';
import {requestTag} from './util';

import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;

/*!
* Error message for transactional reads that were executed after performing
Expand Down
4 changes: 2 additions & 2 deletions dev/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {google} from '../protos/firestore_proto_api';
import {FieldPath} from './path';
import {Timestamp} from './timestamp';

import api = google.firestore.v1beta1;
import api = google.firestore.v1;

/**
* A union of all of the standard JS types, useful for cases where the type is
Expand All @@ -32,7 +32,7 @@ export type AnyDuringMigration = any;

// A map in the format of the Proto API
export type ApiMapValue = {
[k: string]: google.firestore.v1beta1.IValue
[k: string]: google.firestore.v1.IValue
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dev/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {ResourcePath} from './path';
import {Timestamp} from './timestamp';
import {requestTag} from './util';

import api = google.firestore.v1beta1;
import api = google.firestore.v1;
import {GrpcError} from './types';

/*!
Expand Down
2 changes: 1 addition & 1 deletion dev/src/write-batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {AnyDuringMigration, AnyJs, Precondition as PublicPrecondition, SetOption
import {DocumentData} from './types';
import {requestTag} from './util';

import api = google.firestore.v1beta1;
import api = google.firestore.v1;

/*!
* Google Cloud Functions terminates idle connections after two minutes. After
Expand Down
2 changes: 1 addition & 1 deletion dev/test/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {ResourcePath} from '../src/path';
import {AnyDuringMigration} from '../src/types';
import {createInstance, document, InvalidApiUsage, stream} from './util/helpers';

import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;

const PROJECT_ID = 'test-project';
const DATABASE_ROOT = `projects/${PROJECT_ID}/databases/(default)`;
Expand Down
2 changes: 1 addition & 1 deletion dev/test/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as Firestore from '../src';

import {createInstance, InvalidApiUsage} from './util/helpers';

import api = proto.google.firestore.v1beta1;
import api = proto.google.firestore.v1;
import {AnyDuringMigration} from '../src/types';
import {FieldPath} from '../src';

Expand Down
Loading

0 comments on commit e5d521b

Please sign in to comment.