@teacinema-nekoo/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/dist/gen/account.d.ts +0 -38
- package/dist/gen/account.js +1 -7
- package/dist/gen/auth.d.ts +0 -40
- package/dist/gen/auth.js +1 -9
- package/gen/go/.gitkeep +0 -0
- package/gen/ts/.gitkeep +0 -0
- package/gen/ts/account.ts +127 -0
- package/gen/ts/auth.ts +143 -0
- package/{dist/gen/google/protobuf/empty.d.ts → gen/ts/google/protobuf/empty.ts} +12 -4
- package/gen/ts/media.ts +80 -0
- package/gen/ts/users.ts +81 -0
- package/package.json +4 -3
- package/proto/media.proto +43 -0
- package/dist/gen/google/protobuf/empty.js +0 -11
- package/dist/gen/users.d.ts +0 -41
- package/dist/gen/users.js +0 -28
package/dist/gen/account.d.ts
CHANGED
|
@@ -16,50 +16,12 @@ export interface GetAccountResponse {
|
|
|
16
16
|
isEmailVerified: boolean;
|
|
17
17
|
role: Role;
|
|
18
18
|
}
|
|
19
|
-
export interface InitEmailChangeRequest {
|
|
20
|
-
email: string;
|
|
21
|
-
userId: string;
|
|
22
|
-
}
|
|
23
|
-
export interface InitEmailChangeResponse {
|
|
24
|
-
ok: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface ConfirmEmailChangeRequest {
|
|
27
|
-
email: string;
|
|
28
|
-
code: string;
|
|
29
|
-
userId: string;
|
|
30
|
-
}
|
|
31
|
-
export interface ConfirmEmailChangeResponse {
|
|
32
|
-
ok: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface InitPhoneChangeRequest {
|
|
35
|
-
phone: string;
|
|
36
|
-
userId: string;
|
|
37
|
-
}
|
|
38
|
-
export interface InitPhoneChangeResponse {
|
|
39
|
-
ok: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface ConfirmPhoneChangeRequest {
|
|
42
|
-
phone: string;
|
|
43
|
-
code: string;
|
|
44
|
-
userId: string;
|
|
45
|
-
}
|
|
46
|
-
export interface ConfirmPhoneChangeResponse {
|
|
47
|
-
ok: boolean;
|
|
48
|
-
}
|
|
49
19
|
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
50
20
|
export interface AccountServiceClient {
|
|
51
21
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
52
|
-
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
53
|
-
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
54
|
-
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
55
|
-
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
56
22
|
}
|
|
57
23
|
export interface AccountServiceController {
|
|
58
24
|
getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
59
|
-
initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
60
|
-
confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
61
|
-
initPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
62
|
-
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
63
25
|
}
|
|
64
26
|
export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
|
|
65
27
|
export declare const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/dist/gen/account.js
CHANGED
|
@@ -19,13 +19,7 @@ var Role;
|
|
|
19
19
|
exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
20
20
|
function AccountServiceControllerMethods() {
|
|
21
21
|
return function (constructor) {
|
|
22
|
-
const grpcMethods = [
|
|
23
|
-
"getAccount",
|
|
24
|
-
"initEmailChange",
|
|
25
|
-
"confirmEmailChange",
|
|
26
|
-
"initPhoneChange",
|
|
27
|
-
"confirmPhoneChange",
|
|
28
|
-
];
|
|
22
|
+
const grpcMethods = ["getAccount"];
|
|
29
23
|
for (const method of grpcMethods) {
|
|
30
24
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
25
|
(0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/dist/gen/auth.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { Empty } from "./google/protobuf/empty";
|
|
3
2
|
export declare const protobufPackage = "auth.v1";
|
|
4
3
|
export interface SendOtpRequest {
|
|
5
4
|
identifier: string;
|
|
@@ -24,55 +23,16 @@ export interface RefreshResponse {
|
|
|
24
23
|
accessToken: string;
|
|
25
24
|
refreshToken: string;
|
|
26
25
|
}
|
|
27
|
-
export interface TelegramInitResponse {
|
|
28
|
-
url: string;
|
|
29
|
-
}
|
|
30
|
-
export interface TelegramVerifyRequest {
|
|
31
|
-
query: {
|
|
32
|
-
[key: string]: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface TelegramVerifyRequest_QueryEntry {
|
|
36
|
-
key: string;
|
|
37
|
-
value: string;
|
|
38
|
-
}
|
|
39
|
-
export interface TelegramVerifyResponse {
|
|
40
|
-
url?: string | undefined;
|
|
41
|
-
accessToken?: string | undefined;
|
|
42
|
-
refreshToken?: string | undefined;
|
|
43
|
-
}
|
|
44
|
-
export interface TelegramCompleteRequest {
|
|
45
|
-
sessionId: string;
|
|
46
|
-
phone: string;
|
|
47
|
-
}
|
|
48
|
-
export interface TelegramCompleteResponse {
|
|
49
|
-
sessionId: string;
|
|
50
|
-
}
|
|
51
|
-
export interface TelegramConsumeRequest {
|
|
52
|
-
sessionId: string;
|
|
53
|
-
}
|
|
54
|
-
export interface TelegramConsumeResponse {
|
|
55
|
-
accessToken: string;
|
|
56
|
-
refreshToken: string;
|
|
57
|
-
}
|
|
58
26
|
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
59
27
|
export interface AuthServiceClient {
|
|
60
28
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
61
29
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
62
30
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
63
|
-
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
64
|
-
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
65
|
-
telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
|
|
66
|
-
telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
|
|
67
31
|
}
|
|
68
32
|
export interface AuthServiceController {
|
|
69
33
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
70
34
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
71
35
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
72
|
-
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
73
|
-
telegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
74
|
-
telegramComplete(request: TelegramCompleteRequest): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
|
|
75
|
-
telegramConsume(request: TelegramConsumeRequest): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
|
|
76
36
|
}
|
|
77
37
|
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
78
38
|
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.js
CHANGED
|
@@ -13,15 +13,7 @@ exports.protobufPackage = "auth.v1";
|
|
|
13
13
|
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
14
|
function AuthServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = [
|
|
17
|
-
"sendOtp",
|
|
18
|
-
"verifyOtp",
|
|
19
|
-
"refresh",
|
|
20
|
-
"telegramInit",
|
|
21
|
-
"telegramVerify",
|
|
22
|
-
"telegramComplete",
|
|
23
|
-
"telegramConsume",
|
|
24
|
-
];
|
|
16
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
|
|
25
17
|
for (const method of grpcMethods) {
|
|
26
18
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
27
19
|
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/go/.gitkeep
ADDED
|
File without changes
|
package/gen/ts/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "account.v1";
|
|
12
|
+
|
|
13
|
+
export enum Role {
|
|
14
|
+
USER = 0,
|
|
15
|
+
ADMIN = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GetAccountRequest {
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GetAccountResponse {
|
|
24
|
+
id: string;
|
|
25
|
+
phone: string;
|
|
26
|
+
email: string;
|
|
27
|
+
isPhoneVerified: boolean;
|
|
28
|
+
isEmailVerified: boolean;
|
|
29
|
+
role: Role;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface InitEmailChangeRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InitEmailChangeResponse {
|
|
38
|
+
ok: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ConfirmEmailChangeRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
code: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailChangeResponse {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
phone: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface InitPhoneChangeResponse {
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ConfirmPhoneChangeRequest {
|
|
61
|
+
phone: string;
|
|
62
|
+
code: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConfirmPhoneChangeResponse {
|
|
67
|
+
ok: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
71
|
+
|
|
72
|
+
export interface AccountServiceClient {
|
|
73
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
74
|
+
|
|
75
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
76
|
+
|
|
77
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
78
|
+
|
|
79
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AccountServiceController {
|
|
85
|
+
getAccount(
|
|
86
|
+
request: GetAccountRequest,
|
|
87
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
88
|
+
|
|
89
|
+
initEmailChange(
|
|
90
|
+
request: InitEmailChangeRequest,
|
|
91
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
92
|
+
|
|
93
|
+
confirmEmailChange(
|
|
94
|
+
request: ConfirmEmailChangeRequest,
|
|
95
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
96
|
+
|
|
97
|
+
initPhoneChange(
|
|
98
|
+
request: InitPhoneChangeRequest,
|
|
99
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
100
|
+
|
|
101
|
+
confirmPhoneChange(
|
|
102
|
+
request: ConfirmPhoneChangeRequest,
|
|
103
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function AccountServiceControllerMethods() {
|
|
107
|
+
return function (constructor: Function) {
|
|
108
|
+
const grpcMethods: string[] = [
|
|
109
|
+
"getAccount",
|
|
110
|
+
"initEmailChange",
|
|
111
|
+
"confirmEmailChange",
|
|
112
|
+
"initPhoneChange",
|
|
113
|
+
"confirmPhoneChange",
|
|
114
|
+
];
|
|
115
|
+
for (const method of grpcMethods) {
|
|
116
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
117
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
118
|
+
}
|
|
119
|
+
const grpcStreamMethods: string[] = [];
|
|
120
|
+
for (const method of grpcStreamMethods) {
|
|
121
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
122
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/ts/auth.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: auth.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "auth.v1";
|
|
13
|
+
|
|
14
|
+
export interface SendOtpRequest {
|
|
15
|
+
identifier: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SendOtpResponse {
|
|
20
|
+
ok: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface VerifyOtpRequest {
|
|
24
|
+
identifier: string;
|
|
25
|
+
type: string;
|
|
26
|
+
code: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface VerifyOtpResponse {
|
|
30
|
+
accessToken: string;
|
|
31
|
+
refreshToken: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RefreshRequest {
|
|
35
|
+
refreshToken: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface RefreshResponse {
|
|
39
|
+
accessToken: string;
|
|
40
|
+
refreshToken: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface TelegramInitResponse {
|
|
44
|
+
url: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TelegramVerifyRequest {
|
|
48
|
+
query: { [key: string]: string };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
52
|
+
key: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TelegramVerifyResponse {
|
|
57
|
+
url?: string | undefined;
|
|
58
|
+
accessToken?: string | undefined;
|
|
59
|
+
refreshToken?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TelegramCompleteRequest {
|
|
63
|
+
sessionId: string;
|
|
64
|
+
phone: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface TelegramCompleteResponse {
|
|
68
|
+
sessionId: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface TelegramConsumeRequest {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface TelegramConsumeResponse {
|
|
76
|
+
accessToken: string;
|
|
77
|
+
refreshToken: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
81
|
+
|
|
82
|
+
export interface AuthServiceClient {
|
|
83
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
84
|
+
|
|
85
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
86
|
+
|
|
87
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
88
|
+
|
|
89
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
90
|
+
|
|
91
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
92
|
+
|
|
93
|
+
telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
|
|
94
|
+
|
|
95
|
+
telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface AuthServiceController {
|
|
99
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
100
|
+
|
|
101
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
102
|
+
|
|
103
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
104
|
+
|
|
105
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
106
|
+
|
|
107
|
+
telegramVerify(
|
|
108
|
+
request: TelegramVerifyRequest,
|
|
109
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
110
|
+
|
|
111
|
+
telegramComplete(
|
|
112
|
+
request: TelegramCompleteRequest,
|
|
113
|
+
): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
|
|
114
|
+
|
|
115
|
+
telegramConsume(
|
|
116
|
+
request: TelegramConsumeRequest,
|
|
117
|
+
): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function AuthServiceControllerMethods() {
|
|
121
|
+
return function (constructor: Function) {
|
|
122
|
+
const grpcMethods: string[] = [
|
|
123
|
+
"sendOtp",
|
|
124
|
+
"verifyOtp",
|
|
125
|
+
"refresh",
|
|
126
|
+
"telegramInit",
|
|
127
|
+
"telegramVerify",
|
|
128
|
+
"telegramComplete",
|
|
129
|
+
"telegramConsume",
|
|
130
|
+
];
|
|
131
|
+
for (const method of grpcMethods) {
|
|
132
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
133
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
134
|
+
}
|
|
135
|
+
const grpcStreamMethods: string[] = [];
|
|
136
|
+
for (const method of grpcStreamMethods) {
|
|
137
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
138
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
2
11
|
/**
|
|
3
12
|
* A generic empty message that you can re-use to avoid defining duplicated
|
|
4
13
|
* empty messages in your APIs. A typical example is to use it as the request
|
|
@@ -7,9 +16,8 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
7
16
|
* service Foo {
|
|
8
17
|
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
9
18
|
* }
|
|
10
|
-
*
|
|
11
|
-
* The JSON representation for `Empty` is empty JSON object `{}`.
|
|
12
19
|
*/
|
|
13
20
|
export interface Empty {
|
|
14
21
|
}
|
|
15
|
-
|
|
22
|
+
|
|
23
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/gen/ts/media.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
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
|
+
/** rpc GeneratePreview(GeneratePreviewRequest) returns (GeneratePreviewResponse); */
|
|
51
|
+
|
|
52
|
+
delete(request: DeleteRequest): Observable<DeleteResponse>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MediaServiceController {
|
|
56
|
+
upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
|
|
57
|
+
|
|
58
|
+
get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
|
|
59
|
+
|
|
60
|
+
/** rpc GeneratePreview(GeneratePreviewRequest) returns (GeneratePreviewResponse); */
|
|
61
|
+
|
|
62
|
+
delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function MediaServiceControllerMethods() {
|
|
66
|
+
return function (constructor: Function) {
|
|
67
|
+
const grpcMethods: string[] = ["upload", "get", "delete"];
|
|
68
|
+
for (const method of grpcMethods) {
|
|
69
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
70
|
+
GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
71
|
+
}
|
|
72
|
+
const grpcStreamMethods: string[] = [];
|
|
73
|
+
for (const method of grpcStreamMethods) {
|
|
74
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
75
|
+
GrpcStreamMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const MEDIA_SERVICE_NAME = "MediaService";
|
package/gen/ts/users.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: users.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "users.v1";
|
|
12
|
+
|
|
13
|
+
export interface GetMeRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetMeResponse {
|
|
18
|
+
user: User | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateUserRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateUserResponse {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface PatchUserRequest {
|
|
30
|
+
userId: string;
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface PatchUserResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface User {
|
|
39
|
+
id: string;
|
|
40
|
+
name?: string | undefined;
|
|
41
|
+
phone?: string | undefined;
|
|
42
|
+
email?: string | undefined;
|
|
43
|
+
avatar?: string | undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
47
|
+
|
|
48
|
+
export interface UsersServiceClient {
|
|
49
|
+
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
50
|
+
|
|
51
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
52
|
+
|
|
53
|
+
patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface UsersServiceController {
|
|
57
|
+
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
58
|
+
|
|
59
|
+
createUser(
|
|
60
|
+
request: CreateUserRequest,
|
|
61
|
+
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
62
|
+
|
|
63
|
+
patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function UsersServiceControllerMethods() {
|
|
67
|
+
return function (constructor: Function) {
|
|
68
|
+
const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
|
|
69
|
+
for (const method of grpcMethods) {
|
|
70
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
71
|
+
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
72
|
+
}
|
|
73
|
+
const grpcStreamMethods: string[] = [];
|
|
74
|
+
for (const method of grpcStreamMethods) {
|
|
75
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
76
|
+
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const USERS_SERVICE_NAME = "UsersService";
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teacinema-nekoo/contracts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Protobuf definitions and generated TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"proto"
|
|
9
|
+
"proto",
|
|
10
|
+
"gen"
|
|
10
11
|
],
|
|
11
12
|
"publishConfig": {
|
|
12
13
|
"access": "public"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"generate": "
|
|
16
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,package=omit",
|
|
16
17
|
"build": "tsc -p tsconfig.build.json",
|
|
17
18
|
"prepublishOnly": "yarn generate && yarn build"
|
|
18
19
|
},
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package media.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "githib.com/teacinema-nekoo/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
|
+
// rpc GeneratePreview(GeneratePreviewRequest) returns (GeneratePreviewResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message UploadRequest {
|
|
16
|
+
string file_name = 1;
|
|
17
|
+
string folder = 2;
|
|
18
|
+
string content_type = 3;
|
|
19
|
+
bytes data = 4;
|
|
20
|
+
optional int32 resize_width = 5;
|
|
21
|
+
optional int32 resize_height = 6;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message UploadResponse {
|
|
25
|
+
string key = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message GetRequest {
|
|
29
|
+
string key = 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message GetResponse {
|
|
33
|
+
bytes data = 1;
|
|
34
|
+
string content_type = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message DeleteRequest {
|
|
38
|
+
string key = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message DeleteResponse {
|
|
42
|
+
bool ok = 1;
|
|
43
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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.19.1
|
|
6
|
-
// source: google/protobuf/empty.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
-
/* eslint-disable */
|
|
10
|
-
exports.protobufPackage = "google.protobuf";
|
|
11
|
-
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/dist/gen/users.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
export declare const protobufPackage = "users.v1";
|
|
3
|
-
export interface GetMeRequest {
|
|
4
|
-
id: string;
|
|
5
|
-
}
|
|
6
|
-
export interface GetMeResponse {
|
|
7
|
-
user: User | undefined;
|
|
8
|
-
}
|
|
9
|
-
export interface CreateUserRequest {
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CreateUserResponse {
|
|
13
|
-
ok: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface PatchUserRequest {
|
|
16
|
-
userId: string;
|
|
17
|
-
name?: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
export interface PatchUserResponse {
|
|
20
|
-
ok: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface User {
|
|
23
|
-
id: string;
|
|
24
|
-
name?: string | undefined;
|
|
25
|
-
phone?: string | undefined;
|
|
26
|
-
email?: string | undefined;
|
|
27
|
-
avatar?: string | undefined;
|
|
28
|
-
}
|
|
29
|
-
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
30
|
-
export interface UsersServiceClient {
|
|
31
|
-
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
32
|
-
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
33
|
-
patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
|
|
34
|
-
}
|
|
35
|
-
export interface UsersServiceController {
|
|
36
|
-
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
37
|
-
createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
38
|
-
patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
|
|
39
|
-
}
|
|
40
|
-
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
41
|
-
export declare const USERS_SERVICE_NAME = "UsersService";
|
package/dist/gen/users.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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.19.1
|
|
6
|
-
// source: users.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
-
exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
|
|
10
|
-
/* eslint-disable */
|
|
11
|
-
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
-
exports.protobufPackage = "users.v1";
|
|
13
|
-
exports.USERS_V1_PACKAGE_NAME = "users.v1";
|
|
14
|
-
function UsersServiceControllerMethods() {
|
|
15
|
-
return function (constructor) {
|
|
16
|
-
const grpcMethods = ["getMe", "createUser", "patchUser"];
|
|
17
|
-
for (const method of grpcMethods) {
|
|
18
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
-
(0, microservices_1.GrpcMethod)("UsersService", 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)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
exports.USERS_SERVICE_NAME = "UsersService";
|