[go: nahoru, domu]

Skip to content

Commit

Permalink
fix: update service definitions (#2016)
Browse files Browse the repository at this point in the history
* field_info

* duration.proto

* fix: use paths relative to -p in update.sh

* chore: add owlbot staging directory

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Alexander Fenster <fenster@google.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 15, 2024
1 parent e598b9d commit ea4b6d0
Show file tree
Hide file tree
Showing 11 changed files with 23,187 additions and 11,958 deletions.
1,205 changes: 885 additions & 320 deletions dev/protos/admin_v1.json

Large diffs are not rendered by default.

2,295 changes: 1,494 additions & 801 deletions dev/protos/firestore_admin_v1_proto_api.d.ts

Large diffs are not rendered by default.

14,437 changes: 8,316 additions & 6,121 deletions dev/protos/firestore_admin_v1_proto_api.js

Large diffs are not rendered by default.

2,285 changes: 1,544 additions & 741 deletions dev/protos/firestore_v1_proto_api.d.ts

Large diffs are not rendered by default.

8,525 changes: 5,478 additions & 3,047 deletions dev/protos/firestore_v1_proto_api.js

Large diffs are not rendered by default.

1,072 changes: 927 additions & 145 deletions dev/protos/firestore_v1beta1_proto_api.d.ts

Large diffs are not rendered by default.

3,343 changes: 2,894 additions & 449 deletions dev/protos/firestore_v1beta1_proto_api.js

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions dev/protos/google/protobuf/duration.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

syntax = "proto3";

package google.protobuf;

option cc_enable_arenas = true;
option go_package = "google.golang.org/protobuf/types/known/durationpb";
option java_package = "com.google.protobuf";
option java_outer_classname = "DurationProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";

// A Duration represents a signed, fixed-length span of time represented
// as a count of seconds and fractions of seconds at nanosecond
// resolution. It is independent of any calendar and concepts like "day"
// or "month". It is related to Timestamp in that the difference between
// two Timestamp values is a Duration and it can be added or subtracted
// from a Timestamp. Range is approximately +-10,000 years.
//
// # Examples
//
// Example 1: Compute Duration from two Timestamps in pseudo code.
//
// Timestamp start = ...;
// Timestamp end = ...;
// Duration duration = ...;
//
// duration.seconds = end.seconds - start.seconds;
// duration.nanos = end.nanos - start.nanos;
//
// if (duration.seconds < 0 && duration.nanos > 0) {
// duration.seconds += 1;
// duration.nanos -= 1000000000;
// } else if (duration.seconds > 0 && duration.nanos < 0) {
// duration.seconds -= 1;
// duration.nanos += 1000000000;
// }
//
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
//
// Timestamp start = ...;
// Duration duration = ...;
// Timestamp end = ...;
//
// end.seconds = start.seconds + duration.seconds;
// end.nanos = start.nanos + duration.nanos;
//
// if (end.nanos < 0) {
// end.seconds -= 1;
// end.nanos += 1000000000;
// } else if (end.nanos >= 1000000000) {
// end.seconds += 1;
// end.nanos -= 1000000000;
// }
//
// Example 3: Compute Duration from datetime.timedelta in Python.
//
// td = datetime.timedelta(days=3, minutes=10)
// duration = Duration()
// duration.FromTimedelta(td)
//
// # JSON Mapping
//
// In JSON format, the Duration type is encoded as a string rather than an
// object, where the string ends in the suffix "s" (indicating seconds) and
// is preceded by the number of seconds, with nanoseconds expressed as
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
// microsecond should be expressed in JSON format as "3.000001s".
//
message Duration {
// Signed seconds of the span of time. Must be from -315,576,000,000
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
int64 seconds = 1;

// Signed fractions of a second at nanosecond resolution of the span
// of time. Durations less than one second are represented with a 0
// `seconds` field and a positive or negative `nanos` field. For durations
// of one second or more, a non-zero value for the `nanos` field must be
// of the same sign as the `seconds` field. Must be from -999,999,999
// to +999,999,999 inclusive.
int32 nanos = 2;
}
56 changes: 28 additions & 28 deletions dev/protos/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ cp googleapis/google/type/latlng.proto \
"${PROTOS_DIR}/google/type/"

mkdir -p "${PROTOS_DIR}/google/protobuf"
cp protobuf/src/google/protobuf/{any,descriptor,empty,field_mask,struct,timestamp,wrappers}.proto \
cp protobuf/src/google/protobuf/{any,descriptor,empty,field_mask,struct,timestamp,wrappers,duration}.proto \
"${PROTOS_DIR}/google/protobuf/"

popd

# Generate the Protobuf typings
PBJS_ARGS=( --proto_path=. \
PBJS_ARGS=( -p . \
--js_out=import_style=commonjs,binary:library \
--target=static-module \
--no-create \
Expand All @@ -92,50 +92,50 @@ PBJS_ARGS=( --proto_path=. \

"${PBJS}" "${PBJS_ARGS[@]}" -o firestore_v1_proto_api.js \
-r firestore_v1 \
"${PROTOS_DIR}/google/firestore/v1/*.proto" \
"${PROTOS_DIR}/firestore/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \
"${PROTOS_DIR}/google/longrunning/*.proto"
"google/firestore/v1/*.proto" \
"firestore/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto" \
"google/longrunning/*.proto"
perl -pi -e 's/number\|Long/number\|string/g' firestore_v1_proto_api.js
"${PBTS}" -o firestore_v1_proto_api.d.ts firestore_v1_proto_api.js

"${PBJS}" "${PBJS_ARGS[@]}" -o firestore_admin_v1_proto_api.js \
-r firestore_admin_v1 \
"${PROTOS_DIR}/google/firestore/admin/v1/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \
"${PROTOS_DIR}/google/longrunning/*.proto"
"google/firestore/admin/v1/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto" \
"google/longrunning/*.proto"
perl -pi -e 's/number\|Long/number\|string/g' firestore_admin_v1_proto_api.js
"${PBTS}" -o firestore_admin_v1_proto_api.d.ts firestore_admin_v1_proto_api.js

"${PBJS}" "${PBJS_ARGS[@]}" -o firestore_v1beta1_proto_api.js \
-r firestore_v1beta1 \
"${PROTOS_DIR}/google/firestore/v1beta1/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \
"${PROTOS_DIR}/google/longrunning/*.proto"
"google/firestore/v1beta1/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto" \
"google/longrunning/*.proto"
perl -pi -e 's/number\|Long/number\|string/g' firestore_v1beta1_proto_api.js
"${PBTS}" -o firestore_v1beta1_proto_api.d.ts firestore_v1beta1_proto_api.js

"${PBJS}" --proto_path=. --target=json -o v1.json \
"${PBJS}" -p . --target=json -o v1.json \
-r firestore_v1 \
"${PROTOS_DIR}/google/firestore/v1/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto"
"google/firestore/v1/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto"

"${PBJS}" --proto_path=. --target=json -o admin_v1.json \
"${PBJS}" -p . --target=json -o admin_v1.json \
-r firestore_admin_v1 \
"${PROTOS_DIR}/google/firestore/admin/v1/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto" \
"${PROTOS_DIR}/google/longrunning/*.proto"
"google/firestore/admin/v1/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto" \
"google/longrunning/*.proto"

"${PBJS}" --proto_path=. --target=json -o v1beta1.json \
"${PBJS}" -p . --target=json -o v1beta1.json \
-r firestore_v1beta1 \
"${PROTOS_DIR}/google/firestore/v1beta1/*.proto" \
"${PROTOS_DIR}/google/protobuf/*.proto" "${PROTOS_DIR}/google/type/*.proto" \
"${PROTOS_DIR}/google/rpc/*.proto" "${PROTOS_DIR}/google/api/*.proto"
"google/firestore/v1beta1/*.proto" \
"google/protobuf/*.proto" "google/type/*.proto" \
"google/rpc/*.proto" "google/api/*.proto"

echo "Finished running update.sh"

Expand Down
Loading

0 comments on commit ea4b6d0

Please sign in to comment.