@dvltcinema/contracts 1.2.3 → 1.2.5

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
  };
@@ -9,4 +9,5 @@ exports.PROTO_PATHS = {
9
9
  MEDIA: (0, node_path_1.join)(__dirname, "../../proto/media.proto"),
10
10
  MOVIE: (0, node_path_1.join)(__dirname, "../../proto/movie.proto"),
11
11
  CATEGORY: (0, node_path_1.join)(__dirname, "../../proto/category.proto"),
12
+ THEATER: (0, node_path_1.join)(__dirname, "../../proto/theater.proto"),
12
13
  };
@@ -18,7 +18,7 @@ export interface GetAllCategoriesResponse {
18
18
  export interface Category {
19
19
  id: string;
20
20
  title: string;
21
- slut: string;
21
+ slug: string;
22
22
  }
23
23
 
24
24
  export const CATEGORY_V1_PACKAGE_NAME = "category.v1";
@@ -0,0 +1,78 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
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 Theater {
19
+ id: string;
20
+ name: string;
21
+ address: string;
22
+ }
23
+
24
+ export interface GetTheaterRequest {
25
+ id: string;
26
+ }
27
+
28
+ export interface GetTheaterResponse {
29
+ theater: Theater | undefined;
30
+ }
31
+
32
+ export interface CreateTheaterRequest {
33
+ name: string;
34
+ address: string;
35
+ }
36
+
37
+ export interface CreateTheaterResponse {
38
+ ok: boolean;
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": "@dvltcinema/contracts",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Protobuf definitions and generated Typescript and Go files",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -15,5 +15,5 @@ message GetAllCategoriesResponse {
15
15
  message Category {
16
16
  string id = 1;
17
17
  string title = 2;
18
- string slut = 3;
18
+ string slug = 3;
19
19
  }
@@ -0,0 +1,38 @@
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
+ rpc CreateTheater(CreateTheaterRequest) returns (CreateTheaterResponse);
11
+ }
12
+
13
+ message ListTheatersResponse {
14
+ repeated Theater theaters = 1;
15
+ }
16
+
17
+ message Theater {
18
+ string id = 1;
19
+ string name = 2;
20
+ string address = 3;
21
+ }
22
+
23
+ message GetTheaterRequest {
24
+ string id = 1;
25
+ }
26
+
27
+ message GetTheaterResponse {
28
+ Theater theater = 1;
29
+ }
30
+
31
+ message CreateTheaterRequest {
32
+ string name = 1;
33
+ string address = 2;
34
+ }
35
+
36
+ message CreateTheaterResponse {
37
+ bool ok = 1;
38
+ }