@readytomog/contracts 1.1.12 → 1.2.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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/user.ts +65 -0
- package/package.json +1 -1
- package/proto/user.proto +33 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/user.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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: user.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "auth.v1";
|
|
12
|
+
|
|
13
|
+
export enum Role {
|
|
14
|
+
ROLE_UNSPECIFIED = 0,
|
|
15
|
+
ROLE_USER = 1,
|
|
16
|
+
ROLE_PARTICIPANT = 2,
|
|
17
|
+
ROLE_CREATOR = 3,
|
|
18
|
+
ROLE_ADMIN = 4,
|
|
19
|
+
UNRECOGNIZED = -1,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GetUserByIdRequst {
|
|
23
|
+
userId: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GetUserByIdResponse {
|
|
27
|
+
userId: number;
|
|
28
|
+
name: string;
|
|
29
|
+
surname: string;
|
|
30
|
+
isOtpVerified: boolean;
|
|
31
|
+
isEmailVerified: boolean;
|
|
32
|
+
isPhoneVerified: boolean;
|
|
33
|
+
isTwoFactorEnabled: boolean;
|
|
34
|
+
phone: string;
|
|
35
|
+
roles: Role[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
39
|
+
|
|
40
|
+
export interface UserServiceClient {
|
|
41
|
+
getUserById(request: GetUserByIdRequst): Observable<GetUserByIdResponse>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface UserServiceController {
|
|
45
|
+
getUserById(
|
|
46
|
+
request: GetUserByIdRequst,
|
|
47
|
+
): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function UserServiceControllerMethods() {
|
|
51
|
+
return function (constructor: Function) {
|
|
52
|
+
const grpcMethods: string[] = ["getUserById"];
|
|
53
|
+
for (const method of grpcMethods) {
|
|
54
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
55
|
+
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
56
|
+
}
|
|
57
|
+
const grpcStreamMethods: string[] = [];
|
|
58
|
+
for (const method of grpcStreamMethods) {
|
|
59
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
60
|
+
GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const USER_SERVICE_NAME = "UserService";
|
package/package.json
CHANGED
package/proto/user.proto
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
service UserService {
|
|
6
|
+
rpc GetUserById(GetUserByIdRequst) returns (GetUserByIdResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
message GetUserByIdRequst {
|
|
11
|
+
int32 userId = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
enum Role {
|
|
16
|
+
ROLE_UNSPECIFIED = 0;
|
|
17
|
+
ROLE_USER = 1;
|
|
18
|
+
ROLE_PARTICIPANT = 2;
|
|
19
|
+
ROLE_CREATOR = 3;
|
|
20
|
+
ROLE_ADMIN = 4;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GetUserByIdResponse{
|
|
24
|
+
int32 userId = 1;
|
|
25
|
+
string name = 2;
|
|
26
|
+
string surname = 3;
|
|
27
|
+
bool isOtpVerified = 4;
|
|
28
|
+
bool isEmailVerified = 5;
|
|
29
|
+
bool isPhoneVerified = 6;
|
|
30
|
+
bool isTwoFactorEnabled = 7;
|
|
31
|
+
string phone = 8;
|
|
32
|
+
repeated Role roles = 9;
|
|
33
|
+
}
|