ts-proto 1.109.1 → 1.110.0
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/CHANGELOG.md +7 -0
- package/README.markdown +2 -0
- package/build/generate-services.js +4 -0
- package/build/options.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.110.0](https://github.com/stephenh/ts-proto/compare/v1.109.1...v1.110.0) (2022-03-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add generic metadata parameter to the generic service definition interface. ([#530](https://github.com/stephenh/ts-proto/issues/530)) ([0f5525a](https://github.com/stephenh/ts-proto/commit/0f5525ade80e7b69889dfd091a458e21bb14a265))
|
|
7
|
+
|
|
1
8
|
## [1.109.1](https://github.com/stephenh/ts-proto/compare/v1.109.0...v1.109.1) (2022-03-13)
|
|
2
9
|
|
|
3
10
|
|
package/README.markdown
CHANGED
|
@@ -362,6 +362,8 @@ Generated code will be placed in the Gradle build directory.
|
|
|
362
362
|
|
|
363
363
|
- With `--ts_proto_opt=outputServices=generic-definitions`, ts-proto will output generic (framework-agnostic) service definitions. These definitions contain descriptors for each method with links to request and response types, which allows to generate server and client stubs at runtime, and also generate strong types for them at compile time. An example of a library that uses this approach is [nice-grpc](https://github.com/deeplay-io/nice-grpc).
|
|
364
364
|
|
|
365
|
+
- With `--ts_proto_opt=metadataType=Foo@./some-file`, ts-proto add a generic (framework-agnostic) metadata field to the generic service definition.
|
|
366
|
+
|
|
365
367
|
- With `--ts_proto_opt=outputServices=generic-definitions,outputServices=default`, ts-proto will output both generic definitions and interfaces. This is useful if you want to rely on the interfaces, but also have some reflection capabilities at runtime.
|
|
366
368
|
|
|
367
369
|
- With `--ts_proto_opt=outputServices=false`, or `=none`, ts-proto will output NO service definitions.
|
|
@@ -52,6 +52,10 @@ function generateService(ctx, fileDesc, sourceInfo, serviceDesc) {
|
|
|
52
52
|
const q = options.addNestjsRestParameter ? '' : '?';
|
|
53
53
|
params.push(ts_poet_1.code `metadata${q}: ${Metadata}`);
|
|
54
54
|
}
|
|
55
|
+
else if (options.metadataType) {
|
|
56
|
+
const Metadata = ts_poet_1.imp(options.metadataType);
|
|
57
|
+
params.push(ts_poet_1.code `metadata?: ${Metadata}`);
|
|
58
|
+
}
|
|
55
59
|
if (options.addNestjsRestParameter) {
|
|
56
60
|
params.push(ts_poet_1.code `...rest: any`);
|
|
57
61
|
}
|
package/build/options.js
CHANGED