@airticketss/contracts 1.1.5 → 1.1.7
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 +0 -0
- package/gen/go/.gitkeep +0 -0
- package/gen/ts/.gitkeep +0 -0
- package/gen/{account.ts → ts/account.ts} +3 -1
- package/gen/{auth.ts → ts/auth.ts} +3 -1
- package/gen/{google → ts/google}/protobuf/empty.ts +1 -1
- package/gen/ts/media.ts +78 -0
- package/gen/{users.ts → ts/users.ts} +4 -1
- package/package.json +2 -2
- package/proto/media.proto +42 -0
- package/proto/users.proto +1 -0
package/gen/.gitkeep
ADDED
|
File without changes
|
package/gen/go/.gitkeep
ADDED
|
File without changes
|
package/gen/ts/.gitkeep
ADDED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.12.
|
|
3
|
+
// protoc-gen-ts_proto v2.12.3
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: account.proto
|
|
6
6
|
|
|
@@ -115,11 +115,13 @@ export function AccountServiceControllerMethods() {
|
|
|
115
115
|
for (const method of grpcMethods) {
|
|
116
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
117
117
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
118
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
118
119
|
}
|
|
119
120
|
const grpcStreamMethods: string[] = [];
|
|
120
121
|
for (const method of grpcStreamMethods) {
|
|
121
122
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
122
123
|
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
124
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.12.
|
|
3
|
+
// protoc-gen-ts_proto v2.12.3
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
@@ -131,11 +131,13 @@ export function AuthServiceControllerMethods() {
|
|
|
131
131
|
for (const method of grpcMethods) {
|
|
132
132
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
133
133
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
134
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
134
135
|
}
|
|
135
136
|
const grpcStreamMethods: string[] = [];
|
|
136
137
|
for (const method of grpcStreamMethods) {
|
|
137
138
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
138
139
|
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
140
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
139
141
|
}
|
|
140
142
|
};
|
|
141
143
|
}
|
package/gen/ts/media.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.3
|
|
4
|
+
// protoc v3.21.12
|
|
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
|
+
export interface MediaServiceClient {
|
|
46
|
+
upload(request: UploadRequest): Observable<UploadResponse>;
|
|
47
|
+
|
|
48
|
+
get(request: GetRequest): Observable<GetResponse>;
|
|
49
|
+
|
|
50
|
+
delete(request: DeleteRequest): Observable<DeleteResponse>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface MediaServiceController {
|
|
54
|
+
upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
|
|
55
|
+
|
|
56
|
+
get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
|
|
57
|
+
|
|
58
|
+
delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function MediaServiceControllerMethods() {
|
|
62
|
+
return function (constructor: Function) {
|
|
63
|
+
const grpcMethods: string[] = ["upload", "get", "delete"];
|
|
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
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
68
|
+
}
|
|
69
|
+
const grpcStreamMethods: string[] = [];
|
|
70
|
+
for (const method of grpcStreamMethods) {
|
|
71
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
72
|
+
GrpcStreamMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
73
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const MEDIA_SERVICE_NAME = "MediaService";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.12.
|
|
3
|
+
// protoc-gen-ts_proto v2.12.3
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: users.proto
|
|
6
6
|
|
|
@@ -29,6 +29,7 @@ export interface CreateUserResponse {
|
|
|
29
29
|
export interface PatchUserRequest {
|
|
30
30
|
userId: string;
|
|
31
31
|
name?: string | undefined;
|
|
32
|
+
avatar?: string | undefined;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export interface PatchUserResponse {
|
|
@@ -69,11 +70,13 @@ export function UsersServiceControllerMethods() {
|
|
|
69
70
|
for (const method of grpcMethods) {
|
|
70
71
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
71
72
|
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
73
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
72
74
|
}
|
|
73
75
|
const grpcStreamMethods: string[] = [];
|
|
74
76
|
for (const method of grpcStreamMethods) {
|
|
75
77
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
76
78
|
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
79
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airticketss/contracts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Protobuf definitions and generate TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -p tsconfig.build.json",
|
|
9
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
9
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,package=omit"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package media.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/airticketss/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
|
+
}
|