Skip to content

Commit 60a5e4c

Browse files
authored
Synchronize protos (#6369)
This is a result of comparison with official Firestore protos. Note, some gRPC endpoint and message additions were omitted since we have no plans of supporting them in SDK.
1 parent 0b1582a commit 60a5e4c

File tree

8 files changed

+515
-294
lines changed

8 files changed

+515
-294
lines changed

firebase-firestore/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Unreleased
2+
* [changed] Update Firestore proto definitions. [#6369](//github.com/firebase/firebase-android-sdk/pull/6369)
23
* [changed] Updated protobuf dependency to `3.25.5` to fix
34
[CVE-2024-7254](https://github.com/advisories/GHSA-735f-pc8j-v9w8).
45

firebase-firestore/src/proto/google/firestore/v1/aggregation_result.proto

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ package google.firestore.v1;
1919
import "google/firestore/v1/document.proto";
2020

2121
option csharp_namespace = "Google.Cloud.Firestore.V1";
22-
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
22+
option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
2323
option java_multiple_files = true;
2424
option java_outer_classname = "AggregationResultProto";
2525
option java_package = "com.google.firestore.v1";
@@ -35,7 +35,8 @@ option ruby_package = "Google::Cloud::Firestore::V1";
3535
message AggregationResult {
3636
// The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.
3737
//
38-
// The key is the [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias]
38+
// The key is the
39+
// [alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias]
3940
// assigned to the aggregation function on input and the size of this map
4041
// equals the number of aggregation functions in the query.
4142
map<string, Value> aggregate_fields = 2;

firebase-firestore/src/proto/google/firestore/v1/bloom_filter.proto

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ syntax = "proto3";
1717
package google.firestore.v1;
1818

1919
option csharp_namespace = "Google.Cloud.Firestore.V1";
20-
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
20+
option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
2121
option java_multiple_files = true;
2222
option java_outer_classname = "BloomFilterProto";
2323
option java_package = "com.google.firestore.v1";
@@ -32,21 +32,21 @@ option ruby_package = "Google::Cloud::Firestore::V1";
3232
// defines the number of bits of the last byte to be ignored as "padding". The
3333
// values of these "padding" bits are unspecified and must be ignored.
3434
//
35-
// To retrieve the first bit, bit 0, calculate: (bitmap[0] & 0x01) != 0.
36-
// To retrieve the second bit, bit 1, calculate: (bitmap[0] & 0x02) != 0.
37-
// To retrieve the third bit, bit 2, calculate: (bitmap[0] & 0x04) != 0.
38-
// To retrieve the fourth bit, bit 3, calculate: (bitmap[0] & 0x08) != 0.
39-
// To retrieve bit n, calculate: (bitmap[n / 8] & (0x01 << (n % 8))) != 0.
35+
// To retrieve the first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`.
36+
// To retrieve the second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`.
37+
// To retrieve the third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`.
38+
// To retrieve the fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`.
39+
// To retrieve bit n, calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`.
4040
//
4141
// The "size" of a `BitSequence` (the number of bits it contains) is calculated
42-
// by this formula: (bitmap.length * 8) - padding.
42+
// by this formula: `(bitmap.length * 8) - padding`.
4343
message BitSequence {
4444
// The bytes that encode the bit sequence.
4545
// May have a length of zero.
4646
bytes bitmap = 1;
4747

4848
// The number of bits of the last byte in `bitmap` to ignore as "padding".
49-
// If the length of `bitmap` is zero, then this value must be 0.
49+
// If the length of `bitmap` is zero, then this value must be `0`.
5050
// Otherwise, this value must be between 0 and 7, inclusive.
5151
int32 padding = 2;
5252
}
@@ -57,10 +57,10 @@ message BitSequence {
5757
// hash as 2 distinct 64-bit hash values, interpreted as unsigned integers
5858
// using 2's complement encoding.
5959
//
60-
// These two hash values, named h1 and h2, are then used to compute the
61-
// `hash_count` hash values using the formula, starting at i=0:
60+
// These two hash values, named `h1` and `h2`, are then used to compute the
61+
// `hash_count` hash values using the formula, starting at `i=0`:
6262
//
63-
// h(i) = h1 + (i * h2)
63+
// h(i) = h1 + (i * h2)
6464
//
6565
// These resulting values are then taken modulo the number of bits in the bloom
6666
// filter to get the bits of the bloom filter to test for the given entry.
@@ -70,4 +70,4 @@ message BloomFilter {
7070

7171
// The number of hashes used by the algorithm.
7272
int32 hash_count = 2;
73-
}
73+
}

firebase-firestore/src/proto/google/firestore/v1/common.proto

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC.
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,32 +11,32 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

1817
package google.firestore.v1;
1918

20-
import "google/api/annotations.proto";
2119
import "google/protobuf/timestamp.proto";
2220

2321
option csharp_namespace = "Google.Cloud.Firestore.V1";
24-
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
22+
option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
2523
option java_multiple_files = true;
2624
option java_outer_classname = "CommonProto";
2725
option java_package = "com.google.firestore.v1";
2826
option objc_class_prefix = "GCFS";
2927
option php_namespace = "Google\\Cloud\\Firestore\\V1";
30-
28+
option ruby_package = "Google::Cloud::Firestore::V1";
3129

3230
// A set of field paths on a document.
3331
// Used to restrict a get or update operation on a document to a subset of its
3432
// fields.
3533
// This is different from standard field masks, as this is always scoped to a
36-
// [Document][google.firestore.v1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1.Value].
34+
// [Document][google.firestore.v1.Document], and takes in account the dynamic
35+
// nature of [Value][google.firestore.v1.Value].
3736
message DocumentMask {
38-
// The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field
39-
// path syntax reference.
37+
// The list of field paths in the mask. See
38+
// [Document.fields][google.firestore.v1.Document.fields] for a field path
39+
// syntax reference.
4040
repeated string field_paths = 1;
4141
}
4242

@@ -49,14 +49,17 @@ message Precondition {
4949
bool exists = 1;
5050

5151
// When set, the target document must exist and have been last updated at
52-
// that time.
52+
// that time. Timestamp must be microsecond aligned.
5353
google.protobuf.Timestamp update_time = 2;
5454
}
5555
}
5656

5757
// Options for creating a new transaction.
5858
message TransactionOptions {
5959
// Options for a transaction that can be used to read and write documents.
60+
//
61+
// Firestore does not allow 3rd party auth requests to create read-write.
62+
// transactions.
6063
message ReadWrite {
6164
// An optional transaction to retry.
6265
bytes retry_transaction = 1;
@@ -68,7 +71,10 @@ message TransactionOptions {
6871
// consistency.
6972
oneof consistency_selector {
7073
// Reads documents at the given time.
71-
// This may not be older than 60 seconds.
74+
//
75+
// This must be a microsecond precision timestamp within the past one
76+
// hour, or if Point-in-Time Recovery is enabled, can additionally be a
77+
// whole minute timestamp within the past 7 days.
7278
google.protobuf.Timestamp read_time = 2;
7379
}
7480
}

firebase-firestore/src/proto/google/firestore/v1/document.proto

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC.
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,25 +11,24 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

1817
package google.firestore.v1;
1918

20-
import "google/api/annotations.proto";
19+
import "google/api/field_behavior.proto";
2120
import "google/protobuf/struct.proto";
2221
import "google/protobuf/timestamp.proto";
2322
import "google/type/latlng.proto";
2423

2524
option csharp_namespace = "Google.Cloud.Firestore.V1";
26-
option go_package = "google.golang.org/genproto/googleapis/firestore/v1;firestore";
25+
option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb";
2726
option java_multiple_files = true;
2827
option java_outer_classname = "DocumentProto";
2928
option java_package = "com.google.firestore.v1";
3029
option objc_class_prefix = "GCFS";
3130
option php_namespace = "Google\\Cloud\\Firestore\\V1";
32-
31+
option ruby_package = "Google::Cloud::Firestore::V1";
3332

3433
// A Firestore document.
3534
//
@@ -43,23 +42,23 @@ message Document {
4342
//
4443
// The map keys represent field names.
4544
//
46-
// A simple field name contains only characters `a` to `z`, `A` to `Z`,
47-
// `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
48-
// `foo_bar_17`.
49-
//
5045
// Field names matching the regular expression `__.*__` are reserved. Reserved
51-
// field names are forbidden except in certain documented contexts. The map
52-
// keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be
46+
// field names are forbidden except in certain documented contexts. The field
47+
// names, represented as UTF-8, must not exceed 1,500 bytes and cannot be
5348
// empty.
5449
//
5550
// Field paths may be used in other contexts to refer to structured fields
56-
// defined here. For `map_value`, the field path is represented by the simple
57-
// or quoted field names of the containing fields, delimited by `.`. For
58-
// example, the structured field
59-
// `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be
60-
// represented by the field path `foo.x&y`.
51+
// defined here. For `map_value`, the field path is represented by a
52+
// dot-delimited (`.`) string of segments. Each segment is either a simple
53+
// field name (defined below) or a quoted field name. For example, the
54+
// structured field `"foo" : { map_value: { "x&y" : { string_value: "hello"
55+
// }}}` would be represented by the field path `` foo.`x&y` ``.
56+
//
57+
// A simple field name contains only characters `a` to `z`, `A` to `Z`,
58+
// `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
59+
// `foo_bar_17`.
6160
//
62-
// Within a field path, a quoted field name starts and ends with `` ` `` and
61+
// A quoted field name starts and ends with `` ` `` and
6362
// may contain any character. Some characters, including `` ` ``, must be
6463
// escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
6564
// `` `bak\`tik` `` represents `` bak`tik ``.
@@ -124,7 +123,7 @@ message Value {
124123

125124
// An array value.
126125
//
127-
// Cannot directly contain another array value, though can contain an
126+
// Cannot directly contain another array value, though can contain a
128127
// map which contains another array.
129128
ArrayValue array_value = 9;
130129

0 commit comments

Comments
 (0)