@salesticketcinema/contracts 1.2.2 → 1.3.0

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,7 @@ export declare const PROTO_PATHS: {
5
5
  readonly MEDIA: string;
6
6
  readonly MOVIE: string;
7
7
  readonly CATEGORY: string;
8
+ readonly THEATER: string;
9
+ readonly HALL: string;
10
+ readonly SEAT: string;
8
11
  };
@@ -9,4 +9,7 @@ exports.PROTO_PATHS = {
9
9
  MEDIA: (0, path_1.join)(__dirname, "../../proto/media.proto"),
10
10
  MOVIE: (0, path_1.join)(__dirname, "../../proto/movie.proto"),
11
11
  CATEGORY: (0, path_1.join)(__dirname, "../../proto/category.proto"),
12
+ THEATER: (0, path_1.join)(__dirname, "../../proto/theater.proto"),
13
+ HALL: (0, path_1.join)(__dirname, "../../proto/hall.proto"),
14
+ SEAT: (0, path_1.join)(__dirname, "../../proto/seat.proto"),
12
15
  };
package/gen/ts/account.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: account.proto
6
6
 
@@ -115,11 +115,13 @@ export function AccountServiceControllerMethods() {
115
115
  for (const method of grpcMethods) {
116
116
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
117
117
  GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
118
+ Object.defineProperty(constructor.prototype, method, descriptor);
118
119
  }
119
120
  const grpcStreamMethods: string[] = [];
120
121
  for (const method of grpcStreamMethods) {
121
122
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
122
123
  GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
124
+ Object.defineProperty(constructor.prototype, method, descriptor);
123
125
  }
124
126
  };
125
127
  }
package/gen/ts/auth.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: auth.proto
6
6
 
@@ -131,11 +131,13 @@ export function AuthServiceControllerMethods() {
131
131
  for (const method of grpcMethods) {
132
132
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
133
133
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
134
+ Object.defineProperty(constructor.prototype, method, descriptor);
134
135
  }
135
136
  const grpcStreamMethods: string[] = [];
136
137
  for (const method of grpcStreamMethods) {
137
138
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
138
139
  GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
140
+ Object.defineProperty(constructor.prototype, method, descriptor);
139
141
  }
140
142
  };
141
143
  }
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: category.proto
6
6
 
@@ -39,11 +39,13 @@ export function CategoryServiceControllerMethods() {
39
39
  for (const method of grpcMethods) {
40
40
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
41
41
  GrpcMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
42
+ Object.defineProperty(constructor.prototype, method, descriptor);
42
43
  }
43
44
  const grpcStreamMethods: string[] = [];
44
45
  for (const method of grpcStreamMethods) {
45
46
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
46
47
  GrpcStreamMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
48
+ Object.defineProperty(constructor.prototype, method, descriptor);
47
49
  }
48
50
  };
49
51
  }
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
package/gen/ts/hall.ts ADDED
@@ -0,0 +1,92 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.3
4
+ // protoc v3.21.12
5
+ // source: hall.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "hall.v1";
12
+
13
+ export interface CreateHallRequest {
14
+ name: string;
15
+ theaterId: string;
16
+ layout: RowLayout[];
17
+ }
18
+
19
+ export interface CreateHallResponse {
20
+ hall: Hall | undefined;
21
+ }
22
+
23
+ export interface GetHallRequest {
24
+ id: string;
25
+ }
26
+
27
+ export interface GetHallResponse {
28
+ hall: Hall | undefined;
29
+ }
30
+
31
+ export interface ListHallRequest {
32
+ theaterId: string;
33
+ }
34
+
35
+ export interface ListHallResponse {
36
+ halls: Hall[];
37
+ }
38
+
39
+ export interface Hall {
40
+ id: string;
41
+ name: string;
42
+ theaterId: string;
43
+ layout: RowLayout[];
44
+ }
45
+
46
+ export interface RowLayout {
47
+ row: number;
48
+ columns: number;
49
+ type: string;
50
+ price: number;
51
+ }
52
+
53
+ export const HALL_V1_PACKAGE_NAME = "hall.v1";
54
+
55
+ export interface HallServiceClient {
56
+ createHall(request: CreateHallRequest): Observable<CreateHallResponse>;
57
+
58
+ getHall(request: GetHallRequest): Observable<GetHallResponse>;
59
+
60
+ listHallsByTheater(request: ListHallRequest): Observable<ListHallResponse>;
61
+ }
62
+
63
+ export interface HallServiceController {
64
+ createHall(
65
+ request: CreateHallRequest,
66
+ ): Promise<CreateHallResponse> | Observable<CreateHallResponse> | CreateHallResponse;
67
+
68
+ getHall(request: GetHallRequest): Promise<GetHallResponse> | Observable<GetHallResponse> | GetHallResponse;
69
+
70
+ listHallsByTheater(
71
+ request: ListHallRequest,
72
+ ): Promise<ListHallResponse> | Observable<ListHallResponse> | ListHallResponse;
73
+ }
74
+
75
+ export function HallServiceControllerMethods() {
76
+ return function (constructor: Function) {
77
+ const grpcMethods: string[] = ["createHall", "getHall", "listHallsByTheater"];
78
+ for (const method of grpcMethods) {
79
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
80
+ GrpcMethod("HallService", method)(constructor.prototype[method], method, descriptor);
81
+ Object.defineProperty(constructor.prototype, method, descriptor);
82
+ }
83
+ const grpcStreamMethods: string[] = [];
84
+ for (const method of grpcStreamMethods) {
85
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
86
+ GrpcStreamMethod("HallService", method)(constructor.prototype[method], method, descriptor);
87
+ Object.defineProperty(constructor.prototype, method, descriptor);
88
+ }
89
+ };
90
+ }
91
+
92
+ export const HALL_SERVICE_NAME = "HallService";
package/gen/ts/media.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: media.proto
6
6
 
