@teacodersquad/contracts 1.0.0 → 1.1.1
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 -1
- package/package.json +1 -1
- package/proto/auth.proto +20 -0
package/gen/auth.ts
CHANGED
|
@@ -10,6 +10,13 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export enum SuperEnum {
|
|
14
|
+
DEFAULT_VALUE = 0,
|
|
15
|
+
IS_ADMIN = 1,
|
|
16
|
+
IS_USER = 2,
|
|
17
|
+
UNRECOGNIZED = -1,
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
export interface SendOtpRequest {
|
|
14
21
|
identifier: string;
|
|
15
22
|
type: string;
|
|
@@ -19,19 +26,32 @@ export interface SendOtpResponse {
|
|
|
19
26
|
ok: boolean;
|
|
20
27
|
}
|
|
21
28
|
|
|
29
|
+
export interface DebugTestValue {
|
|
30
|
+
isDebug: boolean;
|
|
31
|
+
age: number;
|
|
32
|
+
name: string;
|
|
33
|
+
email?: string | undefined;
|
|
34
|
+
phone?: string | undefined;
|
|
35
|
+
myEnum: SuperEnum;
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
39
|
|
|
24
40
|
export interface AuthServiceClient {
|
|
25
41
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
42
|
+
|
|
43
|
+
test(request: DebugTestValue): Observable<DebugTestValue>;
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
export interface AuthServiceController {
|
|
29
47
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
48
|
+
|
|
49
|
+
test(request: DebugTestValue): Promise<DebugTestValue> | Observable<DebugTestValue> | DebugTestValue;
|
|
30
50
|
}
|
|
31
51
|
|
|
32
52
|
export function AuthServiceControllerMethods() {
|
|
33
53
|
return function (constructor: Function) {
|
|
34
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
54
|
+
const grpcMethods: string[] = ["sendOtp", "test"];
|
|
35
55
|
for (const method of grpcMethods) {
|
|
36
56
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
37
57
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -4,6 +4,8 @@ package auth.v1;
|
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
+
|
|
8
|
+
rpc Test (DebugTestValue) returns (DebugTestValue);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
|
|
@@ -14,4 +16,22 @@ message SendOtpRequest {
|
|
|
14
16
|
|
|
15
17
|
message SendOtpResponse {
|
|
16
18
|
bool ok = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message DebugTestValue {
|
|
22
|
+
bool is_debug = 1;
|
|
23
|
+
int32 age = 2;
|
|
24
|
+
string name = 3;
|
|
25
|
+
oneof type {
|
|
26
|
+
string email = 4;
|
|
27
|
+
string phone = 5;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
SuperEnum my_enum = 6;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
enum SuperEnum {
|
|
34
|
+
DEFAULT_VALUE = 0;
|
|
35
|
+
IS_ADMIN = 1;
|
|
36
|
+
IS_USER = 2;
|
|
17
37
|
}
|