@vsniksnet/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.
- package/gen/media.ts +11 -10
- package/package.json +1 -1
- package/proto/media.proto +5 -6
package/gen/media.ts
CHANGED
|
@@ -8,40 +8,41 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
|
|
11
|
-
export const protobufPackage = "
|
|
11
|
+
export const protobufPackage = "media.v1";
|
|
12
12
|
|
|
13
|
-
export interface
|
|
13
|
+
export interface UploadAvatarRequest {
|
|
14
14
|
fileName: string;
|
|
15
15
|
contentType: string;
|
|
16
16
|
data: Uint8Array;
|
|
17
|
-
folder?: string | undefined;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
export interface
|
|
19
|
+
export interface UploadAvatarResponse {
|
|
21
20
|
path: string;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
export const
|
|
23
|
+
export const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
25
24
|
|
|
26
25
|
/** Media service */
|
|
27
26
|
|
|
28
27
|
export interface MediaServiceClient {
|
|
29
|
-
/** Upload
|
|
28
|
+
/** Upload avatar file */
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
uploadAvatar(request: UploadAvatarRequest): Observable<UploadAvatarResponse>;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
/** Media service */
|
|
35
34
|
|
|
36
35
|
export interface MediaServiceController {
|
|
37
|
-
/** Upload
|
|
36
|
+
/** Upload avatar file */
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
uploadAvatar(
|
|
39
|
+
request: UploadAvatarRequest,
|
|
40
|
+
): Promise<UploadAvatarResponse> | Observable<UploadAvatarResponse> | UploadAvatarResponse;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export function MediaServiceControllerMethods() {
|
|
43
44
|
return function (constructor: Function) {
|
|
44
|
-
const grpcMethods: string[] = ["
|
|
45
|
+
const grpcMethods: string[] = ["uploadAvatar"];
|
|
45
46
|
for (const method of grpcMethods) {
|
|
46
47
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
47
48
|
GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/media.proto
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
package
|
|
3
|
+
package media.v1;
|
|
4
4
|
|
|
5
5
|
/* Media service */
|
|
6
6
|
service MediaService {
|
|
7
|
-
/* Upload
|
|
8
|
-
rpc
|
|
7
|
+
/* Upload avatar file */
|
|
8
|
+
rpc UploadAvatar (UploadAvatarRequest) returns (UploadAvatarResponse);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
message
|
|
11
|
+
message UploadAvatarRequest {
|
|
12
12
|
string file_name = 1;
|
|
13
13
|
string content_type = 2;
|
|
14
14
|
bytes data = 3;
|
|
15
|
-
optional string folder = 4;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
message
|
|
17
|
+
message UploadAvatarResponse {
|
|
19
18
|
string path = 1;
|
|
20
19
|
}
|