@hodfords/nestjs-grpc-helper 10.0.3 → 10.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hodfords/nestjs-grpc-helper",
3
- "version": "10.0.3",
3
+ "version": "10.0.4",
4
4
  "description": "Grpc helper for nestjs",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -44,7 +44,7 @@
44
44
  "@nestjs/platform-express": "10.3.3",
45
45
  "@nestjs/schematics": "10.1.1",
46
46
  "@nestjs/serve-static": "4.0.1",
47
- "@nestjs/swagger": "7.3.0",
47
+ "@nestjs/swagger": "7.3.1",
48
48
  "@nestjs/testing": "10.3.3",
49
49
  "@nestjs/typeorm": "10.0.2",
50
50
  "@types/express": "4.17.21",
@@ -0,0 +1,2 @@
1
+ import { Type } from '@nestjs/common';
2
+ export declare function OmitResponseType<T, K extends keyof T>(classRef: Type<T>, keys: readonly K[]): Type<Omit<T, (typeof keys)[number]>>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OmitResponseType = void 0;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const property_storage_1 = require("../storages/property.storage");
6
+ const nestjs_grpc_helper_1 = require("..");
7
+ function OmitResponseType(classRef, keys) {
8
+ const swaggerOmitTypes = (0, swagger_1.OmitType)(classRef, keys);
9
+ class OmitTypeClass extends swaggerOmitTypes {
10
+ }
11
+ let properties = property_storage_1.propertyStorage.get(classRef);
12
+ for (const property of properties) {
13
+ if (!keys.includes(property.name)) {
14
+ (0, nestjs_grpc_helper_1.addPropertyToStorage)(OmitTypeClass, property.name, { ...property.option });
15
+ }
16
+ }
17
+ return OmitTypeClass;
18
+ }
19
+ exports.OmitResponseType = OmitResponseType;
20
+ //# sourceMappingURL=omit-type.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omit-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/omit-type.helper.ts"],"names":[],"mappings":";;;AACA,6CAA2C;AAC3C,mEAA+D;AAC/D,2CAAoE;AAEpE,SAAgB,gBAAgB,CAC5B,QAAiB,EACjB,IAAkB;IAElB,MAAM,gBAAgB,GAAQ,IAAA,kBAAQ,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAEvD,MAAe,aAAc,SAAQ,gBAAgB;KAAG;IACxD,IAAI,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAS,CAAC,EAAE,CAAC;YACrC,IAAA,yCAAoB,EAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/E,CAAC;IACL,CAAC;IACD,OAAO,aAAqD,CAAC;AACjE,CAAC;AAdD,4CAcC"}
@@ -0,0 +1,2 @@
1
+ import { Type } from '@nestjs/common';
2
+ export declare function PartialResponseType<T>(classRef: Type<T>): Type<Partial<T>>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PartialResponseType = void 0;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const property_storage_1 = require("../storages/property.storage");
6
+ const nestjs_grpc_helper_1 = require("..");
7
+ function PartialResponseType(classRef) {
8
+ const swaggerPartialType = (0, swagger_1.PartialType)(classRef);
9
+ class PartialTypeClass extends swaggerPartialType {
10
+ }
11
+ let properties = property_storage_1.propertyStorage.get(classRef);
12
+ for (const property of properties) {
13
+ (0, nestjs_grpc_helper_1.addPropertyToStorage)(PartialTypeClass, property.name, { ...property.option, required: false });
14
+ }
15
+ return PartialTypeClass;
16
+ }
17
+ exports.PartialResponseType = PartialResponseType;
18
+ //# sourceMappingURL=partial-type.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/partial-type.helper.ts"],"names":[],"mappings":";;;AACA,6CAAwD;AACxD,mEAA+D;AAC/D,2CAAoE;AAEpE,SAAgB,mBAAmB,CAAI,QAAiB;IACpD,MAAM,kBAAkB,GAAQ,IAAA,qBAAW,EAAC,QAAQ,CAAC,CAAC;IAEtD,MAAe,gBAAiB,SAAQ,kBAAkB;KAAG;IAE7D,IAAI,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAChC,IAAA,yCAAoB,EAAC,gBAAgB,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,gBAAoC,CAAC;AAChD,CAAC;AAXD,kDAWC"}