@microservsforsell/contracts 1.1.5 → 1.1.6
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/README.md +34 -0
- package/dist/gen/ts/media.d.ts +39 -0
- package/dist/gen/ts/media.js +28 -0
- package/dist/gen/{users.d.ts → ts/users.d.ts} +1 -0
- package/gen/go/.gitkeep +0 -0
- package/package.json +2 -2
- package/proto/media.proto +42 -0
- package/proto/users.proto +1 -0
- /package/dist/gen/{account.d.ts → ts/account.d.ts} +0 -0
- /package/dist/gen/{account.js → ts/account.js} +0 -0
- /package/dist/gen/{auth.d.ts → ts/auth.d.ts} +0 -0
- /package/dist/gen/{auth.js → ts/auth.js} +0 -0
- /package/dist/gen/{google → ts/google}/protobuf/empty.d.ts +0 -0
- /package/dist/gen/{google → ts/google}/protobuf/empty.js +0 -0
- /package/dist/gen/{users.js → ts/users.js} +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
```
|
|
2
2
|
mkdir -p gen && protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit
|
|
3
3
|
```
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
git checkout -b in-go
|
|
7
|
+
|
|
8
|
+
go mod init github.com/microservsforsell/contracts
|
|
9
|
+
|
|
10
|
+
git add .
|
|
11
|
+
git commit -m "feat: add media.proto"
|
|
12
|
+
git push -u origin in-go --tags && git push -u origin v1.0.0
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
git push -u origin in-go && git push origin v1.0.0
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Видаляємо старий тег (локально та на сервері):
|
|
20
|
+
|
|
21
|
+
```Bash
|
|
22
|
+
git tag -d v1.0.0
|
|
23
|
+
git push origin :refs/tags/v1.0.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Створюємо новий тег на базі останнього коміту та пушимо:
|
|
27
|
+
|
|
28
|
+
```Bash
|
|
29
|
+
git tag v1.0.0
|
|
30
|
+
git push origin v1.0.0
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
git add .
|
|
35
|
+
git commit -m "fix: init go mod and add gitkeep"
|
|
36
|
+
git tag v1.0.1
|
|
37
|
+
git push origin in-go --tags
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "media.v1";
|
|
3
|
+
export interface UploadRequest {
|
|
4
|
+
fileName: string;
|
|
5
|
+
folder: string;
|
|
6
|
+
contentType: string;
|
|
7
|
+
data: Uint8Array;
|
|
8
|
+
resizeWidth?: number | undefined;
|
|
9
|
+
resizeHeight?: number | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface UploadResponse {
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetRequest {
|
|
15
|
+
key: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetResponse {
|
|
18
|
+
data: Uint8Array;
|
|
19
|
+
contentType: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteRequest {
|
|
22
|
+
key: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DeleteResponse {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
28
|
+
export interface MediaServiceClient {
|
|
29
|
+
upload(request: UploadRequest): Observable<UploadResponse>;
|
|
30
|
+
get(request: GetRequest): Observable<GetResponse>;
|
|
31
|
+
delete(request: DeleteRequest): Observable<DeleteResponse>;
|
|
32
|
+
}
|
|
33
|
+
export interface MediaServiceController {
|
|
34
|
+
upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
|
|
35
|
+
get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
|
|
36
|
+
delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
37
|
+
}
|
|
38
|
+
export declare function MediaServiceControllerMethods(): (constructor: Function) => void;
|
|
39
|
+
export declare const MEDIA_SERVICE_NAME = "MediaService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.0
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: media.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MEDIA_SERVICE_NAME = exports.MEDIA_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.MediaServiceControllerMethods = MediaServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "media.v1";
|
|
13
|
+
exports.MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
14
|
+
function MediaServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["upload", "get", "delete"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.MEDIA_SERVICE_NAME = "MediaService";
|
package/gen/go/.gitkeep
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microservsforsell/contracts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Protobuf definitions and generated Typecript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsc -p tsconfig.build.json",
|
|
14
|
-
"generate": "mkdir -p src/gen && protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=nestJs=true,package=omit"
|
|
14
|
+
"generate": "mkdir -p src/gen/ts && mkdir -p src/gen/go && protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen/ts --ts_proto_opt=nestJs=true,package=omit"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"proto",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package media.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/microservsforsell/contracts/media;media";
|
|
6
|
+
option java_multiple_files = true;
|
|
7
|
+
|
|
8
|
+
service MediaService {
|
|
9
|
+
rpc Upload (UploadRequest) returns (UploadResponse);
|
|
10
|
+
rpc Get (GetRequest) returns (GetResponse);
|
|
11
|
+
rpc Delete (DeleteRequest) returns (DeleteResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message UploadRequest {
|
|
15
|
+
string file_name = 1;
|
|
16
|
+
string folder = 2;
|
|
17
|
+
string content_type = 3;
|
|
18
|
+
bytes data = 4;
|
|
19
|
+
optional int32 resize_width = 5;
|
|
20
|
+
optional int32 resize_height = 6;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message UploadResponse {
|
|
24
|
+
string key = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message GetRequest {
|
|
28
|
+
string key = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message GetResponse {
|
|
32
|
+
bytes data = 1;
|
|
33
|
+
string content_type = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message DeleteRequest {
|
|
37
|
+
string key = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message DeleteResponse {
|
|
41
|
+
bool ok = 1;
|
|
42
|
+
}
|
package/proto/users.proto
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|