From 3375be05c73098455c8544c706a281ac1984c83b Mon Sep 17 00:00:00 2001 From: eisbilir Date: Sat, 16 Sep 2023 15:13:33 +0300 Subject: [PATCH] feat: build proto with updated markup type --- clients/client-relational/bin/gen-stubs.js | 1 + domains/domain-acl/bin/gen-stubs.js | 1 + domains/domain-challenge/bin/gen-stubs.js | 1 + .../src/models/domain-layer/challenge/challenge.ts | 6 +++--- lib/lib-common/bin/gen-stubs.js | 1 + lib/lib-common/src/models/google/protobuf/empty.ts | 2 ++ lib/lib-common/src/models/google/protobuf/struct.ts | 4 ++-- lib/lib-common/src/models/google/protobuf/timestamp.ts | 10 +--------- scripts/packages/format.sh | 2 +- 9 files changed, 13 insertions(+), 15 deletions(-) diff --git a/clients/client-relational/bin/gen-stubs.js b/clients/client-relational/bin/gen-stubs.js index e66d758..2bf8f75 100644 --- a/clients/client-relational/bin/gen-stubs.js +++ b/clients/client-relational/bin/gen-stubs.js @@ -35,6 +35,7 @@ const protoConfig = [ `--ts_proto_opt=Mgoogle/protobuf/struct.proto=@topcoder-framework/lib-common`, `--ts_proto_opt=Mgoogle/protobuf/timestamp.proto=@topcoder-framework/lib-common`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/data-access-layer/relational/*.proto`, + `--experimental_allow_proto3_optional`, ]; // https://github.com/stephenh/ts-proto#usage diff --git a/domains/domain-acl/bin/gen-stubs.js b/domains/domain-acl/bin/gen-stubs.js index d186b3e..77c7047 100644 --- a/domains/domain-acl/bin/gen-stubs.js +++ b/domains/domain-acl/bin/gen-stubs.js @@ -37,6 +37,7 @@ const protoConfig = [ `--ts_proto_opt=Mgoogle/protobuf/empty.proto=@topcoder-framework/lib-common`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/domain-layer/legacy/*.proto`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/domain-layer/legacy/services/*.proto`, + `--experimental_allow_proto3_optional`, ]; // https://github.com/stephenh/ts-proto#usage diff --git a/domains/domain-challenge/bin/gen-stubs.js b/domains/domain-challenge/bin/gen-stubs.js index 835f2d2..7bc543a 100644 --- a/domains/domain-challenge/bin/gen-stubs.js +++ b/domains/domain-challenge/bin/gen-stubs.js @@ -38,6 +38,7 @@ const protoConfig = [ `--ts_proto_opt=Mgoogle/protobuf/empty.proto=@topcoder-framework/lib-common`, `--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/domains/domain-challenge/src/models/domain-layer/challenge/challenge.ts b/domains/domain-challenge/src/models/domain-layer/challenge/challenge.ts index f3963bd..e61d93f 100644 --- a/domains/domain-challenge/src/models/domain-layer/challenge/challenge.ts +++ b/domains/domain-challenge/src/models/domain-layer/challenge/challenge.ts @@ -1166,7 +1166,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; }, @@ -1187,11 +1187,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/lib/lib-common/bin/gen-stubs.js b/lib/lib-common/bin/gen-stubs.js index 3966fd8..301c49c 100644 --- a/lib/lib-common/bin/gen-stubs.js +++ b/lib/lib-common/bin/gen-stubs.js @@ -34,6 +34,7 @@ const protoConfig = [ `--ts_proto_opt=outputClientImpl=true`, `--ts_proto_out=${MODEL_DIR}`, `--proto_path ${PROTO_DIR} ${PROTO_DIR}/common/*.proto`, + `--experimental_allow_proto3_optional`, ]; // https://github.com/stephenh/ts-proto#usage diff --git a/lib/lib-common/src/models/google/protobuf/empty.ts b/lib/lib-common/src/models/google/protobuf/empty.ts index 4414abb..5187163 100644 --- a/lib/lib-common/src/models/google/protobuf/empty.ts +++ b/lib/lib-common/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/lib/lib-common/src/models/google/protobuf/struct.ts b/lib/lib-common/src/models/google/protobuf/struct.ts index 3385280..c2ebeca 100644 --- a/lib/lib-common/src/models/google/protobuf/struct.ts +++ b/lib/lib-common/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/lib/lib-common/src/models/google/protobuf/timestamp.ts b/lib/lib-common/src/models/google/protobuf/timestamp.ts index e4a5adf..66f8734 100644 --- a/lib/lib-common/src/models/google/protobuf/timestamp.ts +++ b/lib/lib-common/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() diff --git a/scripts/packages/format.sh b/scripts/packages/format.sh index 0aefcb8..bc8deed 100755 --- a/scripts/packages/format.sh +++ b/scripts/packages/format.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -yarn prettier --write src/**/*.ts +yarn prettier --write "src/**/*.ts"