Skip to content

Commit

Permalink
feat: update to v1 protos (#516)
Browse files Browse the repository at this point in the history
* Update synth.py to use v1 instead of v1beta1 and rerun.
* Update dev/protos/update.sh script to point to v1 instead of v1beta1 and rerun (also pull pbjs and pbts from `npm bin` instead of global path).
* Global search/replace of "v1beta1" to "v1"
* Keep v1beta1 gapic client and expose both v1 and v1beta1 off of FirestoreClient class.
* Change client to always include /documents for root document paths (but not when we just need the database name). (The v1 protocol now enforces that /documents be included for root document paths.)
* Add .DS_Store to .gitignore.
* remove codecov badge causing deadlink
  • Loading branch information
mikelehen committed Jan 16, 2019
1 parent 5449774 commit fece305
Show file tree
Hide file tree
Showing 50 changed files with 7,416 additions and 987 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ system-test/*key.json
build/
package-lock.json
.vscode
.DS_Store
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -4,7 +4,6 @@

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/firestore.svg)](https://www.npmjs.org/package/@google-cloud/firestore)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-firestore/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-firestore)

This is the Node.js Server SDK for
[Google Cloud Firestore](https://firebase.google.com/docs/firestore/). Google
Expand Down
6 changes: 3 additions & 3 deletions dev/conformance/runner.ts
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
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;
}

0 comments on commit fece305

Please sign in to comment.