@sakura-skytree/leaf-eats-contracts 1.2.2 → 1.2.4

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.
@@ -3,4 +3,5 @@ export declare const PROTO_PATHS: {
3
3
  readonly SESSION: string;
4
4
  readonly PROFILE: string;
5
5
  readonly RESTAURANT: string;
6
+ readonly MEDIA: string;
6
7
  };
@@ -6,5 +6,6 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  SESSION: (0, path_1.join)(__dirname, '../../proto/session.proto'),
8
8
  PROFILE: (0, path_1.join)(__dirname, '../../proto/profile.proto'),
9
- RESTAURANT: (0, path_1.join)(__dirname, '../../proto/restaurant.proto')
9
+ RESTAURANT: (0, path_1.join)(__dirname, '../../proto/restaurant.proto'),
10
+ MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
11
  };
package/gen/media.ts ADDED
@@ -0,0 +1,76 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc v7.35.1
5
+ // source: media.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "media.v1";
12
+
13
+ export interface UploadRequest {
14
+ fileName: string;
15
+ contentType: string;
16
+ folder: string;
17
+ data: Uint8Array;
18
+ width: number;
19
+ height: number;
20
+ }
21
+
22
+ export interface UploadResponse {
23
+ fileName: string;
24
+ }
25
+
26
+ export interface RemoveRequest {
27
+ fileName: string;
28
+ }
29
+
30
+ export interface RemoveResponse {
31
+ ok: boolean;
32
+ }
33
+
34
+ export interface GetRequest {
35
+ fileName: string;
36
+ }
37
+
38
+ export interface GetResponse {
39
+ data: Uint8Array;
40
+ contentType: string;
41
+ }
42
+
43
+ export const MEDIA_V1_PACKAGE_NAME = "media.v1";
44
+
45
+ export interface MediaServiceClient {
46
+ upload(request: UploadRequest): Observable<UploadResponse>;
47
+
48
+ remove(request: RemoveRequest): Observable<RemoveResponse>;
49
+
50
+ get(request: GetRequest): Observable<GetResponse>;
51
+ }
52
+
53
+ export interface MediaServiceController {
54
+ upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
55
+
56
+ remove(request: RemoveRequest): Promise<RemoveResponse> | Observable<RemoveResponse> | RemoveResponse;
57
+
58
+ get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
59
+ }
60
+
61
+ export function MediaServiceControllerMethods() {
62
+ return function (constructor: Function) {
63
+ const grpcMethods: string[] = ["upload", "remove", "get"];
64
+ for (const method of grpcMethods) {
65
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
66
+ GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
67
+ }
68
+ const grpcStreamMethods: string[] = [];
69
+ for (const method of grpcStreamMethods) {
70
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
71
+ GrpcStreamMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
72
+ }
73
+ };
74
+ }
75
+
76
+ export const MEDIA_SERVICE_NAME = "MediaService";
package/gen/restaurant.ts CHANGED
@@ -42,6 +42,14 @@ export interface GetRestaurantCategoriesResponse {
42
42
  categories: Category[];
43
43
  }
44
44
 
