@usteam/contracts 1.1.4 → 1.1.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/.gitkeep ADDED
File without changes
File without changes
File without changes
@@ -0,0 +1,92 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v7.34.0
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
+ folder: string;
16
+ contentType: string;
17
+ data: Uint8Array;
18
+ resizeWidth?: number | undefined;
19
+ resizeHeight?: number | undefined;
20
+ }
21
+
22
+ export interface UploadResponse {
23
+ key: string;
24
+ }
25
+
26
+ export interface GetRequest {
27
+ key: string;
28
+ }
29
+
30
+ export interface GetResponse {
31
+ data: Uint8Array;
32
+ contentType: string;
33
+ }
34
+
35
+ export interface DeleteRequest {
36
+ key: string;
37
+ }
38
+
39
+ export interface DeleteResponse {
40
+ ok: boolean;
41
+ }
42
+
43
+ export const MEDIA_V1_PACKAGE_NAME = "media.v1";
44
+
45
+ /** Сервис для работы с файлами в S3 */
46
+
47
+ export interface MediaServiceClient {
48
+ /** Загружает файл в S3 */
49
+
50
+ upload(request: UploadRequest): Observable<UploadResponse>;
51
+
52
+ /** Получает файл по ключу в S3 */
53
+
54
+ get(request: GetRequest): Observable<GetResponse>;
55
+
56
+ /** Удаляет файл по ключу в S3 */
57
+
58
+ delete(request: DeleteRequest): Observable<DeleteResponse>;
59
+ }
60
+
61
+ /** Сервис для работы с файлами в S3 */
62
+
63
+ export interface MediaServiceController {
64
+ /** Загружает файл в S3 */
65
+
66
+ upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
67
+
68
+ /** Получает файл по ключу в S3 */
69
+
70
+ get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
71
+
72
+ /** Удаляет файл по ключу в S3 */
73
+
74
+ delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
75
+ }
76
+
77
+ export function MediaServiceControllerMethods() {
78
+ return function (constructor: Function) {
79
+ const grpcMethods: string[] = ["upload", "get", "delete"];
80
+ for (const method of grpcMethods) {
81
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
82
+ GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
83
+ }
84
+ const grpcStreamMethods: string[] = [];
85
+ for (const method of grpcStreamMethods) {
86
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
87
+ GrpcStreamMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
88
+ }
89
+ };
90
+ }
91
+
92
+ export const MEDIA_SERVICE_NAME = "MediaService";
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@usteam/contracts",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
7
7
  "build": "tsc -p tsconfig.build.json",
8
- "generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
8
+ "generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,package=omit"
9
9
  },
10
10
  "files": [
11
11
  "dist",
@@ -0,0 +1,46 @@
1
+ syntax = "proto3";
2
+
3
+ package media.v1;
4
+
5
+ option go_package = "github.com/ShmatkoBrest/contracts/media:media";
6
+ option java_multiple_files = true;
7
+
8
+ // Сервис для работы с файлами в S3
9
+ service MediaService {
10
+ // Загружает файл в S3
11
+ rpc Upload (UploadRequest) returns (UploadResponse);
12
+ // Получает файл по ключу в S3
13
+ rpc Get (GetRequest) returns (GetResponse);
14
+ // Удаляет файл по ключу в S3
15
+ rpc Delete (DeleteRequest) returns (DeleteResponse);
16
+ }
17
+
18
+ message UploadRequest {
19
+ string file_name = 1;
20
+ string folder = 2;
21
+ string content_type = 3;
22
+ bytes data = 4;
23
+ optional int32 resize_width = 5;
24
+ optional int32 resize_height = 6;
25
+ }
26
+
27
+ message UploadResponse {
28
+ string key = 1;
29
+ }
30
+
31
+ message GetRequest {
32
+ string key = 1;
33
+ }
34
+
35
+ message GetResponse {
36
+ bytes data = 1;
37
+ string content_type = 2;
38
+ }
39
+
40
+ message DeleteRequest {
41
+ string key = 1;
42
+ }
43
+
44
+ message DeleteResponse {
45
+ bool ok = 1;
46
+ }
File without changes
File without changes
File without changes
File without changes