@tcinema-pro/contracts 1.3.6 → 1.3.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.
@@ -5,4 +5,5 @@ export declare const PROTO_PATHS: {
5
5
  readonly MEDIA: string;
6
6
  readonly MOVIE: string;
7
7
  readonly CATEGORY: string;
8
+ readonly THEATER: string;
8
9
  };
@@ -8,5 +8,6 @@ exports.PROTO_PATHS = {
8
8
  USERS: (0, path_1.join)(__dirname, '../../proto/users.proto'),
9
9
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
10
  MOVIE: (0, path_1.join)(__dirname, '../../proto/movie.proto'),
11
- CATEGORY: (0, path_1.join)(__dirname, '../../proto/category.proto')
11
+ CATEGORY: (0, path_1.join)(__dirname, '../../proto/category.proto'),
12
+ THEATER: (0, path_1.join)(__dirname, '../../proto/theater.proto')
12
13
  };
package/gen/theater.ts ADDED
@@ -0,0 +1,78 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
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 GetTheatersResponse {
15
+ theaters: Theater[];
16
+ }
17
+
18
+ export interface GetTheaterResponse {
19
+ theater: Theater | undefined;
20
+ }
21
+
22
+ export interface GetTheaterRequest {
23
+ id: string;
24
+ }
25
+
26
+ export interface CreateTheaterResponse {
27
+ ok: boolean;
28
+ }
29
+
30
+ export interface CreateTheaterRequest {
31
+ name: string;
32
+ address: string;
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
+ getTheaters(request: Empty): Observable<GetTheatersResponse>;
45
+
46
+ getTheater(request: GetTheaterRequest): Observable<GetTheaterResponse>;
47
+
48
+ createTheater(request: CreateTheaterRequest): Observable<CreateTheaterResponse>;
49
+ }
50
+
51
+ export interface TheaterServiceController {
52
+ getTheaters(request: Empty): Promise<GetTheatersResponse> | Observable<GetTheatersResponse> | GetTheatersResponse;
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[] = ["getTheaters", "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": "@tcinema-pro/contracts",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Protobuf defs",
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 GetTheaters (google.protobuf.Empty) returns (GetTheatersResponse);
9
+ rpc GetTheater (GetTheaterRequest) returns (GetTheaterResponse);
10
+ rpc CreateTheater (CreateTheaterRequest) returns (CreateTheaterResponse);
11
+ }
12
+
13
+ message GetTheatersResponse {
14
+ repeated Theater theaters = 1;
15
+ }
16
+
17
+ message GetTheaterResponse {
18
+ Theater theater = 1;
19
+ }
20
+
21
+ message GetTheaterRequest {
22
+ string id = 1;
23
+ }
24
+
25
+ message CreateTheaterResponse {
26
+ bool ok = 1;
27
+ }
28
+
29
+ message CreateTheaterRequest {
30
+ string name = 1;
31
+ string address = 2;
32
+ }
33
+
34
+
35
+ message Theater {
36
+ string id = 1;
37
+ string name = 2;
38
+ string address = 3;
39
+ }