@teacinema/contracts 1.2.2 → 1.2.3

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,78 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.8.3
4
+ // protoc v3.21.12
5
+ // source: theater.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Empty } from "./google/protobuf/empty";
11
+
12
+ export const protobufPackage = "theater.v1";
13
+
14
+ export interface ListTheatersResponse {
15
+ theaters: Theater[];
16
+ }
17
+
18
+ export interface GetTheaterRequest {
19
+ id: string;
20
+ }
21
+
22
+ export interface GetTheaterResponse {
23
+ theater: Theater | undefined;
24
+ }
25
+
26
+ export interface CreateTheaterRequest {
27
+ name: string;
28
+ address: string;
29
+ }
30
+
31
+ export interface CreateTheaterResponse {
32
+ ok: boolean;
33
+ }
34
+
35
+ export interface Theater {
36
+ id: string;
37
+ name: string;
38
+ address: string;
39
+ }
40
+
41
+ export const THEATER_V1_PACKAGE_NAME = "theater.v1";
42
+
43
+ export interface TheaterServiceClient {
44
+ listTheaters(request: Empty): Observable<ListTheatersResponse>;
45
+
46
+ getTheater(request: GetTheaterRequest): Observable<GetTheaterResponse>;
47
+
48
+ createTheater(request: CreateTheaterRequest): Observable<CreateTheaterResponse>;
49
+ }
50
+
51
+ export interface TheaterServiceController {
52
+ listTheaters(request: Empty): Promise<ListTheatersResponse> | Observable<ListTheatersResponse> | ListTheatersResponse;
53
+
54
+ getTheater(
55
+ request: GetTheaterRequest,
56
+ ): Promise<GetTheaterResponse> | Observable<GetTheaterResponse> | GetTheaterResponse;
57
+
58
+ createTheater(
59
+ request: CreateTheaterRequest,
60
+ ): Promise<CreateTheaterResponse> | Observable<CreateTheaterResponse> | CreateTheaterResponse;
61
+ }
62
+
63
+ export function TheaterServiceControllerMethods() {
64
+ return function (constructor: Function) {
65
+ const grpcMethods: string[] = ["listTheaters", "getTheater", "createTheater"];
66
+ for (const method of grpcMethods) {
67
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
68
+ GrpcMethod("TheaterService", method)(constructor.prototype[method], method, descriptor);
69
+ }
70
+ const grpcStreamMethods: string[] = [];
71
+ for (const method of grpcStreamMethods) {
72
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
73
+ GrpcStreamMethod("TheaterService", method)(constructor.prototype[method], method, descriptor);
74
+ }
75
+ };
76
+ }
77
+
78
+ export const THEATER_SERVICE_NAME = "TheaterService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacinema/contracts",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,39 @@
1
+ syntax = "proto3";
2
+
3
+ package theater.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+
7
+ service TheaterService {
8
+ rpc ListTheaters (google.protobuf.Empty) returns (ListTheatersResponse);
9
+ rpc GetTheater (GetTheaterRequest) returns (GetTheaterResponse);
10
+
11
+ rpc CreateTheater (CreateTheaterRequest) returns (CreateTheaterResponse);
12
+ }
13
+
14
+ message ListTheatersResponse {
15
+ repeated Theater theaters = 1;
16
+ }
17
+
18
+ message GetTheaterRequest {
19
+ string id = 1;
20
+ }
21
+
22
+ message GetTheaterResponse {
23
+ Theater theater = 1;
24
+ }
25
+
26
+ message CreateTheaterRequest {
27
+ string name = 1;
28
+ string address = 2;
29
+ }
30
+
31
+ message CreateTheaterResponse {
32
+ bool ok = 1;
33
+ }
34
+
35
+ message Theater {
36
+ string id = 1;
37
+ string name = 2;
38
+ string address = 3;
39
+ }