@hodfords/nestjs-grpc-helper 10.2.3 → 10.2.4

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.md CHANGED
@@ -41,6 +41,16 @@ export class UserMicroservice {
41
41
  }
42
42
  ```
43
43
 
44
+ ### Any Type
45
+
46
+ You can use any type if fixed types are not an option. However, since it’s passed as JSON, the performance may not be as optimal as with binary. Consider using binary if performance is a concern.
47
+
48
+ ```typescript
49
+ @Property({ type: 'any', required: false })
50
+ @AnyType()
51
+ data: any;
52
+ ```
53
+
44
54
  ### Create SDK
45
55
 
46
56
  To generate a TypeScript SDK for your gRPC services, use the following command:
@@ -5,7 +5,7 @@ const class_transformer_1 = require("class-transformer");
5
5
  const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
6
6
  function AnyType() {
7
7
  return (0, class_transformer_1.Transform)((object) => {
8
- if (object.options.groups.includes('__sendData')) {
8
+ if (object.options.groups?.includes('__sendData')) {
9
9
  return JSON.stringify(object.value);
10
10
  }
11
11
  if ((0, shared_utils_1.isString)(object.value)) {
@@ -1 +1 @@
1
- {"version":3,"file":"any-type.decorator.js","sourceRoot":"","sources":["../../../lib/decorators/any-type.decorator.ts"],"names":[],"mappings":";;AAGA,0BAUC;AAbD,yDAA8C;AAC9C,oEAA6D;AAE7D,SAAgB,OAAO;IACnB,OAAO,IAAA,6BAAS,EAAC,CAAC,MAAM,EAAE,EAAE;QACxB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,IAAA,uBAAQ,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"any-type.decorator.js","sourceRoot":"","sources":["../../../lib/decorators/any-type.decorator.ts"],"names":[],"mappings":";;AAGA,0BAUC;AAbD,yDAA8C;AAC9C,oEAA6D;AAE7D,SAAgB,OAAO;IACnB,OAAO,IAAA,6BAAS,EAAC,CAAC,MAAM,EAAE,EAAE;QACxB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,IAAA,uBAAQ,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hodfords/nestjs-grpc-helper",
3
- "version": "10.2.3",
3
+ "version": "10.2.4",
4
4
  "description": "A utility for simplifying gRPC integration and communication in NestJS applications",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",