@@ -64,11 +64,13 @@ export function MediaServiceControllerMethods() {
64
64
  for (const method of grpcMethods) {
65
65
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
66
66
  GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
67
+ Object.defineProperty(constructor.prototype, method, descriptor);
67
68
  }
68
69
  const grpcStreamMethods: string[] = [];
69
70
  for (const method of grpcStreamMethods) {
70
71
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
71
72
  GrpcStreamMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
73
+ Object.defineProperty(constructor.prototype, method, descriptor);
72
74
  }
73
75
  };
74
76
  }
package/gen/ts/movie.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: movie.proto
6
6
 
@@ -74,11 +74,13 @@ export function MovieServiceControllerMethods() {
74
74
  for (const method of grpcMethods) {
75
75
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
76
76
  GrpcMethod("MovieService", method)(constructor.prototype[method], method, descriptor);
77
+ Object.defineProperty(constructor.prototype, method, descriptor);
77
78
  }
78
79
  const grpcStreamMethods: string[] = [];
79
80
  for (const method of grpcStreamMethods) {
80
81
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
81
82
  GrpcStreamMethod("MovieService", method)(constructor.prototype[method], method, descriptor);
83
+ Object.defineProperty(constructor.prototype, method, descriptor);
82
84
  }
83
85
  };
84
86
  }
package/gen/ts/seat.ts ADDED
@@ -0,0 +1,73 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.3
4
+ // protoc v3.21.12
5
+ // source: seat.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "seat.v1";
12
+
13
+ export interface GetSeaetRequest {
14
+ id: string;
15
+ }
16
+
17
+ export interface GetSeaetResponse {
18
+ seat: Seat | undefined;
19
+ }
20
+
21
+ export interface ListSeatsRequest {
22
+ hallId: string;
23
+ screeningId: string;
24
+ }
25
+
26
+ export interface ListSeatsResponse {
27
+ seat: Seat[];
28
+ }
29
+
30
+ export interface Seat {
31
+ id: string;
32
+ row: number;
33
+ number: number;
34
+ price: number;
35
+ status: string;
36
+ type: string;
37
+ hallId: string;
38
+ }
39
+
40
+ export const SEAT_V1_PACKAGE_NAME = "seat.v1";
41
+
42
+ export interface SeatServiceClient {
43
+ getSeaet(request: GetSeaetRequest): Observable<GetSeaetResponse>;
44
+
45
+ listSeatsByHall(request: ListSeatsRequest): Observable<ListSeatsResponse>;
46
+ }
47
+
48
+ export interface SeatServiceController {
49
+ getSeaet(request: GetSeaetRequest): Promise<GetSeaetResponse> | Observable<GetSeaetResponse> | GetSeaetResponse;
50
+
51
+ listSeatsByHall(
52
+ request: ListSeatsRequest,
53
+ ): Promise<ListSeatsResponse> | Observable<ListSeatsResponse> | ListSeatsResponse;
54
+ }
55
+
56
+ export function SeatServiceControllerMethods() {
57
+ return function (constructor: Function) {
58
+ const grpcMethods: string[] = ["getSeaet", "listSeatsByHall"];
59
+ for (const method of grpcMethods) {
60
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
61
+ GrpcMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
62
+ Object.defineProperty(constructor.prototype, method, descriptor);
63
+ }
64
+ const grpcStreamMethods: string[] = [];
65
+ for (const method of grpcStreamMethods) {
66
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
67
+ GrpcStreamMethod("SeatService", method)(constructor.prototype[method], method, descriptor);
68
+ Object.defineProperty(constructor.prototype, method, descriptor);
69
+ }
70
+ };
71
+ }
72
+
73
+ export const SEAT_SERVICE_NAME = "SeatService";
package/gen/ts/theater.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: theater.proto
6
6
 
