@sakura-skytree/leaf-eats-contracts 1.2.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-skytree/leaf-eats-contracts",
3
- "version": "1.2.3",
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
+ }