From f07964c143e68ea5f41e86655f2009503897e24e Mon Sep 17 00:00:00 2001 From: eisbilir Date: Sat, 16 Sep 2023 15:14:22 +0300 Subject: [PATCH] feat: build proto with updated markup type --- bin/nosql-client.js | 1 + bin/server.js | 1 + src/dal/models/nosql/google/protobuf/struct.ts | 4 ++-- src/models/domain-layer/challenge/challenge.ts | 6 +++--- src/models/google/protobuf/empty.ts | 2 ++ src/models/google/protobuf/struct.ts | 4 ++-- src/models/google/protobuf/timestamp.ts | 10 +--------- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/bin/nosql-client.js b/bin/nosql-client.js index d64bc90..207cda7 100644 --- a/bin/nosql-client.js +++ b/bin/nosql-client.js @@ -30,6 +30,7 @@ const protoConfig = [ `--ts_proto_opt=outputServerImpl=false`, `--ts_proto_out=${MODEL_DIR}`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/*.proto`, + `--experimental_allow_proto3_optional` ]; // https://github.com/stephenh/ts-proto#usage diff --git a/bin/server.js b/bin/server.js index 4f68799..c0dfad3 100644 --- a/bin/server.js +++ b/bin/server.js @@ -32,6 +32,7 @@ const protoConfig = [ `--proto_path ${PROTO_DIR} ${PROTO_DIR}/common/*.proto`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/domain-layer/challenge/*.proto`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/domain-layer/challenge/services/*.proto`, + `--experimental_allow_proto3_optional` ]; // https://github.com/stephenh/ts-proto#usage diff --git a/src/dal/models/nosql/google/protobuf/struct.ts b/src/dal/models/nosql/google/protobuf/struct.ts index a4020da..1586696 100644 --- a/src/dal/models/nosql/google/protobuf/struct.ts +++ b/src/dal/models/nosql/google/protobuf/struct.ts @@ -68,8 +68,8 @@ export interface Struct_FieldsEntry { /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of these - * variants. Absence of any variant indicates an error. + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. */ diff --git a/src/models/domain-layer/challenge/challenge.ts b/src/models/domain-layer/challenge/challenge.ts index aabc94b..c93e242 100644 --- a/src/models/domain-layer/challenge/challenge.ts +++ b/src/models/domain-layer/challenge/challenge.ts @@ -1033,7 +1033,7 @@ export const Challenge_Billing = { writer.uint32(8).int32(message.billingAccountId); } if (message.markup !== 0) { - writer.uint32(21).float(message.markup); + writer.uint32(17).double(message.markup); } return writer; }, @@ -1053,11 +1053,11 @@ export const Challenge_Billing = { message.billingAccountId = reader.int32(); continue; case 2: - if (tag !== 21) { + if (tag !== 17) { break; } - message.markup = reader.float(); + message.markup = reader.double(); continue; } if ((tag & 7) === 4 || tag === 0) { diff --git a/src/models/google/protobuf/empty.ts b/src/models/google/protobuf/empty.ts index 05b727c..a93a73b 100644 --- a/src/models/google/protobuf/empty.ts +++ b/src/models/google/protobuf/empty.ts @@ -9,6 +9,8 @@ import _m0 from "protobufjs/minimal"; * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. */ export interface Empty { } diff --git a/src/models/google/protobuf/struct.ts b/src/models/google/protobuf/struct.ts index f0338a4..725fa5c 100644 --- a/src/models/google/protobuf/struct.ts +++ b/src/models/google/protobuf/struct.ts @@ -58,8 +58,8 @@ export interface Struct_FieldsEntry { /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a - * list of values. A producer of value is expected to set one of these - * variants. Absence of any variant indicates an error. + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. */ diff --git a/src/models/google/protobuf/timestamp.ts b/src/models/google/protobuf/timestamp.ts index 7079792..ec32072 100644 --- a/src/models/google/protobuf/timestamp.ts +++ b/src/models/google/protobuf/timestamp.ts @@ -53,15 +53,7 @@ import _m0 from "protobufjs/minimal"; * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) * .setNanos((int) ((millis % 1000) * 1000000)).build(); * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime()