@lumina-cinema/contracts 1.1.7 → 1.1.9

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/gen/ts/movie.ts CHANGED
@@ -60,7 +60,7 @@ export interface Movie {
60
60
  /** Poster image URL/key. */
61
61
  poster: string;
62
62
  /** Age rating label (for example "16+", "PG-13"). */
63
- ratingAge: string;
63
+ ratingAge: number;
64
64
  /** Official release date. */
65
65
  releaseDate: Timestamp | undefined;
66
66
  }
@@ -82,7 +82,7 @@ export interface MovieDetails {
82
82
  /** Duration in minutes. */
83
83
  duration: number;
84
84
  /** Age rating label. */
85
- ratingAge: string;
85
+ ratingAge: number;
86
86
  /** Country of production (display value). */
87
87
  country: string;
88
88
  /** Official release date. */
@@ -0,0 +1,78 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
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": "@lumina-cinema/contracts",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/movie.proto CHANGED
@@ -67,7 +67,7 @@ message Movie {
67
67
  string poster = 4;
68
68
 
69
69
  // Age rating label (for example "16+", "PG-13").
70
- string rating_age = 5;
70
+ int32 rating_age = 5;
71
71
 
72
72
  // Official release date.
73
73
  google.protobuf.Timestamp release_date = 6;
@@ -97,7 +97,7 @@ message MovieDetails {
97
97
  int32 duration = 7;
98
98
 
99
99
  // Age rating label.
100
- string rating_age = 8;
100
+ int32 rating_age = 8;
101
101
 
102
102
  // Country of production (display value).
103
103
  string country = 9;
@@ -0,0 +1,38 @@
1
+ syntax = "proto3";
2
+
3
+ package theater.v1;
4
+ import "google/protobuf/empty.proto";
5
+
6
+ service TheaterService {
7
+ rpc ListTheaters (google.protobuf.Empty) returns (ListTheatersResponse);
8
+ rpc GetTheater (GetTheaterRequest) returns (GetTheaterResponse);
9
+
10
+ rpc CreateTheater (CreateTheaterRequest) returns (CreateTheaterResponse);
11
+ }
12
+
13
+ message ListTheatersResponse {
14
+ repeated Theater theaters = 1;
15
+ }
16
+
17
+ message GetTheaterRequest {
18
+ string id = 1;
19
+ }
20
+
21
+ message GetTheaterResponse {
22
+ Theater theater = 1;
23
+ }
24
+
25
+ message CreateTheaterRequest {
26
+ string name = 1;
27
+ string address = 2;
28
+ }
29
+
30
+ message CreateTheaterResponse {
31
+ bool ok = 1;
32
+ }
33
+
34
+ message Theater {
35
+ string id = 1;
36
+ string name = 2;
37
+ string address = 3;
38
+ }