diff --git a/.travis.yml b/.travis.yml index 5ca82cd0..769678e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ deploy: email: secure: WRWu/LodEL9DQO/p65MwFzOOAmfezOOVB7N7Wh56NImUSX0/Ves4Uuzm1yWhqb/OuonW3Ofm3wxmLiwjpJpiNf45OivI1N2Z/noKn+ZiAC/beuHUYXDR5FlHZvf0VmXXhjFnJPu1cRGHdTD2RIloL4z5TUajNta4FZdIo37lLfNodafaiTd+F/OQR3LsC7R7oyMKH3MLDbEEAZkfCv7Vfk+kxLhSezWJuy24APGG856oOEj49sy6s27hWsX89SruOQggbZFnw8yxWC0rkEp4ACNhdWx3FxhoQ5XR5AT4OB2Ydfgr8+YHQReBqZnHBn0RAQ5qLc+hJUhLGZZlw0WCbuAc8W+zd2IH5ufLUzTn3RfMCeDb50cfX9Dz7Zi9wPJDxCE8DMFJfHuCEV6GEuso5bu9vB175lGrwuOrkpvLlen/5HykLKSobAZ7gixnsg7F6oVV+CgM1xA7eN6oA2KPWzudMtydJ7aRDkHMyyHN7LsTMUmE5iTWTBZV0+o3x6dskc3xfSfXHjUuD3qefdraW0cV4gFrpq7r+dB3x6jUfKlwPeQkPb0RMsOw+v179kYmbS5M+ejvNI3Ta9ffrOvTZyEOq3b6WXJZU2TGa1hIazP8BXzZ6AEh6Oq7tRczlyNT9DM0bpocwPyPUF1+dduBxa10PJGkoRbBYT4abk2e7MI= api_key: - secure: lSqMHFgvNO9ABjx4dqBYLkbiD8oCoZPRISQZMamg9A+jZdSbH7UYDaGpckbM552w5Oi3jJOKdt82xGoii/IAhIaLFIhf9tzpKQjW5UlYzSmRVL6FB2KpNPa6iondpPeXYdpA5As4N8Peee2EfEsCsA82e54X++Dv/HyovnXUp4dQ0BqZOBihPcWeuTBcD25UaPCClKdX3XSTP8pN5uSfYPpBSQ15JYaLD2EUtpqZ//a0o0wtS1vFjKUz71SnqiHktCz4vKSxmPRpe2bksYfa0kecq41TXG3foAmeVbsXXWpJCvUyEuiRI/mtS4/X9ALWMKGO1ob2VXOz+iUhcwcqQnJs6UvIHlAOR7+d2bzFb4VAIhdvfJuMy7fwIufuIvE0v8fHcIyp1vqbelYj43dBgTyCBwUiNzGe6O3+Kan6OaXqoO9342JUCD1V6NzAHRri/362oTvq02OLUwSUjSBho7a4MIdmy0Yinyd4/pvWOPXR0Kdi/6oZ4k9m1hrrFDYEXz5FQaFGzdiunmYzaoZ8UEszH8WIhqITS79VIM2DXlO0Oa4N0g+uH9/3TN0KvYuUf0j+qhBLh5Lr7BabYPhs2QHxX7pqJQQg8+XuimX0E/MDEuKmGcDClpsFOzSNB/YUfJ4ImaloWAowuzGoE6DCvjwXbpFOh3M+EgcGfqolyZw= - tag: $NPM_TAG + secure: V5ha4R/5SByBygSa5V9Tm9gpxY3RhmPJueboD8gRIJ952IddUPwCL0wd3yp1Sln0/Ppeh9T6mAl3zCVCqGc4GTwpgh7CwhjXDQZ9kdjixqD464Giv2cxyQ2ZFDO7HDHbQyk+yLIFCQZr1CVMoMkkPxLx72zcJRVuISEITckeYozs32Fn3QciefJqzXr1l2BIQFtCV23StVx4QykPVyY/0l50xAoY3AJudh0MJYQ9gQBfCLgm8SCD0kVf5uAx1mowUDk+AjEbaYuxevZ6ovjuMt/CPzOoYSSOSgh+4///VtBxHcsk+8pGeamgZ0x6CDS9CVQ7tqydXWLrteB6qbkLsegJCcLZYGDHeaIaV+WQbyCzOD41G9hrFUFp49x0zb5XFvdZn7YKViRdeMrdS2yZdyj7gYLo/Cmkn86dvlSpoUx5ic0L5cEMhBHWIntRgyrSwR8zrxwOD+70Fq/nmAzRzN1qsgOIo5aqoVQakEMEFa5SQznE6Zw4skAxW8RtLQQfBbPWegwGVm/Ph9ERbcN1ZGCtQANW1gNPh0LmquiITGO5TH00uAOBoUoQ8X5LTFxmK5tihJX7gtAzWEg1N+JziLiJEEU6dJZqYa/HB5PQe/+uy89Tk2y4nk+S5U3iZuC0y7dbmfyNAmdDOEu38GL9wMSLrDDO3Uq/97QdQnaofVk= + tag: "$NPM_TAG" on: branch: master cache: @@ -36,4 +36,4 @@ before_install: install: - npm install script: -- ./travis-ci-build.sh +- "./travis-ci-build.sh" diff --git a/CHANGELOG.md b/CHANGELOG.md index a21c9f41..c5886449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,22 @@ -## 0.7.4-pre +## 0.7.7-pre + +## 0.7.6 + +### Fixes +* Broken integration tests on master + +## 0.7.5 + +### Fixes +* Fixed NPM publish. + +## 0.7.4 + +### Changes +* Download protoc when generating protos to ensure a consistent version is being used. [@easyCZ](https://github.com/easyCZ) in [#80](https://github.com/improbable-eng/ts-protoc-gen/pull/80) +* Always generate Service Definitions (`pb_service.d.js` and `pb_service.d.ts`) even if the proto does not define any services. [@lx223 ](https://github.com/lx223) in [#83](https://github.com/improbable-eng/ts-protoc-gen/pull/83) +* Add custom Bazel rule which uses ts-protoc-gen for generation. [@coltonmorris](https://github.com/coltonmorris) in [#84](https://github.com/improbable-eng/ts-protoc-gen/pull/84) +* Add `debug` to `ServiceClientOptions`. [@bianbian-org](https://github.com/bianbian-org) in [#90](https://github.com/improbable-eng/ts-protoc-gen/pull/90) ## 0.7.3 diff --git a/README.md b/README.md index c8cf5457..c08b1011 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ git_repository( commit = "6bee898391a42971289a7989c0f459ab5a4a84dd", # master as of May 10th, 2018 remote = "https://github.com/bazelbuild/rules_go.git", ) - load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") - go_rules_dependencies() +load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") +go_rules_dependencies() go_register_toolchains() http_archive( @@ -86,11 +86,6 @@ proto_library( ], ) -typescript_proto_library( - name = "generate", - proto = ":proto", -) - typescript_proto_library( name = "generate", proto = ":proto", diff --git a/examples/generated/examplecom/empty_message_no_service_pb_service.d.ts b/examples/generated/examplecom/empty_message_no_service_pb_service.d.ts deleted file mode 100644 index e01864c6..00000000 --- a/examples/generated/examplecom/empty_message_no_service_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/empty_message_no_service.proto - diff --git a/examples/generated/examplecom/empty_message_no_service_pb_service.js b/examples/generated/examplecom/empty_message_no_service_pb_service.js deleted file mode 100644 index e01864c6..00000000 --- a/examples/generated/examplecom/empty_message_no_service_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/empty_message_no_service.proto - diff --git a/examples/generated/examplecom/enum_message_pb_service.d.ts b/examples/generated/examplecom/enum_message_pb_service.d.ts deleted file mode 100644 index 1ce9b128..00000000 --- a/examples/generated/examplecom/enum_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/enum_message.proto - diff --git a/examples/generated/examplecom/enum_message_pb_service.js b/examples/generated/examplecom/enum_message_pb_service.js deleted file mode 100644 index 1ce9b128..00000000 --- a/examples/generated/examplecom/enum_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/enum_message.proto - diff --git a/examples/generated/examplecom/map_message_pb_service.d.ts b/examples/generated/examplecom/map_message_pb_service.d.ts deleted file mode 100644 index 8a545362..00000000 --- a/examples/generated/examplecom/map_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/map_message.proto - diff --git a/examples/generated/examplecom/map_message_pb_service.js b/examples/generated/examplecom/map_message_pb_service.js deleted file mode 100644 index 8a545362..00000000 --- a/examples/generated/examplecom/map_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/map_message.proto - diff --git a/examples/generated/examplecom/oneof_message_pb_service.d.ts b/examples/generated/examplecom/oneof_message_pb_service.d.ts deleted file mode 100644 index 9ce8bd5f..00000000 --- a/examples/generated/examplecom/oneof_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/oneof_message.proto - diff --git a/examples/generated/examplecom/oneof_message_pb_service.js b/examples/generated/examplecom/oneof_message_pb_service.js deleted file mode 100644 index 9ce8bd5f..00000000 --- a/examples/generated/examplecom/oneof_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/oneof_message.proto - diff --git a/examples/generated/examplecom/parent_message_v2_pb_service.d.ts b/examples/generated/examplecom/parent_message_v2_pb_service.d.ts deleted file mode 100644 index 8a56219e..00000000 --- a/examples/generated/examplecom/parent_message_v2_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/parent_message_v2.proto - diff --git a/examples/generated/examplecom/parent_message_v2_pb_service.js b/examples/generated/examplecom/parent_message_v2_pb_service.js deleted file mode 100644 index 8a56219e..00000000 --- a/examples/generated/examplecom/parent_message_v2_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/parent_message_v2.proto - diff --git a/examples/generated/examplecom/parent_message_v3_pb_service.d.ts b/examples/generated/examplecom/parent_message_v3_pb_service.d.ts deleted file mode 100644 index 904da543..00000000 --- a/examples/generated/examplecom/parent_message_v3_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/parent_message_v3.proto - diff --git a/examples/generated/examplecom/parent_message_v3_pb_service.js b/examples/generated/examplecom/parent_message_v3_pb_service.js deleted file mode 100644 index 904da543..00000000 --- a/examples/generated/examplecom/parent_message_v3_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/parent_message_v3.proto - diff --git a/examples/generated/examplecom/primitive_message_v2_pb_service.d.ts b/examples/generated/examplecom/primitive_message_v2_pb_service.d.ts deleted file mode 100644 index 764a1c29..00000000 --- a/examples/generated/examplecom/primitive_message_v2_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/primitive_message_v2.proto - diff --git a/examples/generated/examplecom/primitive_message_v2_pb_service.js b/examples/generated/examplecom/primitive_message_v2_pb_service.js deleted file mode 100644 index 764a1c29..00000000 --- a/examples/generated/examplecom/primitive_message_v2_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/primitive_message_v2.proto - diff --git a/examples/generated/examplecom/primitive_message_v3_pb_service.d.ts b/examples/generated/examplecom/primitive_message_v3_pb_service.d.ts deleted file mode 100644 index 51427e09..00000000 --- a/examples/generated/examplecom/primitive_message_v3_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/primitive_message_v3.proto - diff --git a/examples/generated/examplecom/primitive_message_v3_pb_service.js b/examples/generated/examplecom/primitive_message_v3_pb_service.js deleted file mode 100644 index 51427e09..00000000 --- a/examples/generated/examplecom/primitive_message_v3_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/primitive_message_v3.proto - diff --git a/examples/generated/examplecom/repeated_primitive_message_pb_service.d.ts b/examples/generated/examplecom/repeated_primitive_message_pb_service.d.ts deleted file mode 100644 index 0d9d56af..00000000 --- a/examples/generated/examplecom/repeated_primitive_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/repeated_primitive_message.proto - diff --git a/examples/generated/examplecom/repeated_primitive_message_pb_service.js b/examples/generated/examplecom/repeated_primitive_message_pb_service.js deleted file mode 100644 index 0d9d56af..00000000 --- a/examples/generated/examplecom/repeated_primitive_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/repeated_primitive_message.proto - diff --git a/examples/generated/examplecom/reserved_words_pb_service.d.ts b/examples/generated/examplecom/reserved_words_pb_service.d.ts deleted file mode 100644 index a63285d5..00000000 --- a/examples/generated/examplecom/reserved_words_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/reserved_words.proto - diff --git a/examples/generated/examplecom/reserved_words_pb_service.js b/examples/generated/examplecom/reserved_words_pb_service.js deleted file mode 100644 index a63285d5..00000000 --- a/examples/generated/examplecom/reserved_words_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/reserved_words.proto - diff --git a/examples/generated/examplecom/simple_pb_service.d.ts b/examples/generated/examplecom/simple_pb_service.d.ts deleted file mode 100644 index b1e12cf9..00000000 --- a/examples/generated/examplecom/simple_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/simple.proto - diff --git a/examples/generated/examplecom/simple_pb_service.js b/examples/generated/examplecom/simple_pb_service.js deleted file mode 100644 index b1e12cf9..00000000 --- a/examples/generated/examplecom/simple_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/simple.proto - diff --git a/examples/generated/examplecom/simplevalue_pb_service.d.ts b/examples/generated/examplecom/simplevalue_pb_service.d.ts deleted file mode 100644 index f92cd8ad..00000000 --- a/examples/generated/examplecom/simplevalue_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/simplevalue.proto - diff --git a/examples/generated/examplecom/simplevalue_pb_service.js b/examples/generated/examplecom/simplevalue_pb_service.js deleted file mode 100644 index f92cd8ad..00000000 --- a/examples/generated/examplecom/simplevalue_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/simplevalue.proto - diff --git a/examples/generated/examplecom/well_known_message_pb_service.d.ts b/examples/generated/examplecom/well_known_message_pb_service.d.ts deleted file mode 100644 index bb43a9d1..00000000 --- a/examples/generated/examplecom/well_known_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/well_known_message.proto - diff --git a/examples/generated/examplecom/well_known_message_pb_service.js b/examples/generated/examplecom/well_known_message_pb_service.js deleted file mode 100644 index bb43a9d1..00000000 --- a/examples/generated/examplecom/well_known_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: examplecom -// file: examplecom/well_known_message.proto - diff --git a/examples/generated/othercom/external_child_message_pb_service.d.ts b/examples/generated/othercom/external_child_message_pb_service.d.ts deleted file mode 100644 index e9f4f74e..00000000 --- a/examples/generated/othercom/external_child_message_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: othercom -// file: othercom/external_child_message.proto - diff --git a/examples/generated/othercom/external_child_message_pb_service.js b/examples/generated/othercom/external_child_message_pb_service.js deleted file mode 100644 index e9f4f74e..00000000 --- a/examples/generated/othercom/external_child_message_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: othercom -// file: othercom/external_child_message.proto - diff --git a/examples/generated/othercom/external_enum_pb_service.d.ts b/examples/generated/othercom/external_enum_pb_service.d.ts deleted file mode 100644 index eccb1871..00000000 --- a/examples/generated/othercom/external_enum_pb_service.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// package: othercom -// file: othercom/external_enum.proto - diff --git a/examples/generated/othercom/external_enum_pb_service.js b/examples/generated/othercom/external_enum_pb_service.js deleted file mode 100644 index eccb1871..00000000 --- a/examples/generated/othercom/external_enum_pb_service.js +++ /dev/null @@ -1,3 +0,0 @@ -// package: othercom -// file: othercom/external_enum.proto - diff --git a/examples/generated/examplecom/empty_message_no_service_pb.d.ts b/examples/generated/proto/examplecom/empty_message_no_service_pb.d.ts similarity index 93% rename from examples/generated/examplecom/empty_message_no_service_pb.d.ts rename to examples/generated/proto/examplecom/empty_message_no_service_pb.d.ts index 884d87a1..6990710b 100644 --- a/examples/generated/examplecom/empty_message_no_service_pb.d.ts +++ b/examples/generated/proto/examplecom/empty_message_no_service_pb.d.ts @@ -1,5 +1,5 @@ // package: examplecom -// file: examplecom/empty_message_no_service.proto +// file: proto/examplecom/empty_message_no_service.proto import * as jspb from "google-protobuf"; diff --git a/examples/generated/examplecom/empty_message_no_service_pb.js b/examples/generated/proto/examplecom/empty_message_no_service_pb.js similarity index 100% rename from examples/generated/examplecom/empty_message_no_service_pb.js rename to examples/generated/proto/examplecom/empty_message_no_service_pb.js diff --git a/examples/generated/proto/examplecom/empty_message_no_service_pb_service.d.ts b/examples/generated/proto/examplecom/empty_message_no_service_pb_service.d.ts new file mode 100644 index 00000000..8f08f53e --- /dev/null +++ b/examples/generated/proto/examplecom/empty_message_no_service_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/empty_message_no_service.proto + diff --git a/examples/generated/proto/examplecom/empty_message_no_service_pb_service.js b/examples/generated/proto/examplecom/empty_message_no_service_pb_service.js new file mode 100644 index 00000000..8f08f53e --- /dev/null +++ b/examples/generated/proto/examplecom/empty_message_no_service_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/empty_message_no_service.proto + diff --git a/examples/generated/proto/examplecom/enum_message_pb_service.d.ts b/examples/generated/proto/examplecom/enum_message_pb_service.d.ts new file mode 100644 index 00000000..d12dd4aa --- /dev/null +++ b/examples/generated/proto/examplecom/enum_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/enum_message.proto + diff --git a/examples/generated/proto/examplecom/enum_message_pb_service.js b/examples/generated/proto/examplecom/enum_message_pb_service.js new file mode 100644 index 00000000..d12dd4aa --- /dev/null +++ b/examples/generated/proto/examplecom/enum_message_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/enum_message.proto + diff --git a/examples/generated/proto/examplecom/map_message_pb_service.d.ts b/examples/generated/proto/examplecom/map_message_pb_service.d.ts new file mode 100644 index 00000000..f80a25a1 --- /dev/null +++ b/examples/generated/proto/examplecom/map_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/map_message.proto + diff --git a/examples/generated/proto/examplecom/map_message_pb_service.js b/examples/generated/proto/examplecom/map_message_pb_service.js new file mode 100644 index 00000000..f80a25a1 --- /dev/null +++ b/examples/generated/proto/examplecom/map_message_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/map_message.proto + diff --git a/examples/generated/proto/examplecom/oneof_message_pb_service.d.ts b/examples/generated/proto/examplecom/oneof_message_pb_service.d.ts new file mode 100644 index 00000000..62a2c13b --- /dev/null +++ b/examples/generated/proto/examplecom/oneof_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/oneof_message.proto + diff --git a/examples/generated/proto/examplecom/oneof_message_pb_service.js b/examples/generated/proto/examplecom/oneof_message_pb_service.js new file mode 100644 index 00000000..62a2c13b --- /dev/null +++ b/examples/generated/proto/examplecom/oneof_message_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/oneof_message.proto + diff --git a/examples/generated/proto/examplecom/parent_message_v2_pb_service.d.ts b/examples/generated/proto/examplecom/parent_message_v2_pb_service.d.ts new file mode 100644 index 00000000..dfa8872c --- /dev/null +++ b/examples/generated/proto/examplecom/parent_message_v2_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/parent_message_v2.proto + diff --git a/examples/generated/proto/examplecom/parent_message_v2_pb_service.js b/examples/generated/proto/examplecom/parent_message_v2_pb_service.js new file mode 100644 index 00000000..dfa8872c --- /dev/null +++ b/examples/generated/proto/examplecom/parent_message_v2_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/parent_message_v2.proto + diff --git a/examples/generated/proto/examplecom/parent_message_v3_pb_service.d.ts b/examples/generated/proto/examplecom/parent_message_v3_pb_service.d.ts new file mode 100644 index 00000000..419294c2 --- /dev/null +++ b/examples/generated/proto/examplecom/parent_message_v3_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/parent_message_v3.proto + diff --git a/examples/generated/proto/examplecom/parent_message_v3_pb_service.js b/examples/generated/proto/examplecom/parent_message_v3_pb_service.js new file mode 100644 index 00000000..419294c2 --- /dev/null +++ b/examples/generated/proto/examplecom/parent_message_v3_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/parent_message_v3.proto + diff --git a/examples/generated/proto/examplecom/primitive_message_v2_pb_service.d.ts b/examples/generated/proto/examplecom/primitive_message_v2_pb_service.d.ts new file mode 100644 index 00000000..cd565930 --- /dev/null +++ b/examples/generated/proto/examplecom/primitive_message_v2_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/primitive_message_v2.proto + diff --git a/examples/generated/proto/examplecom/primitive_message_v2_pb_service.js b/examples/generated/proto/examplecom/primitive_message_v2_pb_service.js new file mode 100644 index 00000000..cd565930 --- /dev/null +++ b/examples/generated/proto/examplecom/primitive_message_v2_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/primitive_message_v2.proto + diff --git a/examples/generated/proto/examplecom/primitive_message_v3_pb_service.d.ts b/examples/generated/proto/examplecom/primitive_message_v3_pb_service.d.ts new file mode 100644 index 00000000..e091f3ae --- /dev/null +++ b/examples/generated/proto/examplecom/primitive_message_v3_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/primitive_message_v3.proto + diff --git a/examples/generated/proto/examplecom/primitive_message_v3_pb_service.js b/examples/generated/proto/examplecom/primitive_message_v3_pb_service.js new file mode 100644 index 00000000..e091f3ae --- /dev/null +++ b/examples/generated/proto/examplecom/primitive_message_v3_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/primitive_message_v3.proto + diff --git a/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.d.ts b/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.d.ts new file mode 100644 index 00000000..b7dbeb7d --- /dev/null +++ b/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/repeated_primitive_message.proto + diff --git a/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.js b/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.js new file mode 100644 index 00000000..b7dbeb7d --- /dev/null +++ b/examples/generated/proto/examplecom/repeated_primitive_message_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/repeated_primitive_message.proto + diff --git a/examples/generated/proto/examplecom/reserved_words_pb_service.d.ts b/examples/generated/proto/examplecom/reserved_words_pb_service.d.ts new file mode 100644 index 00000000..951d1a13 --- /dev/null +++ b/examples/generated/proto/examplecom/reserved_words_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/reserved_words.proto + diff --git a/examples/generated/proto/examplecom/reserved_words_pb_service.js b/examples/generated/proto/examplecom/reserved_words_pb_service.js new file mode 100644 index 00000000..951d1a13 --- /dev/null +++ b/examples/generated/proto/examplecom/reserved_words_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/reserved_words.proto + diff --git a/examples/generated/proto/examplecom/simple_pb_service.d.ts b/examples/generated/proto/examplecom/simple_pb_service.d.ts new file mode 100644 index 00000000..82de7c02 --- /dev/null +++ b/examples/generated/proto/examplecom/simple_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/simple.proto + diff --git a/examples/generated/proto/examplecom/simple_pb_service.js b/examples/generated/proto/examplecom/simple_pb_service.js new file mode 100644 index 00000000..82de7c02 --- /dev/null +++ b/examples/generated/proto/examplecom/simple_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/simple.proto + diff --git a/examples/generated/proto/examplecom/simple_service_pb_service.d.ts b/examples/generated/proto/examplecom/simple_service_pb_service.d.ts index ddafbea9..b2a436ba 100644 --- a/examples/generated/proto/examplecom/simple_service_pb_service.d.ts +++ b/examples/generated/proto/examplecom/simple_service_pb_service.d.ts @@ -41,7 +41,7 @@ export class SimpleService { export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } export type Status = { details: string, code: number; metadata: grpc.Metadata } -export type ServiceClientOptions = { transport: grpc.TransportConstructor } +export type ServiceClientOptions = { transport: grpc.TransportConstructor; debug?: boolean } interface ResponseStream { cancel(): void; diff --git a/examples/generated/proto/examplecom/simple_service_pb_service.js b/examples/generated/proto/examplecom/simple_service_pb_service.js index 0fa10b35..7e5d456c 100644 --- a/examples/generated/proto/examplecom/simple_service_pb_service.js +++ b/examples/generated/proto/examplecom/simple_service_pb_service.js @@ -54,6 +54,7 @@ SimpleServiceClient.prototype.doUnary = function doUnary(requestMessage, metadat host: this.serviceHost, metadata: metadata, transport: this.options.transport, + debug: this.options.debug, onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { @@ -77,6 +78,7 @@ SimpleServiceClient.prototype.doStream = function doStream(requestMessage, metad host: this.serviceHost, metadata: metadata, transport: this.options.transport, + debug: this.options.debug, onMessage: function (responseMessage) { listeners.data.forEach(function (handler) { handler(responseMessage); @@ -113,6 +115,7 @@ SimpleServiceClient.prototype.delete = function pb_delete(requestMessage, metada host: this.serviceHost, metadata: metadata, transport: this.options.transport, + debug: this.options.debug, onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { diff --git a/examples/generated/proto/examplecom/simplevalue_pb_service.d.ts b/examples/generated/proto/examplecom/simplevalue_pb_service.d.ts new file mode 100644 index 00000000..5d3f2d5a --- /dev/null +++ b/examples/generated/proto/examplecom/simplevalue_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/simplevalue.proto + diff --git a/examples/generated/proto/examplecom/simplevalue_pb_service.js b/examples/generated/proto/examplecom/simplevalue_pb_service.js new file mode 100644 index 00000000..5d3f2d5a --- /dev/null +++ b/examples/generated/proto/examplecom/simplevalue_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/simplevalue.proto + diff --git a/examples/generated/proto/examplecom/well_known_message_pb_service.d.ts b/examples/generated/proto/examplecom/well_known_message_pb_service.d.ts new file mode 100644 index 00000000..3251d3d5 --- /dev/null +++ b/examples/generated/proto/examplecom/well_known_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/well_known_message.proto + diff --git a/examples/generated/proto/examplecom/well_known_message_pb_service.js b/examples/generated/proto/examplecom/well_known_message_pb_service.js new file mode 100644 index 00000000..3251d3d5 --- /dev/null +++ b/examples/generated/proto/examplecom/well_known_message_pb_service.js @@ -0,0 +1,3 @@ +// package: examplecom +// file: proto/examplecom/well_known_message.proto + diff --git a/examples/generated/proto/orphan_pb_service.d.ts b/examples/generated/proto/orphan_pb_service.d.ts index ede90559..727476d8 100644 --- a/examples/generated/proto/orphan_pb_service.d.ts +++ b/examples/generated/proto/orphan_pb_service.d.ts @@ -30,7 +30,7 @@ export class OrphanService { export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } export type Status = { details: string, code: number; metadata: grpc.Metadata } -export type ServiceClientOptions = { transport: grpc.TransportConstructor } +export type ServiceClientOptions = { transport: grpc.TransportConstructor; debug?: boolean } interface ResponseStream { cancel(): void; diff --git a/examples/generated/proto/orphan_pb_service.js b/examples/generated/proto/orphan_pb_service.js index c8c4583c..979be1ea 100644 --- a/examples/generated/proto/orphan_pb_service.js +++ b/examples/generated/proto/orphan_pb_service.js @@ -44,6 +44,7 @@ OrphanServiceClient.prototype.doUnary = function doUnary(requestMessage, metadat host: this.serviceHost, metadata: metadata, transport: this.options.transport, + debug: this.options.debug, onEnd: function (response) { if (callback) { if (response.status !== grpc.Code.OK) { @@ -67,6 +68,7 @@ OrphanServiceClient.prototype.doStream = function doStream(requestMessage, metad host: this.serviceHost, metadata: metadata, transport: this.options.transport, + debug: this.options.debug, onMessage: function (responseMessage) { listeners.data.forEach(function (handler) { handler(responseMessage); diff --git a/examples/generated/proto/othercom/external_child_message_pb_service.d.ts b/examples/generated/proto/othercom/external_child_message_pb_service.d.ts new file mode 100644 index 00000000..393230ae --- /dev/null +++ b/examples/generated/proto/othercom/external_child_message_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: othercom +// file: proto/othercom/external_child_message.proto + diff --git a/examples/generated/proto/othercom/external_child_message_pb_service.js b/examples/generated/proto/othercom/external_child_message_pb_service.js new file mode 100644 index 00000000..393230ae --- /dev/null +++ b/examples/generated/proto/othercom/external_child_message_pb_service.js @@ -0,0 +1,3 @@ +// package: othercom +// file: proto/othercom/external_child_message.proto + diff --git a/examples/generated/proto/othercom/external_enum_pb_service.d.ts b/examples/generated/proto/othercom/external_enum_pb_service.d.ts new file mode 100644 index 00000000..e24e3c22 --- /dev/null +++ b/examples/generated/proto/othercom/external_enum_pb_service.d.ts @@ -0,0 +1,3 @@ +// package: othercom +// file: proto/othercom/external_enum.proto + diff --git a/examples/generated/proto/othercom/external_enum_pb_service.js b/examples/generated/proto/othercom/external_enum_pb_service.js new file mode 100644 index 00000000..e24e3c22 --- /dev/null +++ b/examples/generated/proto/othercom/external_enum_pb_service.js @@ -0,0 +1,3 @@ +// package: othercom +// file: proto/othercom/external_enum.proto + diff --git a/package-lock.json b/package-lock.json index fd772715..6f55f073 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ts-protoc-gen", - "version": "0.7.4-pre", + "version": "0.7.7-pre", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -46,7 +46,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "argparse": { @@ -55,7 +55,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arrify": { @@ -82,9 +82,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -99,11 +99,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -126,7 +126,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -160,9 +160,9 @@ "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", "dev": true, "requires": { - "assertion-error": "1.1.0", - "deep-eql": "0.1.3", - "type-detect": "1.0.0" + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" } }, "chalk": { @@ -171,9 +171,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "dependencies": { "has-flag": { @@ -188,7 +188,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -199,7 +199,7 @@ "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "^1.1.1" } }, "color-name": { @@ -282,12 +282,12 @@ "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "google-protobuf": { @@ -307,7 +307,7 @@ "integrity": "sha512-AcLecuqaDp5STYXGViTQmNTCoZVfM6gi3+hvfTGXGP5YTIimASesNi39jnP8dox3x8QBelMWDdOck5/4UJaZdg==", "dev": true, "requires": { - "browser-headers": "0.4.0" + "browser-headers": "^0.4.0" } }, "has-ansi": { @@ -316,7 +316,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-flag": { @@ -337,8 +337,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -359,8 +359,8 @@ "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "lodash": { @@ -387,7 +387,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -436,12 +436,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -452,8 +452,8 @@ "integrity": "sha1-iBxKCDcKn3bbFQ+yMFTjDMPjcnA=", "dev": true, "requires": { - "mocha": "5.2.0", - "moment": "2.22.1" + "mocha": "^5.0.2", + "moment": "^2.21.0" }, "dependencies": { "browser-stdout": { @@ -489,12 +489,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "growl": { @@ -534,7 +534,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -557,7 +557,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "path-is-absolute": { @@ -578,7 +578,7 @@ "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "semver": { @@ -599,7 +599,7 @@ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "sprintf-js": { @@ -614,7 +614,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "supports-color": { @@ -623,7 +623,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "ts-node": { @@ -632,14 +632,14 @@ "integrity": "sha512-XK7QmDcNHVmZkVtkiwNDWiERRHPyU8nBqZB1+iv2UhOG0q3RQ9HsZ2CMqISlFbxjrYFGfG2mX7bW4dAyxBVzUw==", "dev": true, "requires": { - "arrify": "1.0.1", - "chalk": "2.4.1", - "diff": "3.2.0", - "make-error": "1.3.4", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "source-map-support": "0.5.6", - "yn": "2.0.0" + "arrify": "^1.0.0", + "chalk": "^2.3.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.3", + "yn": "^2.0.0" }, "dependencies": { "minimist": { @@ -660,8 +660,8 @@ "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", "dev": true, "requires": { - "buffer-from": "1.0.0", - "source-map": "0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } } } @@ -678,18 +678,18 @@ "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "builtin-modules": "1.1.1", - "chalk": "2.4.1", - "commander": "2.15.1", - "diff": "3.2.0", - "glob": "7.1.1", - "js-yaml": "3.11.0", - "minimatch": "3.0.4", - "resolve": "1.7.1", - "semver": "5.5.0", - "tslib": "1.9.1", - "tsutils": "2.27.1" + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" }, "dependencies": { "commander": { @@ -706,7 +706,7 @@ "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", "dev": true, "requires": { - "tslib": "1.9.1" + "tslib": "^1.8.1" } }, "type-detect": { diff --git a/package.json b/package.json index e701704f..cf0b2ac6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-protoc-gen", - "version": "0.7.4-pre", + "version": "0.7.7-pre", "description": "Protoc Plugin for TypeScript Declarations and Service Definitions", "scripts": { "lint": "tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'", diff --git a/src/service/grpcweb.ts b/src/service/grpcweb.ts index 9f0fc785..fbdd87b4 100644 --- a/src/service/grpcweb.ts +++ b/src/service/grpcweb.ts @@ -204,7 +204,7 @@ function generateTypescriptDefinition(fileDescriptor: FileDescriptorProto, expor printer.printLn(`export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }`); printer.printLn(`export type Status = { details: string, code: number; metadata: grpc.Metadata }`); - printer.printLn(`export type ServiceClientOptions = { transport: grpc.TransportConstructor }`); + printer.printLn(`export type ServiceClientOptions = { transport: grpc.TransportConstructor; debug?: boolean }`); printer.printEmptyLn(); printer.printLn(`interface ResponseStream {`); printer.printIndentedLn(`cancel(): void;`); @@ -315,6 +315,7 @@ function printUnaryStubMethod(printer: CodePrinter, method: RPCMethodDescriptor) .printLn(`host: this.serviceHost,`) .printLn(`metadata: metadata,`) .printLn(`transport: this.options.transport,`) + .printLn(`debug: this.options.debug,`) .printLn(`onEnd: function (response) {`) .indent().printLn(`if (callback) {`) .indent().printLn(`if (response.status !== grpc.Code.OK) {`) @@ -341,6 +342,7 @@ function printServerStreamStubMethod(printer: CodePrinter, method: RPCMethodDesc .printLn(`host: this.serviceHost,`) .printLn(`metadata: metadata,`) .printLn(`transport: this.options.transport,`) + .printLn(`debug: this.options.debug,`) .printLn(`onMessage: function (responseMessage) {`) .indent().printLn(`listeners.data.forEach(function (handler) {`) .indent().printLn(`handler(responseMessage);`) diff --git a/test/integration/service/grpcweb.ts b/test/integration/service/grpcweb.ts index c122defb..e1f56865 100644 --- a/test/integration/service/grpcweb.ts +++ b/test/integration/service/grpcweb.ts @@ -30,8 +30,8 @@ describe("service/grpc-web", () => { }); it("should generate service definition files for protos that have no service definitions", () => { - assert.isTrue(existsSync(resolve(__dirname, "../../../examples/generated/examplecom/empty_message_no_service_pb_service.d.ts"))); - assert.isTrue(existsSync(resolve(__dirname, "../../../examples/generated/examplecom/empty_message_no_service_pb_service.js"))); + assert.isTrue(existsSync(resolve(__dirname, "../../../examples/generated/proto/examplecom/empty_message_no_service_pb_service.d.ts"))); + assert.isTrue(existsSync(resolve(__dirname, "../../../examples/generated/proto/examplecom/empty_message_no_service_pb_service.js"))); }); it("should not output imports for namespaces that are not used in the service definition", () => {