45
+ export interface DeleteCategoryRequest {
46
+ id: string;
47
+ }
48
+
49
+ export interface DeleteCategoryResponse {
50
+ ok: boolean;
51
+ }
52
+
45
53
  export interface CreateMenuItemRequest {
46
54
  title: string;
47
55
  imageUrl: string;
@@ -62,6 +70,14 @@ export interface GetMenuItemsResponse {
62
70
  items: CategoryItems[];
63
71
  }
64
72
 
73
+ export interface DeleteMenuItemRequest {
74
+ id: string;
75
+ }
76
+
77
+ export interface DeleteMenuItemResponse {
78
+ ok: boolean;
79
+ }
80
+
65
81
  export interface Restaurant {
66
82
  id: string;
67
83
  name: string;
@@ -99,9 +115,13 @@ export interface RestaurantServiceClient {
99
115
 
100
116
  getRestaurantCategories(request: GetRestaurantCategoriesRequest): Observable<GetRestaurantCategoriesResponse>;
101
117
 
118
+ deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
119
+
102
120
  createMenuItem(request: CreateMenuItemRequest): Observable<CreateMenuItemResponse>;
103
121
 
104
122
  getMenuItems(request: GetMenuItemsRequest): Observable<GetMenuItemsResponse>;
123
+
124
+ deleteMenuItem(request: DeleteMenuItemRequest): Observable<DeleteMenuItemResponse>;
105
125
  }
106
126
 
107
127
  export interface RestaurantServiceController {
@@ -124,6 +144,10 @@ export interface RestaurantServiceController {
124
144
  | Observable<GetRestaurantCategoriesResponse>
125
145
  | GetRestaurantCategoriesResponse;
126
146
 
147
+ deleteCategory(
148
+ request: DeleteCategoryRequest,
149
+ ): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
150
+
127
151
  createMenuItem(
128
152
  request: CreateMenuItemRequest,
129
153
  ): Promise<CreateMenuItemResponse> | Observable<CreateMenuItemResponse> | CreateMenuItemResponse;
@@ -131,6 +155,10 @@ export interface RestaurantServiceController {
131
155
  getMenuItems(
132
156
  request: GetMenuItemsRequest,
133
157
  ): Promise<GetMenuItemsResponse> | Observable<GetMenuItemsResponse> | GetMenuItemsResponse;
158
+
159
+ deleteMenuItem(
160
+ request: DeleteMenuItemRequest,
161
+ ): Promise<DeleteMenuItemResponse> | Observable<DeleteMenuItemResponse> | DeleteMenuItemResponse;
134
162
  }
135
163
 
136
164
  export function RestaurantServiceControllerMethods() {
@@ -140,8 +168,10 @@ export function RestaurantServiceControllerMethods() {
140
168
  "createRestaurant",
141
169
  "createCategory",
142
170
  "getRestaurantCategories",
171
+ "deleteCategory",
143
172
  "createMenuItem",
144
173
  "getMenuItems",
174
+ "deleteMenuItem",
145
175
  ];
146
176
  for (const method of grpcMethods) {
147
177
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-skytree/leaf-eats-contracts",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/",
@@ -0,0 +1,41 @@
1
+ syntax = "proto3";
2
+
3
+ package media.v1;
4
+
5
+ option java_multiple_files = true;
6
+
7
+ service MediaService {
8
+ rpc Upload(UploadRequest) returns(UploadResponse);
9
+ rpc Remove(RemoveRequest) returns(RemoveResponse);
10
+ rpc Get(GetRequest) returns(GetResponse);
11
+ }
12
+
13
+ message UploadRequest {
14
+ string file_name = 1;
15
+ string content_type = 2;
16
+ string folder = 3;
17
+ bytes data = 4;
18
+ int32 width = 5;
19
+ int32 height = 6;
20
+ }
21
+
22
+ message UploadResponse {
23
+ string file_name = 1;
24
+ }
25
+
26
+ message RemoveRequest {
27
+ string file_name = 1;
28
+ }
29
+
30
+ message RemoveResponse {
31
+ bool ok = 1;
32
+ }
33
+
34
+ message GetRequest {
35
+ string file_name = 1;
36
+ }
37
+
38
+ message GetResponse {
39
+ bytes data = 1;
40
+ string content_type = 2;
41
+ }
@@ -10,9 +10,11 @@ service RestaurantService {
10
10
 
11
11
  rpc CreateCategory(CreateCategoryRequest) returns(CreateCategoryResponse);
12
12
  rpc GetRestaurantCategories(GetRestaurantCategoriesRequest) returns(GetRestaurantCategoriesResponse);
13
+ rpc DeleteCategory(DeleteCategoryRequest) returns(DeleteCategoryResponse);
13
14
 
14
15
  rpc CreateMenuItem(CreateMenuItemRequest) returns(CreateMenuItemResponse);
15
16
  rpc GetMenuItems(GetMenuItemsRequest) returns(GetMenuItemsResponse);
17
+ rpc DeleteMenuItem(DeleteMenuItemRequest) returns(DeleteMenuItemResponse);
16
18
  }
17
19
 
18
20
  message GetRestaurantsResponse {
@@ -46,6 +48,13 @@ message GetRestaurantCategoriesResponse {
46
48
  repeated Category categories = 1;
47
49
  }
48
50
 
51
+ message DeleteCategoryRequest {
52
+ string id = 1;
53
+ }
54
+ message DeleteCategoryResponse {
55
+ bool ok = 1;
56
+ }
57
+
49
58
  message CreateMenuItemRequest {
50
59
  string title = 1;
51
60
  string imageUrl = 2;
@@ -63,6 +72,13 @@ message GetMenuItemsResponse {
63
72
  repeated CategoryItems items = 1;
64
73
  }
65
74
 
75
+ message DeleteMenuItemRequest {
76
+ string id = 1;
77
+ }
78
+ message DeleteMenuItemResponse {
79
+ bool ok = 1;
80
+ }
81
+
66
82
  message Restaurant {
67
83
  string id = 1;
68
84
  string name = 2;