Skip to content

Commit bfa8a5e

Browse files
authored
Update Firestore protos (#713)
1 parent 878d392 commit bfa8a5e

File tree

9 files changed

+175
-84
lines changed

9 files changed

+175
-84
lines changed

packages/firestore/src/protos/firestore_proto_api.d.ts

+5-24
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ export declare type FieldFilterOp =
3333
| 'LESS_THAN_OR_EQUAL'
3434
| 'GREATER_THAN'
3535
| 'GREATER_THAN_OR_EQUAL'
36-
| 'EQUAL';
36+
| 'EQUAL'
37+
| 'ARRAY_CONTAINS';
3738
export interface IFieldFilterOpEnum {
3839
OPERATOR_UNSPECIFIED: FieldFilterOp;
3940
LESS_THAN: FieldFilterOp;
4041
LESS_THAN_OR_EQUAL: FieldFilterOp;
4142
GREATER_THAN: FieldFilterOp;
4243
GREATER_THAN_OR_EQUAL: FieldFilterOp;
4344
EQUAL: FieldFilterOp;
45+
ARRAY_CONTAINS: FieldFilterOp;
4446
values(): Array<FieldFilterOp>;
4547
}
4648
export declare const FieldFilterOpEnum: IFieldFilterOpEnum;
@@ -64,15 +66,6 @@ export interface IIndexFieldModeEnum {
6466
values(): Array<IndexFieldMode>;
6567
}
6668
export declare const IndexFieldModeEnum: IIndexFieldModeEnum;
67-
export declare type IndexOperationMetadataOperationType =
68-
| 'OPERATION_TYPE_UNSPECIFIED'
69-
| 'CREATING_INDEX';
70-
export interface IIndexOperationMetadataOperationTypeEnum {
71-
OPERATION_TYPE_UNSPECIFIED: IndexOperationMetadataOperationType;
72-
CREATING_INDEX: IndexOperationMetadataOperationType;
73-
values(): Array<IndexOperationMetadataOperationType>;
74-
}
75-
export declare const IndexOperationMetadataOperationTypeEnum: IIndexOperationMetadataOperationTypeEnum;
7669
export declare type IndexState =
7770
| 'STATE_UNSPECIFIED'
7871
| 'CREATING'
@@ -219,6 +212,8 @@ export declare namespace firestoreV1beta1ApiClientInterfaces {
219212
interface FieldTransform {
220213
fieldPath?: string;
221214
setToServerValue?: FieldTransformSetToServerValue;
215+
appendMissingElements?: ArrayValue;
216+
removeAllFromArray?: ArrayValue;
222217
}
223218
interface Filter {
224219
compositeFilter?: CompositeFilter;
@@ -235,14 +230,6 @@ export declare namespace firestoreV1beta1ApiClientInterfaces {
235230
fieldPath?: string;
236231
mode?: IndexFieldMode;
237232
}
238-
interface IndexOperationMetadata {
239-
startTime?: string;
240-
endTime?: string;
241-
index?: string;
242-
operationType?: IndexOperationMetadataOperationType;
243-
cancelled?: boolean;
244-
documentProgress?: Progress;
245-
}
246233
interface LatLng {
247234
latitude?: number;
248235
longitude?: number;
@@ -293,10 +280,6 @@ export declare namespace firestoreV1beta1ApiClientInterfaces {
293280
exists?: boolean;
294281
updateTime?: string;
295282
}
296-
interface Progress {
297-
workCompleted?: string;
298-
workEstimated?: string;
299-
}
300283
interface Projection {
301284
fields?: Array<FieldReference>;
302285
}
@@ -425,7 +408,6 @@ export declare type FieldTransform = firestoreV1beta1ApiClientInterfaces.FieldTr
425408
export declare type Filter = firestoreV1beta1ApiClientInterfaces.Filter;
426409
export declare type Index = firestoreV1beta1ApiClientInterfaces.Index;
427410
export declare type IndexField = firestoreV1beta1ApiClientInterfaces.IndexField;
428-
export declare type IndexOperationMetadata = firestoreV1beta1ApiClientInterfaces.IndexOperationMetadata;
429411
export declare type LatLng = firestoreV1beta1ApiClientInterfaces.LatLng;
430412
export declare type ListCollectionIdsRequest = firestoreV1beta1ApiClientInterfaces.ListCollectionIdsRequest;
431413
export declare type ListCollectionIdsResponse = firestoreV1beta1ApiClientInterfaces.ListCollectionIdsResponse;
@@ -437,7 +419,6 @@ export declare type MapValue = firestoreV1beta1ApiClientInterfaces.MapValue;
437419
export declare type Operation = firestoreV1beta1ApiClientInterfaces.Operation;
438420
export declare type Order = firestoreV1beta1ApiClientInterfaces.Order;
439421
export declare type Precondition = firestoreV1beta1ApiClientInterfaces.Precondition;
440-
export declare type Progress = firestoreV1beta1ApiClientInterfaces.Progress;
441422
export declare type Projection = firestoreV1beta1ApiClientInterfaces.Projection;
442423
export declare type QueryTarget = firestoreV1beta1ApiClientInterfaces.QueryTarget;
443424
export declare type ReadOnly = firestoreV1beta1ApiClientInterfaces.ReadOnly;

packages/firestore/src/protos/google/api/http.proto

+47-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 Google Inc.
1+
// Copyright 2018 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.
@@ -24,22 +24,30 @@ option java_package = "com.google.api";
2424
option objc_class_prefix = "GAPI";
2525

2626

27-
// Defines the HTTP configuration for a service. It contains a list of
27+
// Defines the HTTP configuration for an API service. It contains a list of
2828
// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
2929
// to one or more HTTP REST API methods.
3030
message Http {
3131
// A list of HTTP configuration rules that apply to individual API methods.
3232
//
3333
// **NOTE:** All service configuration rules follow "last one wins" order.
3434
repeated HttpRule rules = 1;
35+
36+
// When set to true, URL path parmeters will be fully URI-decoded except in
37+
// cases of single segment matches in reserved expansion, where "%2F" will be
38+
// left encoded.
39+
//
40+
// The default behavior is to not decode RFC 6570 reserved characters in multi
41+
// segment matches.
42+
bool fully_decode_reserved_expansion = 2;
3543
}
3644

3745
// `HttpRule` defines the mapping of an RPC method to one or more HTTP
38-
// REST APIs. The mapping determines what portions of the request
39-
// message are populated from the path, query parameters, or body of
40-
// the HTTP request. The mapping is typically specified as an
41-
// `google.api.http` annotation, see "google/api/annotations.proto"
42-
// for details.
46+
// REST API methods. The mapping specifies how different portions of the RPC
47+
// request message are mapped to URL path, URL query parameters, and
48+
// HTTP request body. The mapping is typically specified as an
49+
// `google.api.http` annotation on the RPC method,
50+
// see "google/api/annotations.proto" for details.
4351
//
4452
// The mapping consists of a field specifying the path template and
4553
// method kind. The path template can refer to fields in the request
@@ -87,6 +95,11 @@ message Http {
8795
// parameters. Assume the following definition of the request message:
8896
//
8997
//
98+
// service Messaging {
99+
// rpc GetMessage(GetMessageRequest) returns (Message) {
100+
// option (google.api.http).get = "/v1/messages/{message_id}";
101+
// }
102+
// }
90103
// message GetMessageRequest {
91104
// message SubMessage {
92105
// string subfield = 1;
@@ -199,7 +212,7 @@ message Http {
199212
// to the request message are as follows:
200213
//
201214
// 1. The `body` field specifies either `*` or a field path, or is
202-
// omitted. If omitted, it assumes there is no HTTP body.
215+
// omitted. If omitted, it indicates there is no HTTP request body.
203216
// 2. Leaf fields (recursive expansion of nested messages in the
204217
// request) can be classified into three types:
205218
// (a) Matched in the URL template.
@@ -218,28 +231,34 @@ message Http {
218231
// FieldPath = IDENT { "." IDENT } ;
219232
// Verb = ":" LITERAL ;
220233
//
221-
// The syntax `*` matches a single path segment. It follows the semantics of
222-
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
223-
// Expansion.
234+
// The syntax `*` matches a single path segment. The syntax `**` matches zero
235+
// or more path segments, which must be the last part of the path except the
236+
// `Verb`. The syntax `LITERAL` matches literal text in the path.
224237
//
225-
// The syntax `**` matches zero or more path segments. It follows the semantics
226-
// of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved
227-
// Expansion. NOTE: it must be the last segment in the path except the Verb.
228-
//
229-
// The syntax `LITERAL` matches literal text in the URL path.
230-
//
231-
// The syntax `Variable` matches the entire path as specified by its template;
232-
// this nested template must not contain further variables. If a variable
238+
// The syntax `Variable` matches part of the URL path as specified by its
239+
// template. A variable template must not contain other variables. If a variable
233240
// matches a single path segment, its template may be omitted, e.g. `{var}`
234241
// is equivalent to `{var=*}`.
235242
//
243+
// If a variable contains exactly one path segment, such as `"{var}"` or
244+
// `"{var=*}"`, when such a variable is expanded into a URL path, all characters
245+
// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
246+
// Discovery Document as `{var}`.
247+
//
248+
// If a variable contains one or more path segments, such as `"{var=foo/*}"`
249+
// or `"{var=**}"`, when such a variable is expanded into a URL path, all
250+
// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
251+
// show up in the Discovery Document as `{+var}`.
252+
//
253+
// NOTE: While the single segment variable matches the semantics of
254+
// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
255+
// Simple String Expansion, the multi segment variable **does not** match
256+
// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
257+
// does not expand special characters like `?` and `#`, which would lead
258+
// to invalid URLs.
259+
//
236260
// NOTE: the field paths in variables and in the `body` must not refer to
237261
// repeated fields or map fields.
238-
//
239-
// Use CustomHttpPattern to specify any HTTP method that is not included in the
240-
// `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for
241-
// a given URL path rule. The wild-card rule is useful for services that provide
242-
// content to Web (HTML) clients.
243262
message HttpRule {
244263
// Selects methods to which this rule applies.
245264
//
@@ -265,7 +284,10 @@ message HttpRule {
265284
// Used for updating a resource.
266285
string patch = 6;
267286

268-
// Custom pattern is used for defining custom verbs.
287+
// The custom pattern is used for specifying an HTTP method that is not
288+
// included in the `pattern` field, such as HEAD, or "*" to leave the
289+
// HTTP method unspecified for this rule. The wild-card rule is useful
290+
// for services that provide content to Web (HTML) clients.
269291
CustomHttpPattern custom = 8;
270292
}
271293

packages/firestore/src/protos/google/firestore/v1beta1/common.proto

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Google Inc.
1+
// Copyright 2018 Google Inc.
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.
@@ -25,6 +25,7 @@ option java_multiple_files = true;
2525
option java_outer_classname = "CommonProto";
2626
option java_package = "com.google.firestore.v1beta1";
2727
option objc_class_prefix = "GCFS";
28+
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
2829

2930

3031
// A set of field paths on a document.

packages/firestore/src/protos/google/firestore/v1beta1/document.proto

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Google Inc.
1+
// Copyright 2018 Google Inc.
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.
@@ -27,6 +27,7 @@ option java_multiple_files = true;
2727
option java_outer_classname = "DocumentProto";
2828
option java_package = "com.google.firestore.v1beta1";
2929
option objc_class_prefix = "GCFS";
30+
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
3031

3132

3233
// A Firestore document.
@@ -42,7 +43,7 @@ message Document {
4243
// The map keys represent field names.
4344
//
4445
// A simple field name contains only characters `a` to `z`, `A` to `Z`,
45-
// `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example,
46+
// `0` to `9`, or `_`, and must not start with `0` to `9`. For example,
4647
// `foo_bar_17`.
4748
//
4849
// Field names matching the regular expression `__.*__` are reserved. Reserved
@@ -72,7 +73,7 @@ message Document {
7273

7374
// Output only. The time at which the document was last changed.
7475
//
75-
// This value is initally set to the `create_time` then increases
76+
// This value is initially set to the `create_time` then increases
7677
// monotonically with each change to the document. It can also be
7778
// compared to values from other documents and the `read_time` of a query.
7879
google.protobuf.Timestamp update_time = 4;

packages/firestore/src/protos/google/firestore/v1beta1/firestore.proto

+59-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017 Google Inc.
1+
// Copyright 2018 Google Inc.
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.
@@ -31,6 +31,7 @@ option java_multiple_files = true;
3131
option java_outer_classname = "FirestoreProto";
3232
option java_package = "com.google.firestore.v1beta1";
3333
option objc_class_prefix = "GCFS";
34+
option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
3435

3536
// Specification of the Firestore API.
3637

@@ -55,70 +56,114 @@ option objc_class_prefix = "GCFS";
5556
service Firestore {
5657
// Gets a single document.
5758
rpc GetDocument(GetDocumentRequest) returns (Document) {
58-
option (google.api.http) = { get: "/v1beta1/{name=projects/*/databases/*/documents/*/**}" };
59+
option (google.api.http) = {
60+
get: "/v1beta1/{name=projects/*/databases/*/documents/*/**}"
61+
};
5962
}
6063

6164
// Lists documents.
6265
rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) {
63-
option (google.api.http) = { get: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}" };
66+
option (google.api.http) = {
67+
get: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}/{collection_id}"
68+
};
6469
}
6570

6671
// Creates a new document.
6772
rpc CreateDocument(CreateDocumentRequest) returns (Document) {
68-
option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}" body: "document" };
73+
option (google.api.http) = {
74+
post: "/v1beta1/{parent=projects/*/databases/*/documents/**}/{collection_id}"
75+
body: "document"
76+
};
6977
}
7078

7179
// Updates or inserts a document.
7280
rpc UpdateDocument(UpdateDocumentRequest) returns (Document) {
73-
option (google.api.http) = { patch: "/v1beta1/{document.name=projects/*/databases/*/documents/*/**}" body: "document" };
81+
option (google.api.http) = {
82+
patch: "/v1beta1/{document.name=projects/*/databases/*/documents/*/**}"
83+
body: "document"
84+
};
7485
}
7586

7687
// Deletes a document.
7788
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
78-
option (google.api.http) = { delete: "/v1beta1/{name=projects/*/databases/*/documents/*/**}" };
89+
option (google.api.http) = {
90+
delete: "/v1beta1/{name=projects/*/databases/*/documents/*/**}"
91+
};
7992
}
8093

8194
// Gets multiple documents.
8295
//
8396
// Documents returned by this method are not guaranteed to be returned in the
8497
// same order that they were requested.
8598
rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (stream BatchGetDocumentsResponse) {
86-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:batchGet" body: "*" };
99+
option (google.api.http) = {
100+
post: "/v1beta1/{database=projects/*/databases/*}/documents:batchGet"
101+
body: "*"
102+
};
87103
}
88104

89105
// Starts a new transaction.
90106
rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) {
91-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction" body: "*" };
107+
option (google.api.http) = {
108+
post: "/v1beta1/{database=projects/*/databases/*}/documents:beginTransaction"
109+
body: "*"
110+
};
92111
}
93112

94113
// Commits a transaction, while optionally updating documents.
95114
rpc Commit(CommitRequest) returns (CommitResponse) {
96-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:commit" body: "*" };
115+
option (google.api.http) = {
116+
post: "/v1beta1/{database=projects/*/databases/*}/documents:commit"
117+
body: "*"
118+
};
97119
}
98120

99121
// Rolls back a transaction.
100122
rpc Rollback(RollbackRequest) returns (google.protobuf.Empty) {
101-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:rollback" body: "*" };
123+
option (google.api.http) = {
124+
post: "/v1beta1/{database=projects/*/databases/*}/documents:rollback"
125+
body: "*"
126+
};
102127
}
103128

104129
// Runs a query.
105130
rpc RunQuery(RunQueryRequest) returns (stream RunQueryResponse) {
106-
option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents}:runQuery" body: "*" };
131+
option (google.api.http) = {
132+
post: "/v1beta1/{parent=projects/*/databases/*/documents}:runQuery"
133+
body: "*"
134+
additional_bindings {
135+
post: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}:runQuery"
136+
body: "*"
137+
}
138+
};
107139
}
108140

109141
// Streams batches of document updates and deletes, in order.
110142
rpc Write(stream WriteRequest) returns (stream WriteResponse) {
111-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:write" body: "*" };
143+
option (google.api.http) = {
144+
post: "/v1beta1/{database=projects/*/databases/*}/documents:write"
145+
body: "*"
146+
};
112147
}
113148

114149
// Listens to changes.
115150
rpc Listen(stream ListenRequest) returns (stream ListenResponse) {
116-
option (google.api.http) = { post: "/v1beta1/{database=projects/*/databases/*}/documents:listen" body: "*" };
151+
option (google.api.http) = {
152+
post: "/v1beta1/{database=projects/*/databases/*}/documents:listen"
153+
body: "*"
154+
};
117155
}
118156

119157
// Lists all the collection IDs underneath a document.
120158
rpc ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse) {
121-
option (google.api.http) = { post: "/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds" body: "*" };
159+
option (google.api.http) = {
160+
post: "/v1beta1/{parent=projects/*/databases/*/documents}:listCollectionIds"
161+
body: "*"
162+
additional_bindings {
163+
post: "/v1beta1/{parent=projects/*/databases/*/documents/*/**}:listCollectionIds"
164+
body: "*"
165+
}
166+
};
122167
}
123168
}
124169

0 commit comments

Comments
 (0)