@hodfords/nestjs-grpc-helper 10.0.6 β 10.1.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.
- package/README.md +97 -23
- package/decorators/extend-type.decorator.d.ts +3 -1
- package/decorators/extend-type.decorator.js +1 -2
- package/decorators/extend-type.decorator.js.map +1 -1
- package/decorators/grpc-value.decorator.js +1 -2
- package/decorators/grpc-value.decorator.js.map +1 -1
- package/decorators/microservice.decorator.js +2 -3
- package/decorators/microservice.decorator.js.map +1 -1
- package/decorators/mock.decorator.js +3 -4
- package/decorators/mock.decorator.js.map +1 -1
- package/decorators/property.decorator.js +1 -2
- package/decorators/property.decorator.js.map +1 -1
- package/helpers/api-property.helper.js +1 -2
- package/helpers/api-property.helper.js.map +1 -1
- package/helpers/generate.helper.js +3 -4
- package/helpers/generate.helper.js.map +1 -1
- package/helpers/mock.helper.js +1 -2
- package/helpers/mock.helper.js.map +1 -1
- package/helpers/property.helper.js +5 -6
- package/helpers/property.helper.js.map +1 -1
- package/helpers/proto-type.helper.js +2 -3
- package/helpers/proto-type.helper.js.map +1 -1
- package/package.json +35 -35
- package/type-helpers/intersection-type.helper.js +1 -2
- package/type-helpers/intersection-type.helper.js.map +1 -1
- package/type-helpers/omit-type.helper.js +1 -2
- package/type-helpers/omit-type.helper.js.map +1 -1
- package/type-helpers/partial-type.helper.js +1 -2
- package/type-helpers/partial-type.helper.js.map +1 -1
- package/type-helpers/pick-type.helper.js +1 -2
- package/type-helpers/pick-type.helper.js.map +1 -1
- package/types/mock-option.type.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://opensource.hodfords.uk" target="blank"><img src="https://opensource.hodfords.uk/img/logo.svg" width="320" alt="Hodfords Logo" /></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<b>nestjs-grpc-helper</b> simplifies gRPC integration in NestJS, allowing seamless communication between services. It enables easy setup of gRPC clients and servers, and supports building SDK packages that any service can import and use, ensuring consistent API interaction across your microservices architecture.
|
|
7
|
+
</p>
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
## Pre-Installation π§
|
|
10
|
+
|
|
11
|
+
Before using nestjs-grpc-helper, you'll need to install the necessary gRPC dependencies. Follow
|
|
12
|
+
[the official NestJS documentation](https://docs.nestjs.com/microservices/grpc) for gRPC setup by installing the required packages:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @grpc/grpc-js @grpc/proto-loader --save
|
|
8
16
|
```
|
|
9
17
|
|
|
10
18
|
## Installation π€
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
Install the `nestjs-grpc-helper` package with:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
13
23
|
npm install @hodfords/nestjs-grpc-helper --save
|
|
14
24
|
```
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
Next, automatically generate the proto file and include it in main.ts before starting the application:
|
|
27
|
+
|
|
17
28
|
```typescript
|
|
18
29
|
import { generateProtoService } from '@hodfords/nestjs-grpc-helper';
|
|
19
30
|
|
|
20
31
|
generateProtoService(camelCase(env.APP_NAME), env.ROOT_PATH + '/../');
|
|
21
32
|
```
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
## Usage π
|
|
35
|
+
|
|
36
|
+
### Creating microservices
|
|
37
|
+
|
|
38
|
+
Create microservices using the `@GrpcMicroservice` decorator, similar to how you would use a Controller. Ensure that the response adheres to the [nestjs-response](https://www.npmjs.com/package/@hodfords/nestjs-response) rules:
|
|
25
39
|
|
|
26
40
|
```typescript
|
|
27
41
|
@GrpcMicroservice()
|
|
28
42
|
export class UserMicroservice {
|
|
29
|
-
constructor(private userService: UserService) {
|
|
30
|
-
}
|
|
43
|
+
constructor(private userService: UserService) {}
|
|
31
44
|
|
|
32
45
|
@GrpcAction('Get user by id')
|
|
33
46
|
@ResponseModel(UserResponse)
|
|
@@ -37,9 +50,62 @@ export class UserMicroservice {
|
|
|
37
50
|
}
|
|
38
51
|
```
|
|
39
52
|
|
|
53
|
+
### Create SDK
|
|
54
|
+
|
|
55
|
+
To generate a TypeScript SDK for your gRPC services, use the following command:
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
npm run wz-command make-sdk <package-name> <folder>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### What this command does
|
|
62
|
+
|
|
63
|
+
This command will:
|
|
64
|
+
|
|
65
|
+
1. **Collect all request and response types**: It gathers all `@GrpcValue` request and response types from your project.
|
|
66
|
+
2. **Generate proto file**: Automatically generates the necessary proto files based on the collected types.
|
|
67
|
+
3. **Create JavaScript Package**: Packages the generated code into a JavaScript SDK. The SDK will be published using the name and version specified in your package.json, making it available for other services to import and use. The arguments, response structure, and method names remain consistent with the definitions in your gRPC service, ensuring seamless integration and functionality across services.
|
|
68
|
+
|
|
69
|
+
### SDK usage
|
|
70
|
+
|
|
71
|
+
After publishing the SDK, other services can easily integrate it. Hereβs an example of how to use the generated SDK
|
|
72
|
+
|
|
73
|
+
1. **Import the sdk package**
|
|
74
|
+
|
|
75
|
+
2. **Register the microservice module**: Configure the microservice in `AppModule` with the appropriate gRPC URL and timeout settings.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
UserModule.register({
|
|
79
|
+
url: env.GRPC_URL,
|
|
80
|
+
timeout: 5000
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. **Use the SDK in another service**: Import the SDK and use it to interact with your gRPC services.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
export class OtherService {
|
|
88
|
+
constructor(private userMicroservice: UserMicroservice) {}
|
|
89
|
+
|
|
90
|
+
async doTask(userId: string): Promise<void> {
|
|
91
|
+
const user = await this.userMicroservice.findUserById({ id: userId });
|
|
92
|
+
// Process user information as needed
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
In this example, `OtherService` uses the `UserMicroservice` class from the SDK to call the `findUserById` method.
|
|
98
|
+
|
|
40
99
|
### Mock response
|
|
41
100
|
|
|
42
|
-
|
|
101
|
+
To effectively generate and handle mock data in your application, you can use the `@MockMethod`, `@MockSample`, and `@MockNested` decorators.
|
|
102
|
+
|
|
103
|
+
##### Generate dynamic data with `@MockMethod`
|
|
104
|
+
|
|
105
|
+
Use `@MockMethod` to apply Faker methods for generating random values.
|
|
106
|
+
|
|
107
|
+
For example, to create a random string of 10 characters
|
|
108
|
+
|
|
43
109
|
```typescript
|
|
44
110
|
@Property({ type: String, required: false })
|
|
45
111
|
@MockMethod('faker.datatype.string', [10])
|
|
@@ -47,7 +113,12 @@ Use faker as a method: `MockMethod`
|
|
|
47
113
|
name: string;
|
|
48
114
|
```
|
|
49
115
|
|
|
50
|
-
|
|
116
|
+
##### Set fixed values with `@MockSample`
|
|
117
|
+
|
|
118
|
+
If you need to set a fixed value for a property, use the `@MockSample` decorator. This is useful for enumerations or other predefined values.
|
|
119
|
+
|
|
120
|
+
For example, to set a fixed user type
|
|
121
|
+
|
|
51
122
|
```typescript
|
|
52
123
|
@Property({
|
|
53
124
|
type: String,
|
|
@@ -59,7 +130,12 @@ Use fixed values: `MockSample`
|
|
|
59
130
|
type: UserTypeEnum;
|
|
60
131
|
```
|
|
61
132
|
|
|
62
|
-
|
|
133
|
+
##### Generate nested data
|
|
134
|
+
|
|
135
|
+
Use `@MockNested` to generate mock data for nested objects or arrays of nested objects.
|
|
136
|
+
|
|
137
|
+
For example, to create an array of 5 nested objects
|
|
138
|
+
|
|
63
139
|
```typescript
|
|
64
140
|
@Property({ type: UserResponse, isArray: true })
|
|
65
141
|
@IsArray()
|
|
@@ -69,21 +145,19 @@ Specifies the number of elements to return: `MockNested`
|
|
|
69
145
|
users: UserResponse[];
|
|
70
146
|
```
|
|
71
147
|
|
|
72
|
-
|
|
148
|
+
### Document for GRPC
|
|
73
149
|
|
|
74
|
-
|
|
75
|
-
```shell
|
|
76
|
-
npm run wz-command make-sdk <package-name> <folder>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Document for GRPC
|
|
80
|
-
You can go to `http://xyz/microservice-documents` to check and try to call the grpc method
|
|
150
|
+
You can go to `http://xyz/microservice-documents` to check and try to call the gRPC method
|
|
81
151
|
|
|
82
152
|
```typescript
|
|
83
153
|
MicroserviceDocumentModule.register({
|
|
84
154
|
isEnable: true,
|
|
85
155
|
prefix: <app-prefix>,
|
|
86
|
-
packageName: camelCase(<package-name
|
|
156
|
+
packageName: camelCase(<package-name>),
|
|
87
157
|
clientOptions: { ...microserviceGrpcConfig, customClass: CustomGrpcClient, transport: undefined }
|
|
88
158
|
})
|
|
89
159
|
```
|
|
160
|
+
|
|
161
|
+
## License π
|
|
162
|
+
|
|
163
|
+
This project is licensed under the MIT License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExtendType =
|
|
3
|
+
exports.ExtendType = ExtendType;
|
|
4
4
|
const property_storage_1 = require("../storages/property.storage");
|
|
5
5
|
const extendClassNames = ['IntersectionTypeClass', 'PickTypeClass', 'OmitTypeClass', 'PartialTypeClass'];
|
|
6
6
|
function ExtendType() {
|
|
@@ -22,5 +22,4 @@ function ExtendType() {
|
|
|
22
22
|
return constructor;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.ExtendType = ExtendType;
|
|
26
25
|
//# sourceMappingURL=extend-type.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extend-type.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/extend-type.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extend-type.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/extend-type.decorator.ts"],"names":[],"mappings":";;AAIA,gCAmBC;AAvBD,mEAAwE;AAExE,MAAM,gBAAgB,GAAG,CAAC,uBAAuB,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC;AAEzG,SAAgB,UAAU;IACtB,OAAO,SAAS,cAAc,CAAyC,WAAc;QACjF,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QACxD,IAAI,aAAa,GAAG,kCAAe,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAC3D,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3E,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,CAAC;QACL,CAAC;QACD,kCAAe,CAAC,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAChD,0BAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,kCAAe,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACpC,0BAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GrpcValue =
|
|
3
|
+
exports.GrpcValue = GrpcValue;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
function GrpcValue() {
|
|
6
6
|
return function (target, propertyKey, parameterIndex) {
|
|
@@ -8,5 +8,4 @@ function GrpcValue() {
|
|
|
8
8
|
(0, common_1.Body)()(target, propertyKey, parameterIndex);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
exports.GrpcValue = GrpcValue;
|
|
12
11
|
//# sourceMappingURL=grpc-value.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-value.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/grpc-value.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grpc-value.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/grpc-value.decorator.ts"],"names":[],"mappings":";;AAEA,8BAKC;AAPD,2CAAsC;AAEtC,SAAgB,SAAS;IACrB,OAAO,UAAU,MAAc,EAAE,WAA4B,EAAE,cAAsB;QACjF,OAAO,CAAC,cAAc,CAAC,sBAAsB,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACpF,IAAA,aAAI,GAAE,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAChD,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RegisterGrpcMicroservice = RegisterGrpcMicroservice;
|
|
4
|
+
exports.GrpcAction = GrpcAction;
|
|
4
5
|
const microservice_storage_1 = require("../storages/microservice.storage");
|
|
5
6
|
const microservices_1 = require("@nestjs/microservices");
|
|
6
7
|
function RegisterGrpcMicroservice(description) {
|
|
@@ -10,7 +11,6 @@ function RegisterGrpcMicroservice(description) {
|
|
|
10
11
|
return constructor;
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
|
-
exports.RegisterGrpcMicroservice = RegisterGrpcMicroservice;
|
|
14
14
|
function GrpcAction(description) {
|
|
15
15
|
return function (target, propertyKey, descriptor) {
|
|
16
16
|
Reflect.defineMetadata('grpc:method', true, target, propertyKey);
|
|
@@ -18,5 +18,4 @@ function GrpcAction(description) {
|
|
|
18
18
|
(0, microservices_1.GrpcMethod)(target.constructor.name, propertyKey)(target, propertyKey, descriptor);
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
exports.GrpcAction = GrpcAction;
|
|
22
21
|
//# sourceMappingURL=microservice.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microservice.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/microservice.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"microservice.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/microservice.decorator.ts"],"names":[],"mappings":";;AAGA,4DAMC;AAED,gCAMC;AAjBD,2EAAuE;AACvE,yDAAmD;AAEnD,SAAgB,wBAAwB,CAAC,WAAoB;IACzD,OAAO,CAAC,WAAqB,EAAE,EAAE;QAC7B,0CAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACtC,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QACrE,OAAO,WAAW,CAAC;IACvB,CAAC,CAAC;AACN,CAAC;AAED,SAAgB,UAAU,CAAC,WAAoB;IAC3C,OAAO,UAAU,MAAgB,EAAE,WAAmB,EAAE,UAA8B;QAClF,OAAO,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACjE,OAAO,CAAC,cAAc,CAAC,kBAAkB,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAC7E,IAAA,0BAAU,EAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IACtF,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MockMethod = MockMethod;
|
|
4
|
+
exports.MockNested = MockNested;
|
|
5
|
+
exports.MockSample = MockSample;
|
|
4
6
|
const property_helper_1 = require("../helpers/property.helper");
|
|
5
7
|
function MockMethod(method, args) {
|
|
6
8
|
return function (target, propertyName) {
|
|
@@ -12,7 +14,6 @@ function MockMethod(method, args) {
|
|
|
12
14
|
});
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
|
-
exports.MockMethod = MockMethod;
|
|
16
17
|
function MockNested(maxSize = 1) {
|
|
17
18
|
return function (target, propertyName) {
|
|
18
19
|
(0, property_helper_1.addPropertyToStorage)(target.constructor, propertyName, {
|
|
@@ -22,7 +23,6 @@ function MockNested(maxSize = 1) {
|
|
|
22
23
|
});
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
|
-
exports.MockNested = MockNested;
|
|
26
26
|
function MockSample(sample) {
|
|
27
27
|
return function (target, propertyName) {
|
|
28
28
|
(0, property_helper_1.addPropertyToStorage)(target.constructor, propertyName, {
|
|
@@ -30,5 +30,4 @@ function MockSample(sample) {
|
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
exports.MockSample = MockSample;
|
|
34
33
|
//# sourceMappingURL=mock.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/mock.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/mock.decorator.ts"],"names":[],"mappings":";;AAGA,gCASC;AAED,gCAQC;AAED,gCAMC;AA7BD,gEAAkE;AAElE,SAAgB,UAAU,CAAC,MAAsB,EAAE,IAAY;IAC3D,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,sCAAoB,EAAC,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE;YACnD,IAAI,EAAE;gBACF,MAAM;gBACN,IAAI,EAAE,IAAI,IAAI,EAAE;aACnB;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED,SAAgB,UAAU,CAAC,UAAkB,CAAC;IAC1C,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,sCAAoB,EAAC,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE;YACnD,IAAI,EAAE;gBACF,aAAa,EAAE,OAAO;aACzB;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED,SAAgB,UAAU,CAAC,MAAW;IAClC,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,sCAAoB,EAAC,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE;YACnD,IAAI,EAAE,EAAE,MAAM,EAAE;SACnB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Property =
|
|
3
|
+
exports.Property = Property;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const proto_type_helper_1 = require("../helpers/proto-type.helper");
|
|
6
6
|
const property_helper_1 = require("../helpers/property.helper");
|
|
@@ -17,5 +17,4 @@ function Property(option) {
|
|
|
17
17
|
(0, property_helper_1.addPropertyToStorage)(target.constructor, propertyName, option);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.Property = Property;
|
|
21
20
|
//# sourceMappingURL=property.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/property.decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property.decorator.js","sourceRoot":"","sources":["../../../libs/decorators/property.decorator.ts"],"names":[],"mappings":";;AAQA,4BAcC;AAtBD,6CAA8C;AAC9C,oEAAyE;AACzE,gEAAkE;AAMlE,SAAgB,QAAQ,CAAC,MAA0B;IAC/C,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,MAAM,UAAU,GAAG,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAA,6CAAyB,EAAC,MAAM,CAAC,EAAE,CAAC;QAC1E,IAAA,qBAAW,EAAC,UAAU,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAE9C,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC;YACjD,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjD,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;QACzB,CAAC;QAED,IAAA,sCAAoB,EAAC,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEnumProperty =
|
|
3
|
+
exports.isEnumProperty = isEnumProperty;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
function isEnumProperty(options) {
|
|
6
6
|
return !(0, lodash_1.isEmpty)(options.enum) && !(0, lodash_1.isEmpty)(options.enumName);
|
|
7
7
|
}
|
|
8
|
-
exports.isEnumProperty = isEnumProperty;
|
|
9
8
|
//# sourceMappingURL=api-property.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-property.helper.js","sourceRoot":"","sources":["../../../libs/helpers/api-property.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-property.helper.js","sourceRoot":"","sources":["../../../libs/helpers/api-property.helper.ts"],"names":[],"mappings":";;AAGA,wCAEC;AAJD,mCAAiC;AAEjC,SAAgB,cAAc,CAAC,OAA2B;IACtD,OAAO,CAAC,IAAA,gBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAA,gBAAO,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateSdk = generateSdk;
|
|
4
|
+
exports.generateProtoService = generateProtoService;
|
|
5
|
+
exports.generateDocumentService = generateDocumentService;
|
|
4
6
|
const generate_microservice_service_1 = require("../services/generate-microservice.service");
|
|
5
7
|
const generate_proto_service_1 = require("../services/generate-proto.service");
|
|
6
8
|
const generate_document_service_1 = require("../services/generate-document.service");
|
|
7
9
|
function generateSdk(packageName, dirPath) {
|
|
8
10
|
new generate_microservice_service_1.GenerateMicroserviceService(packageName, dirPath).generate();
|
|
9
11
|
}
|
|
10
|
-
exports.generateSdk = generateSdk;
|
|
11
12
|
function generateProtoService(packageName, dirPath) {
|
|
12
13
|
new generate_proto_service_1.GenerateProtoService(packageName, dirPath).generate();
|
|
13
14
|
}
|
|
14
|
-
exports.generateProtoService = generateProtoService;
|
|
15
15
|
function generateDocumentService(packageName) {
|
|
16
16
|
return new generate_document_service_1.GenerateDocumentService(packageName).generate();
|
|
17
17
|
}
|
|
18
|
-
exports.generateDocumentService = generateDocumentService;
|
|
19
18
|
//# sourceMappingURL=generate.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.helper.js","sourceRoot":"","sources":["../../../libs/helpers/generate.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.helper.js","sourceRoot":"","sources":["../../../libs/helpers/generate.helper.ts"],"names":[],"mappings":";;AAIA,kCAEC;AAED,oDAEC;AAED,0DAEC;AAdD,6FAAwF;AACxF,+EAA0E;AAC1E,qFAAgF;AAEhF,SAAgB,WAAW,CAAC,WAAmB,EAAE,OAAe;IAC5D,IAAI,2DAA2B,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACrE,CAAC;AAED,SAAgB,oBAAoB,CAAC,WAAmB,EAAE,OAAe;IACrE,IAAI,6CAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC9D,CAAC;AAED,SAAgB,uBAAuB,CAAC,WAAmB;IACvD,OAAO,IAAI,mDAAuB,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC/D,CAAC"}
|
package/helpers/mock.helper.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.sample =
|
|
26
|
+
exports.sample = sample;
|
|
27
27
|
const property_helper_1 = require("./property.helper");
|
|
28
28
|
const class_transformer_1 = require("class-transformer");
|
|
29
29
|
const faker = __importStar(require("faker"));
|
|
@@ -57,5 +57,4 @@ function sample(dto) {
|
|
|
57
57
|
}
|
|
58
58
|
return (0, class_transformer_1.plainToInstance)(dto, data);
|
|
59
59
|
}
|
|
60
|
-
exports.sample = sample;
|
|
61
60
|
//# sourceMappingURL=mock.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.helper.js","sourceRoot":"","sources":["../../../libs/helpers/mock.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock.helper.js","sourceRoot":"","sources":["../../../libs/helpers/mock.helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,wBAWC;AAnCD,uDAAyD;AACzD,yDAAoD;AACpD,6CAA+B;AAC/B,mCAA6B;AAG7B,SAAS,OAAO,CAAC,MAA0B;IACvC,MAAM,EAAE,IAA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,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getClassHasProperties = getClassHasProperties;
|
|
4
|
+
exports.addPropertyToStorage = addPropertyToStorage;
|
|
5
|
+
exports.extractProperties = extractProperties;
|
|
6
|
+
exports.getPropertiesOfClass = getPropertiesOfClass;
|
|
7
|
+
exports.traverseSDKProperties = traverseSDKProperties;
|
|
4
8
|
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
9
|
const property_storage_1 = require("../storages/property.storage");
|
|
6
10
|
const lodash_1 = require("lodash");
|
|
7
11
|
function getClassHasProperties() {
|
|
8
12
|
return property_storage_1.propertyStorage.keys();
|
|
9
13
|
}
|
|
10
|
-
exports.getClassHasProperties = getClassHasProperties;
|
|
11
14
|
function addPropertyToStorage(constructor, propertyName, option) {
|
|
12
15
|
if (property_storage_1.propertyStorage.has(constructor)) {
|
|
13
16
|
const properties = property_storage_1.propertyStorage.get(constructor);
|
|
@@ -34,7 +37,6 @@ function addPropertyToStorage(constructor, propertyName, option) {
|
|
|
34
37
|
property_storage_1.sdkDtos.add(constructor);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
exports.addPropertyToStorage = addPropertyToStorage;
|
|
38
40
|
function removeOverridableProperties(validProperties, overridableProperties) {
|
|
39
41
|
return (0, lodash_1.differenceBy)(validProperties, overridableProperties, (item) => item.name);
|
|
40
42
|
}
|
|
@@ -55,7 +57,6 @@ function extractProperties() {
|
|
|
55
57
|
}
|
|
56
58
|
return dtoWithProperties;
|
|
57
59
|
}
|
|
58
|
-
exports.extractProperties = extractProperties;
|
|
59
60
|
function getPropertiesOfClass(constructor, properties = []) {
|
|
60
61
|
if (!property_storage_1.propertyStorage.get(constructor)) {
|
|
61
62
|
return properties;
|
|
@@ -72,7 +73,6 @@ function getPropertiesOfClass(constructor, properties = []) {
|
|
|
72
73
|
}
|
|
73
74
|
return properties;
|
|
74
75
|
}
|
|
75
|
-
exports.getPropertiesOfClass = getPropertiesOfClass;
|
|
76
76
|
function traverseSDKProperties() {
|
|
77
77
|
const queue = Array.from(property_storage_1.sdkDtos.keys());
|
|
78
78
|
const auditor = new Set(property_storage_1.sdkDtos);
|
|
@@ -93,5 +93,4 @@ function traverseSDKProperties() {
|
|
|
93
93
|
}
|
|
94
94
|
return responses.reverse();
|
|
95
95
|
}
|
|
96
|
-
exports.traverseSDKProperties = traverseSDKProperties;
|
|
97
96
|
//# sourceMappingURL=property.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.helper.js","sourceRoot":"","sources":["../../../libs/helpers/property.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"property.helper.js","sourceRoot":"","sources":["../../../libs/helpers/property.helper.ts"],"names":[],"mappings":";;AAKA,sDAEC;AAED,oDAwBC;AASD,8CAoBC;AAED,oDAeC;AAED,sDAqBC;AAtGD,oEAA+D;AAC/D,mEAAwE;AAExE,mCAAsC;AAEtC,SAAgB,qBAAqB;IACjC,OAAO,kCAAe,CAAC,IAAI,EAAE,CAAC;AAClC,CAAC;AAED,SAAgB,oBAAoB,CAAC,WAAqB,EAAE,YAAoB,EAAE,MAA0B;IACxG,IAAI,kCAAe,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;QACtE,IAAI,QAAQ,EAAE,CAAC;YACX,QAAQ,CAAC,MAAM,GAAG,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACxD,CAAC;aAAM,CAAC;YACJ,UAAU,CAA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AAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,0BAAO,CAAC,CAAC;IACjC,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC7C,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAClC,IAAI,IAAA,yBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC9E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC5B,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBACxB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBAC7B,CAAC;YACL,CAAC;QACL,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertProtoTypeToSwagger = convertProtoTypeToSwagger;
|
|
4
|
+
exports.convertProtoTypeToTypescript = convertProtoTypeToTypescript;
|
|
4
5
|
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
6
|
const api_property_helper_1 = require("./api-property.helper");
|
|
6
7
|
function convertProtoTypeToSwagger(option) {
|
|
@@ -9,7 +10,6 @@ function convertProtoTypeToSwagger(option) {
|
|
|
9
10
|
}
|
|
10
11
|
return convertProtoTypeToTypescript(option, false);
|
|
11
12
|
}
|
|
12
|
-
exports.convertProtoTypeToSwagger = convertProtoTypeToSwagger;
|
|
13
13
|
function convertProtoTypeToTypescript(option, isGenerate) {
|
|
14
14
|
let type = option.type;
|
|
15
15
|
if ((0, shared_utils_1.isFunction)(type)) {
|
|
@@ -32,5 +32,4 @@ function convertProtoTypeToTypescript(option, isGenerate) {
|
|
|
32
32
|
}
|
|
33
33
|
return type.toString();
|
|
34
34
|
}
|
|
35
|
-
exports.convertProtoTypeToTypescript = convertProtoTypeToTypescript;
|
|
36
35
|
//# sourceMappingURL=proto-type.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proto-type.helper.js","sourceRoot":"","sources":["../../../libs/helpers/proto-type.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proto-type.helper.js","sourceRoot":"","sources":["../../../libs/helpers/proto-type.helper.ts"],"names":[],"mappings":";;AAIA,8DAKC;AAED,oEAyBC;AApCD,oEAAyE;AAEzE,+DAAuD;AAEvD,SAAgB,yBAAyB,CAAC,MAA0B;IAChE,IAAI,IAAA,yBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,IAAI,CAAC;IACvB,CAAC;IACD,OAAO,4BAA4B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,4BAA4B,CAAC,MAA0B,EAAE,UAAoB;IACzF,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACvB,IAAI,IAAA,yBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,UAAU,EAAE,CAAC;YACrC,OAAQ,MAAM,CAAC,IAAY,EAAE,CAAC,IAAI,CAAC;QACvC,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,IAAA,oCAAc,EAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAI,IAAA,uBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC7G,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,IAAI,GAAG,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC;YACxB,IAAI,GAAG,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hodfords/nestjs-grpc-helper",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "10.1.1",
|
|
4
|
+
"description": "A utility for simplifying gRPC integration and communication in NestJS applications",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
24
24
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
25
25
|
"wz-command": "wz-command",
|
|
26
|
-
"prepare": "is-ci || husky
|
|
26
|
+
"prepare": "is-ci || husky",
|
|
27
27
|
"version": "auto-changelog && git add CHANGELOG.md",
|
|
28
28
|
"release:patch": "git add CHANGELOG.md && npm version patch --tag-version-prefix='' -f -m 'chore: release to %s'",
|
|
29
29
|
"release:push": "git push --no-verify && git push --tags --no-verify",
|
|
@@ -32,53 +32,53 @@
|
|
|
32
32
|
"lint-staged": "lint-staged"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@hodfords/nestjs-cls-translation": "10.
|
|
36
|
-
"@hodfords/nestjs-command": "10.
|
|
37
|
-
"@hodfords/nestjs-response": "10.
|
|
38
|
-
"@grpc/grpc-js": "1.
|
|
39
|
-
"@grpc/proto-loader": "0.7.
|
|
40
|
-
"@nestjs/cli": "10.
|
|
41
|
-
"@nestjs/common": "10.
|
|
42
|
-
"@nestjs/core": "10.
|
|
43
|
-
"@nestjs/microservices": "10.
|
|
44
|
-
"@nestjs/platform-express": "10.
|
|
45
|
-
"@nestjs/schematics": "10.1.
|
|
46
|
-
"@nestjs/serve-static": "4.0.
|
|
47
|
-
"@nestjs/swagger": "7.
|
|
48
|
-
"@nestjs/testing": "10.
|
|
35
|
+
"@hodfords/nestjs-cls-translation": "10.1.0",
|
|
36
|
+
"@hodfords/nestjs-command": "10.1.0",
|
|
37
|
+
"@hodfords/nestjs-response": "10.2.1",
|
|
38
|
+
"@grpc/grpc-js": "1.11.1",
|
|
39
|
+
"@grpc/proto-loader": "0.7.13",
|
|
40
|
+
"@nestjs/cli": "10.4.4",
|
|
41
|
+
"@nestjs/common": "10.4.1",
|
|
42
|
+
"@nestjs/core": "10.4.1",
|
|
43
|
+
"@nestjs/microservices": "10.4.1",
|
|
44
|
+
"@nestjs/platform-express": "10.4.1",
|
|
45
|
+
"@nestjs/schematics": "10.1.4",
|
|
46
|
+
"@nestjs/serve-static": "4.0.2",
|
|
47
|
+
"@nestjs/swagger": "7.4.0",
|
|
48
|
+
"@nestjs/testing": "10.4.1",
|
|
49
49
|
"@nestjs/typeorm": "10.0.2",
|
|
50
50
|
"@types/express": "4.17.21",
|
|
51
|
-
"@types/faker": "
|
|
51
|
+
"@types/faker": "6.6.9",
|
|
52
52
|
"@types/jest": "29.5.12",
|
|
53
|
-
"@types/lodash": "4.
|
|
54
|
-
"@types/node": "
|
|
53
|
+
"@types/lodash": "4.17.7",
|
|
54
|
+
"@types/node": "22.5.0",
|
|
55
55
|
"@types/supertest": "6.0.2",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "
|
|
57
|
-
"@typescript-eslint/parser": "
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "8.3.0",
|
|
57
|
+
"@typescript-eslint/parser": "8.3.0",
|
|
58
58
|
"auto-changelog": "2.4.0",
|
|
59
59
|
"class-transformer": "0.5.1",
|
|
60
|
-
"class-validator": "0.14.
|
|
61
|
-
"cspell": "8.
|
|
62
|
-
"eslint": "8.
|
|
60
|
+
"class-validator": "0.14.1",
|
|
61
|
+
"cspell": "8.14.2",
|
|
62
|
+
"eslint": "8.57.0",
|
|
63
63
|
"eslint-config-prettier": "9.1.0",
|
|
64
|
-
"eslint-plugin-prettier": "5.1
|
|
65
|
-
"faker": "
|
|
66
|
-
"husky": "9.
|
|
64
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
65
|
+
"faker": "6.6.6",
|
|
66
|
+
"husky": "9.1.5",
|
|
67
67
|
"is-ci": "3.0.1",
|
|
68
68
|
"jest": "29.7.0",
|
|
69
|
-
"lint-staged": "15.2.
|
|
69
|
+
"lint-staged": "15.2.9",
|
|
70
70
|
"lodash": "4.17.21",
|
|
71
|
-
"reflect-metadata": "0.2.
|
|
72
|
-
"rimraf": "
|
|
71
|
+
"reflect-metadata": "0.2.2",
|
|
72
|
+
"rimraf": "6.0.1",
|
|
73
73
|
"rxjs": "7.8.1",
|
|
74
74
|
"source-map-support": "0.5.21",
|
|
75
|
-
"supertest": "
|
|
76
|
-
"ts-jest": "29.
|
|
75
|
+
"supertest": "7.0.0",
|
|
76
|
+
"ts-jest": "29.2.5",
|
|
77
77
|
"ts-loader": "9.5.1",
|
|
78
78
|
"ts-node": "10.9.2",
|
|
79
79
|
"tsconfig-paths": "4.2.0",
|
|
80
|
-
"typeorm": "0.3.
|
|
81
|
-
"typescript": "5.
|
|
80
|
+
"typeorm": "0.3.20",
|
|
81
|
+
"typescript": "5.5.4"
|
|
82
82
|
},
|
|
83
83
|
"jest": {
|
|
84
84
|
"moduleFileExtensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntersectionResponseType =
|
|
3
|
+
exports.IntersectionResponseType = IntersectionResponseType;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const property_storage_1 = require("../storages/property.storage");
|
|
6
6
|
const nestjs_grpc_helper_1 = require("..");
|
|
@@ -16,5 +16,4 @@ function IntersectionResponseType(...classRefs) {
|
|
|
16
16
|
}
|
|
17
17
|
return IntersectionTypeClass;
|
|
18
18
|
}
|
|
19
|
-
exports.IntersectionResponseType = IntersectionResponseType;
|
|
20
19
|
//# sourceMappingURL=intersection-type.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/intersection-type.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intersection-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/intersection-type.helper.ts"],"names":[],"mappings":";;AAaA,4DAYC;AAxBD,6CAAmD;AACnD,mEAA+D;AAC/D,2CAAoE;AAUpE,SAAgB,wBAAwB,CAAmB,GAAG,SAAY;IACtE,MAAM,uBAAuB,GAAQ,IAAA,0BAAgB,EAAC,GAAG,SAAS,CAAC,CAAC;IAEpE,MAAe,qBAAsB,SAAQ,uBAAuB;KAAG;IAEvE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QAC/B,IAAI,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAChC,IAAA,yCAAoB,EAAC,qBAAqB,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAChF,CAAC;IACL,CAAC;IACD,OAAO,qBAAwC,CAAC;AACpD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OmitResponseType =
|
|
3
|
+
exports.OmitResponseType = OmitResponseType;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const property_storage_1 = require("../storages/property.storage");
|
|
6
6
|
const nestjs_grpc_helper_1 = require("..");
|
|
@@ -16,5 +16,4 @@ function OmitResponseType(classRef, keys) {
|
|
|
16
16
|
}
|
|
17
17
|
return OmitTypeClass;
|
|
18
18
|
}
|
|
19
|
-
exports.OmitResponseType = OmitResponseType;
|
|
20
19
|
//# sourceMappingURL=omit-type.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omit-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/omit-type.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"omit-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/omit-type.helper.ts"],"names":[],"mappings":";;AAKA,4CAcC;AAlBD,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartialResponseType =
|
|
3
|
+
exports.PartialResponseType = PartialResponseType;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const property_storage_1 = require("../storages/property.storage");
|
|
6
6
|
const nestjs_grpc_helper_1 = require("..");
|
|
@@ -14,5 +14,4 @@ function PartialResponseType(classRef) {
|
|
|
14
14
|
}
|
|
15
15
|
return PartialTypeClass;
|
|
16
16
|
}
|
|
17
|
-
exports.PartialResponseType = PartialResponseType;
|
|
18
17
|
//# sourceMappingURL=partial-type.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/partial-type.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"partial-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/partial-type.helper.ts"],"names":[],"mappings":";;AAKA,kDAWC;AAfD,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PickResponseType =
|
|
3
|
+
exports.PickResponseType = PickResponseType;
|
|
4
4
|
const swagger_1 = require("@nestjs/swagger");
|
|
5
5
|
const property_helper_1 = require("../helpers/property.helper");
|
|
6
6
|
const property_storage_1 = require("../storages/property.storage");
|
|
@@ -16,5 +16,4 @@ function PickResponseType(classRef, keys) {
|
|
|
16
16
|
}
|
|
17
17
|
return PickTypeClass;
|
|
18
18
|
}
|
|
19
|
-
exports.PickResponseType = PickResponseType;
|
|
20
19
|
//# sourceMappingURL=pick-type.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/pick-type.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pick-type.helper.js","sourceRoot":"","sources":["../../../libs/type-helpers/pick-type.helper.ts"],"names":[],"mappings":";;AAKA,4CAgBC;AApBD,6CAA2C;AAC3C,gEAAkE;AAClE,mEAA+D;AAE/D,SAAgB,gBAAgB,CAC5B,QAAiB,EACjB,IAAS;IAET,MAAM,gBAAgB,GAAQ,IAAA,kBAAQ,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAEvD,MAAe,aAAc,SAAQ,gBAAgB;KAAG;IAExD,IAAI,UAAU,GAAG,kCAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACrD,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAS,CAAC,EAAE,CAAC;YACpC,IAAA,sCAAoB,EAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACxE,CAAC;IACL,CAAC;IAED,OAAO,aAAqD,CAAC;AACjE,CAAC"}
|