@@ -29,7 +29,7 @@ export interface CreateTheaterRequest {
29
29
  }
30
30
 
31
31
  export interface CreateTheaterResponse {
32
- ok: boolean;
32
+ theater: Theater | undefined;
33
33
  }
34
34
 
35
35
  export interface Theater {
@@ -66,11 +66,13 @@ export function TheaterServiceControllerMethods() {
66
66
  for (const method of grpcMethods) {
67
67
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
68
68
  GrpcMethod("TheaterService", method)(constructor.prototype[method], method, descriptor);
69
+ Object.defineProperty(constructor.prototype, method, descriptor);
69
70
  }
70
71
  const grpcStreamMethods: string[] = [];
71
72
  for (const method of grpcStreamMethods) {
72
73
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
73
74
  GrpcStreamMethod("TheaterService", method)(constructor.prototype[method], method, descriptor);
75
+ Object.defineProperty(constructor.prototype, method, descriptor);
74
76
  }
75
77
  };
76
78
  }
package/gen/ts/users.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.2
3
+ // protoc-gen-ts_proto v2.12.3
4
4
  // protoc v3.21.12
5
5
  // source: users.proto
6
6
 
@@ -70,11 +70,13 @@ export function UsersServiceControllerMethods() {
70
70
  for (const method of grpcMethods) {
71
71
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
72
72
  GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
73
+ Object.defineProperty(constructor.prototype, method, descriptor);
73
74
  }
74
75
  const grpcStreamMethods: string[] = [];
75
76
  for (const method of grpcStreamMethods) {
76
77
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
77
78
  GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
79
+ Object.defineProperty(constructor.prototype, method, descriptor);
78
80
  }
79
81
  };
80
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesticketcinema/contracts",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.js",
@@ -0,0 +1,49 @@
1
+ syntax = "proto3";
2
+
3
+ package hall.v1;
4
+
5
+ service HallService {
6
+ rpc CreateHall(CreateHallRequest) returns (CreateHallResponse);
7
+ rpc GetHall(GetHallRequest) returns (GetHallResponse);
8
+ rpc ListHallsByTheater (ListHallRequest) returns (ListHallResponse);
9
+ }
10
+
11
+ message CreateHallRequest {
12
+ string name = 1;
13
+ string theater_id = 2;
14
+ repeated RowLayout layout = 3;
15
+ }
16
+
17
+ message CreateHallResponse {
18
+ Hall hall = 1;
19
+ }
20
+
21
+ message GetHallRequest {
22
+ string id = 1;
23
+ }
24
+
25
+ message GetHallResponse {
26
+ Hall hall = 1;
27
+ }
28
+
29
+ message ListHallRequest {
30
+ string theater_id = 1;
31
+ }
32
+
33
+ message ListHallResponse {
34
+ repeated Hall halls = 1;
35
+ }
36
+
37
+ message Hall {
38
+ string id = 1;
39
+ string name = 2;
40
+ string theater_id = 3;
41
+ repeated RowLayout layout = 4;
42
+ }
43
+
44
+ message RowLayout {
45
+ int32 row = 1;
46
+ int32 columns = 2;
47
+ string type = 3;
48
+ int32 price = 4;
49
+ }
@@ -0,0 +1,35 @@
1
+ syntax = "proto3";
2
+
3
+ package seat.v1;
4
+
5
+ service SeatService {
6
+ rpc GetSeaet(GetSeaetRequest) returns (GetSeaetResponse);
7
+ rpc ListSeatsByHall (ListSeatsRequest) returns (ListSeatsResponse);
8
+ }
9
+
10
+ message GetSeaetRequest {
11
+ string id = 1;
12
+ }
13
+
14
+ message GetSeaetResponse {
15
+ Seat seat = 1;
16
+ }
17
+
18
+ message ListSeatsRequest {
19
+ string hall_id = 1;
20
+ string screening_id = 2;
21
+ }
22
+
23
+ message ListSeatsResponse {
24
+ repeated Seat seat = 1;
25
+ }
26
+
27
+ message Seat {
28
+ string id = 1;
29
+ int32 row = 2;
30
+ int32 number = 3;
31
+ int32 price = 4;
32
+ string status = 5;
33
+ string type = 6;
34
+ string hall_id = 7;
35
+ }
@@ -28,7 +28,7 @@ message CreateTheaterRequest {
28
28
  }
29
29
 
30
30
  message CreateTheaterResponse {
31
- bool ok = 1;
31
+ Theater theater = 1;
32
32
  }
33
33
 
34
34
  message Theater {