@noildm/contracts 1.0.7 → 1.0.8

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.
@@ -0,0 +1,23 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty as Empty1 } from "./google/protobuf/empty";
3
+ export declare const protobufPackage = "test.v1";
4
+ export interface TestRequest {
5
+ testRequest: string;
6
+ }
7
+ export interface TestResponse {
8
+ testResponse: string;
9
+ }
10
+ export interface Empty {
11
+ empty: Empty1 | undefined;
12
+ }
13
+ export declare const TEST_V1_PACKAGE_NAME = "test.v1";
14
+ export interface TestServiceClient {
15
+ test(request: TestRequest): Observable<TestResponse>;
16
+ ping(request: Empty): Observable<Empty>;
17
+ }
18
+ export interface TestServiceController {
19
+ test(request: TestRequest): Promise<TestResponse> | Observable<TestResponse> | TestResponse;
20
+ ping(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
21
+ }
22
+ export declare function TestServiceControllerMethods(): (constructor: Function) => void;
23
+ export declare const TEST_SERVICE_NAME = "TestService";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.2
5
+ // protoc v6.33.5
6
+ // source: test.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TEST_SERVICE_NAME = exports.TEST_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.TestServiceControllerMethods = TestServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "test.v1";
13
+ exports.TEST_V1_PACKAGE_NAME = "test.v1";
14
+ function TestServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["test", "ping"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("TestService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("TestService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.TEST_SERVICE_NAME = "TestService";
package/gen/test.ts ADDED
@@ -0,0 +1,55 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc v6.33.5
5
+ // source: test.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Empty as Empty1 } from "./google/protobuf/empty";
11
+
12
+ export const protobufPackage = "test.v1";
13
+
14
+ export interface TestRequest {
15
+ testRequest: string;
16
+ }
17
+
18
+ export interface TestResponse {
19
+ testResponse: string;
20
+ }
21
+
22
+ export interface Empty {
23
+ empty: Empty1 | undefined;
24
+ }
25
+
26
+ export const TEST_V1_PACKAGE_NAME = "test.v1";
27
+
28
+ export interface TestServiceClient {
29
+ test(request: TestRequest): Observable<TestResponse>;
30
+
31
+ ping(request: Empty): Observable<Empty>;
32
+ }
33
+
34
+ export interface TestServiceController {
35
+ test(request: TestRequest): Promise<TestResponse> | Observable<TestResponse> | TestResponse;
36
+
37
+ ping(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
38
+ }
39
+
40
+ export function TestServiceControllerMethods() {
41
+ return function (constructor: Function) {
42
+ const grpcMethods: string[] = ["test", "ping"];
43
+ for (const method of grpcMethods) {
44
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
45
+ GrpcMethod("TestService", method)(constructor.prototype[method], method, descriptor);
46
+ }
47
+ const grpcStreamMethods: string[] = [];
48
+ for (const method of grpcStreamMethods) {
49
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
50
+ GrpcStreamMethod("TestService", method)(constructor.prototype[method], method, descriptor);
51
+ }
52
+ };
53
+ }
54
+
55
+ export const TEST_SERVICE_NAME = "TestService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noildm/contracts",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Protobuf and RabbitMQ contracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,21 @@
1
+ syntax = "proto3";
2
+
3
+ package test.v1;
4
+
5
+ import "google/protobuf/empty.proto";//emty object
6
+ service TestService {
7
+ rpc Test(TestRequest) returns (TestResponse);
8
+ rpc Ping (Empty) returns (Empty);
9
+ }
10
+
11
+ message TestRequest {
12
+ string test_request = 1;
13
+ }
14
+
15
+ message TestResponse {
16
+ string test_response =1;
17
+ }
18
+
19
+ message Empty {
20
+ google.protobuf.Empty empty = 1;
21
+ }