ts-proto 1.140.0 → 1.141.1

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.
@@ -65,8 +65,8 @@ function generateRpcMethod(ctx, serviceDesc, methodDesc) {
65
65
  return this.rpc.${method}(
66
66
  ${methodDescName(serviceDesc, methodDesc)},
67
67
  ${requestMessage}.fromPartial(request),
68
- ${useAbortSignal ? "abortSignal," : ""}
69
68
  metadata,
69
+ ${useAbortSignal ? "abortSignal," : ""}
70
70
  );
71
71
  }
72
72
  `;
package/build/main.js CHANGED
@@ -82,7 +82,9 @@ function generateFile(ctx, fileDesc) {
82
82
  const fullTypeName = (0, utils_1.maybePrefixPackage)(fileDesc, fullProtoTypeName);
83
83
  const outputWrapAndUnwrap = (0, generate_struct_wrappers_1.isWrapperType)(fullTypeName);
84
84
  // Only decode, fromPartial, and wrap use the createBase method
85
- if (options.outputEncodeMethods || options.outputPartialMethods || outputWrapAndUnwrap) {
85
+ if ((options.outputEncodeMethods && options.outputEncodeMethods !== "encode-no-creation") ||
86
+ options.outputPartialMethods ||
87
+ outputWrapAndUnwrap) {
86
88
  chunks.push(generateBaseInstanceFactory(ctx, fullName, message, fullTypeName));
87
89
  }
88
90
  const staticMembers = [];
@@ -90,8 +92,14 @@ function generateFile(ctx, fileDesc) {
90
92
  staticMembers.push((0, ts_poet_1.code) `$type: '${fullTypeName}' as const`);
91
93
  }
92
94
  if (options.outputEncodeMethods) {
93
- staticMembers.push(generateEncode(ctx, fullName, message));
94
- staticMembers.push(generateDecode(ctx, fullName, message));
95
+ if (options.outputEncodeMethods === true ||
96
+ options.outputEncodeMethods === "encode-only" ||
97
+ options.outputEncodeMethods === "encode-no-creation") {
98
+ staticMembers.push(generateEncode(ctx, fullName, message));
99
+ }
100
+ if (options.outputEncodeMethods === true || options.outputEncodeMethods === "decode-only") {
101
+ staticMembers.push(generateDecode(ctx, fullName, message));
102
+ }
95
103
  }
96
104
  if (options.useAsyncIterable) {
97
105
  staticMembers.push((0, generate_async_iterable_1.generateEncodeTransform)(fullName));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-proto",
3
- "version": "1.140.0",
3
+ "version": "1.141.1",
4
4
  "description": "",
5
5
  "main": "build/plugin.js",
6
6
  "repository": "github:stephenh/ts-proto",