@readytomog/contracts 1.1.0 → 1.1.2
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/auth.ts +21 -2
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +1 -1
- package/proto/auth.proto +22 -5
package/gen/auth.ts
CHANGED
|
@@ -16,25 +16,44 @@ export interface LoginRequest {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface LoginResponse {
|
|
19
|
-
|
|
19
|
+
accessToken: string;
|
|
20
|
+
refreshToken: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RegistrationRequest {
|
|
20
24
|
email: string;
|
|
21
25
|
name: string;
|
|
22
26
|
surname: string;
|
|
27
|
+
password: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RegistrationResponse {
|
|
31
|
+
message: string;
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
26
35
|
|
|
27
36
|
export interface AuthServiceClient {
|
|
28
37
|
login(request: LoginRequest): Observable<LoginResponse>;
|
|
38
|
+
|
|
39
|
+
/** rpc Logout (google.protobuf.Empty) returns (LogoutResponse); */
|
|
40
|
+
|
|
41
|
+
registration(request: RegistrationRequest): Observable<RegistrationResponse>;
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
export interface AuthServiceController {
|
|
32
45
|
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
46
|
+
|
|
47
|
+
/** rpc Logout (google.protobuf.Empty) returns (LogoutResponse); */
|
|
48
|
+
|
|
49
|
+
registration(
|
|
50
|
+
request: RegistrationRequest,
|
|
51
|
+
): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
|
|
33
52
|
}
|
|
34
53
|
|
|
35
54
|
export function AuthServiceControllerMethods() {
|
|
36
55
|
return function (constructor: Function) {
|
|
37
|
-
const grpcMethods: string[] = ["login"];
|
|
56
|
+
const grpcMethods: string[] = ["login", "registration"];
|
|
38
57
|
for (const method of grpcMethods) {
|
|
39
58
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
40
59
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
14
|
+
* or the response type of an API method. For instance:
|
|
15
|
+
*
|
|
16
|
+
* service Foo {
|
|
17
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface Empty {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -2,8 +2,12 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
service AuthService {
|
|
6
8
|
rpc Login (LoginRequest) returns (LoginResponse);
|
|
9
|
+
rpc Registration (RegistrationRequest) returns (RegistrationResponse);
|
|
10
|
+
// rpc Logout (google.protobuf.Empty) returns (LogoutResponse);
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
message LoginRequest {
|
|
@@ -12,8 +16,21 @@ message LoginRequest {
|
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
message LoginResponse {
|
|
15
|
-
string
|
|
16
|
-
string
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
string accessToken = 1;
|
|
20
|
+
string refreshToken = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message RegistrationRequest {
|
|
24
|
+
string email = 1;
|
|
25
|
+
string name = 2;
|
|
26
|
+
string surname = 3;
|
|
27
|
+
string password = 4;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message RegistrationResponse {
|
|
31
|
+
string message = 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// message LogoutResponse {
|
|
35
|
+
// string message = 1;
|
|
36
|
+
// }
|