ts-proto 1.147.1 → 1.147.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.markdown CHANGED
@@ -110,7 +110,7 @@ You can also use the official plugin published to the Buf Registry.
110
110
  ```yaml
111
111
  version: v1
112
112
  plugins:
113
- - remote: buf.build/stephenh/plugins/ts-proto
113
+ - plugin: buf.build/community/stephenh-ts-proto
114
114
  out: ../gen/ts
115
115
  opt:
116
116
  - outputServices=...
@@ -278,7 +278,7 @@ function generateRpcType(ctx, hasStreamingMethods) {
278
278
  const maybeAbortSignalParam = options.useAbortSignal ? "abortSignal?: AbortSignal," : "";
279
279
  const methods = [[(0, ts_poet_1.code) `request`, (0, ts_poet_1.code) `Uint8Array`, (0, ts_poet_1.code) `Promise<Uint8Array>`]];
280
280
  if (hasStreamingMethods) {
281
- const observable = (0, types_1.observableType)(ctx);
281
+ const observable = (0, types_1.observableType)(ctx, true);
282
282
  methods.push([(0, ts_poet_1.code) `clientStreamingRequest`, (0, ts_poet_1.code) `${observable}<Uint8Array>`, (0, ts_poet_1.code) `Promise<Uint8Array>`]);
283
283
  methods.push([(0, ts_poet_1.code) `serverStreamingRequest`, (0, ts_poet_1.code) `Uint8Array`, (0, ts_poet_1.code) `${observable}<Uint8Array>`]);
284
284
  methods.push([
package/build/types.js CHANGED
@@ -639,11 +639,16 @@ function rawRequestType(ctx, methodDesc, typeOptions = {}) {
639
639
  return messageToTypeName(ctx, methodDesc.inputType, typeOptions);
640
640
  }
641
641
  exports.rawRequestType = rawRequestType;
642
- function observableType(ctx) {
642
+ function observableType(ctx, asType = false) {
643
643
  if (ctx.options.useAsyncIterable) {
644
644
  return (0, ts_poet_1.code) `AsyncIterable`;
645
645
  }
646
- return (0, ts_poet_1.code) `${(0, ts_poet_1.imp)("Observable@rxjs")}`;
646
+ else if (asType) {
647
+ return (0, ts_poet_1.code) `${(0, ts_poet_1.imp)("t:Observable@rxjs")}`;
648
+ }
649
+ else {
650
+ return (0, ts_poet_1.code) `${(0, ts_poet_1.imp)("Observable@rxjs")}`;
651
+ }
647
652
  }
648
653
  exports.observableType = observableType;
649
654
  function requestType(ctx, methodDesc, partial = false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.147.1",
3
+ "version": "1.147.2",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",