@mediaryorg/contracts 1.0.7 → 1.0.10
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/generated/auth/v1/auth.ts +59 -51
- package/generated/profile/v1/profile.ts +73 -0
- package/generated/user/v1/user.ts +103 -2
- package/package.json +3 -3
- package/proto/auth/v1/auth.proto +57 -52
- package/proto/profile/v1/profile.proto +35 -0
- package/proto/user/v1/user.proto +66 -4
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -6,6 +6,7 @@ const PROTO_DIR = (0, path_1.join)(__dirname, "../../proto");
|
|
|
6
6
|
exports.PROTO_PATH = {
|
|
7
7
|
AUTH: (0, path_1.join)(PROTO_DIR, "auth/v1/auth.proto"),
|
|
8
8
|
USER: (0, path_1.join)(PROTO_DIR, "user/v1/user.proto"),
|
|
9
|
+
PROFILE: (0, path_1.join)(PROTO_DIR, "profile/v1/profile.proto"),
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Root directories for protobuf imports.
|
|
@@ -7,60 +7,15 @@
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
-
import { User } from "../../user/v1/user";
|
|
11
10
|
|
|
12
11
|
export const protobufPackage = "auth.v1";
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface ConfirmEmailResponse {
|
|
21
|
-
user: User | undefined;
|
|
22
|
-
sessionId: string;
|
|
23
|
-
maxAgeMs: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface OauthCallbackResponse {
|
|
27
|
-
user: User | undefined;
|
|
28
|
-
sessionId: string;
|
|
29
|
-
maxAgeMs: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface AdminLoginResponse {
|
|
33
|
-
user: User | undefined;
|
|
34
|
-
sessionId: string;
|
|
35
|
-
maxAgeMs: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ValidateSessionResponse {
|
|
39
|
-
valid: boolean;
|
|
40
|
-
user: User | undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface AdminValidateSessionResponse {
|
|
44
|
-
valid: boolean;
|
|
45
|
-
user: User | undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface ResendVerificationResponse {
|
|
49
|
-
message: string;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface RequestPasswordResetResponse {
|
|
53
|
-
message: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface SetNewPasswordResponse {
|
|
57
|
-
message: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface LogoutResponse {
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface AdminLogoutResponse {
|
|
13
|
+
/** Identity-only view of a user emitted by auth-service. */
|
|
14
|
+
export interface AuthUser {
|
|
15
|
+
id: string;
|
|
16
|
+
email: string;
|
|
17
|
+
role: string;
|
|
18
|
+
isVerified: boolean;
|
|
64
19
|
}
|
|
65
20
|
|
|
66
21
|
export interface RegisterRequest {
|
|
@@ -80,33 +35,65 @@ export interface LoginRequest {
|
|
|
80
35
|
password: string;
|
|
81
36
|
}
|
|
82
37
|
|
|
38
|
+
export interface LoginResponse {
|
|
39
|
+
user: AuthUser | undefined;
|
|
40
|
+
sessionId: string;
|
|
41
|
+
maxAgeMs: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
83
44
|
export interface LogoutRequest {
|
|
84
45
|
sessionId: string;
|
|
85
46
|
}
|
|
86
47
|
|
|
48
|
+
export interface LogoutResponse {
|
|
49
|
+
}
|
|
50
|
+
|
|
87
51
|
export interface ValidateSessionRequest {
|
|
88
52
|
sessionId: string;
|
|
89
53
|
}
|
|
90
54
|
|
|
55
|
+
export interface ValidateSessionResponse {
|
|
56
|
+
valid: boolean;
|
|
57
|
+
user: AuthUser | undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
91
60
|
export interface ConfirmEmailRequest {
|
|
92
61
|
email: string;
|
|
93
62
|
code: string;
|
|
94
63
|
}
|
|
95
64
|
|
|
65
|
+
export interface ConfirmEmailResponse {
|
|
66
|
+
user: AuthUser | undefined;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
maxAgeMs: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
96
71
|
export interface ResendVerificationRequest {
|
|
97
72
|
email: string;
|
|
98
73
|
}
|
|
99
74
|
|
|
75
|
+
export interface ResendVerificationResponse {
|
|
76
|
+
message: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
100
79
|
export interface RequestPasswordResetRequest {
|
|
101
80
|
email: string;
|
|
102
81
|
}
|
|
103
82
|
|
|
83
|
+
export interface RequestPasswordResetResponse {
|
|
84
|
+
message: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
104
87
|
export interface SetNewPasswordRequest {
|
|
105
88
|
email: string;
|
|
106
89
|
code: string;
|
|
107
90
|
password: string;
|
|
108
91
|
}
|
|
109
92
|
|
|
93
|
+
export interface SetNewPasswordResponse {
|
|
94
|
+
message: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
110
97
|
export interface OauthConnectRequest {
|
|
111
98
|
provider: string;
|
|
112
99
|
}
|
|
@@ -118,6 +105,13 @@ export interface OauthConnectResponse {
|
|
|
118
105
|
export interface OauthCallbackRequest {
|
|
119
106
|
provider: string;
|
|
120
107
|
code: string;
|
|
108
|
+
state: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface OauthCallbackResponse {
|
|
112
|
+
user: AuthUser | undefined;
|
|
113
|
+
sessionId: string;
|
|
114
|
+
maxAgeMs: number;
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
export interface AdminLoginRequest {
|
|
@@ -125,14 +119,28 @@ export interface AdminLoginRequest {
|
|
|
125
119
|
password: string;
|
|
126
120
|
}
|
|
127
121
|
|
|
122
|
+
export interface AdminLoginResponse {
|
|
123
|
+
user: AuthUser | undefined;
|
|
124
|
+
sessionId: string;
|
|
125
|
+
maxAgeMs: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
128
|
export interface AdminLogoutRequest {
|
|
129
129
|
sessionId: string;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
export interface AdminLogoutResponse {
|
|
133
|
+
}
|
|
134
|
+
|
|
132
135
|
export interface AdminValidateSessionRequest {
|
|
133
136
|
sessionId: string;
|
|
134
137
|
}
|
|
135
138
|
|
|
139
|
+
export interface AdminValidateSessionResponse {
|
|
140
|
+
valid: boolean;
|
|
141
|
+
user: AuthUser | undefined;
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
137
145
|
|
|
138
146
|
export interface AuthServiceClient {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: profile/v1/profile.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "profile.v1";
|
|
12
|
+
|
|
13
|
+
export interface Profile {
|
|
14
|
+
id: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
picture: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GetProfileByUserIdRequest {
|
|
23
|
+
userId: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GetProfileByUserIdResponse {
|
|
27
|
+
profile: Profile | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface UpdateProfileRequest {
|
|
31
|
+
userId: string;
|
|
32
|
+
displayName?: string | undefined;
|
|
33
|
+
picture?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface UpdateProfileResponse {
|
|
37
|
+
profile: Profile | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const PROFILE_V1_PACKAGE_NAME = "profile.v1";
|
|
41
|
+
|
|
42
|
+
export interface ProfileServiceClient {
|
|
43
|
+
getProfileByUserId(request: GetProfileByUserIdRequest): Observable<GetProfileByUserIdResponse>;
|
|
44
|
+
|
|
45
|
+
updateProfile(request: UpdateProfileRequest): Observable<UpdateProfileResponse>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ProfileServiceController {
|
|
49
|
+
getProfileByUserId(
|
|
50
|
+
request: GetProfileByUserIdRequest,
|
|
51
|
+
): Promise<GetProfileByUserIdResponse> | Observable<GetProfileByUserIdResponse> | GetProfileByUserIdResponse;
|
|
52
|
+
|
|
53
|
+
updateProfile(
|
|
54
|
+
request: UpdateProfileRequest,
|
|
55
|
+
): Promise<UpdateProfileResponse> | Observable<UpdateProfileResponse> | UpdateProfileResponse;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ProfileServiceControllerMethods() {
|
|
59
|
+
return function (constructor: Function) {
|
|
60
|
+
const grpcMethods: string[] = ["getProfileByUserId", "updateProfile"];
|
|
61
|
+
for (const method of grpcMethods) {
|
|
62
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
+
GrpcMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
+
}
|
|
65
|
+
const grpcStreamMethods: string[] = [];
|
|
66
|
+
for (const method of grpcStreamMethods) {
|
|
67
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
+
GrpcStreamMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const PROFILE_SERVICE_NAME = "ProfileService";
|
|
@@ -16,12 +16,22 @@ export interface User {
|
|
|
16
16
|
displayName: string;
|
|
17
17
|
picture: string;
|
|
18
18
|
role: string;
|
|
19
|
-
authProvider: string;
|
|
20
19
|
isVerified: boolean;
|
|
21
20
|
createdAt: string;
|
|
22
21
|
updatedAt: string;
|
|
23
22
|
}
|
|
24
23
|
|
|
24
|
+
export interface CreateUserRequest {
|
|
25
|
+
email: string;
|
|
26
|
+
displayName: string;
|
|
27
|
+
picture: string;
|
|
28
|
+
isVerified: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CreateUserResponse {
|
|
32
|
+
user: User | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
export interface GetUserByIdRequest {
|
|
26
36
|
userId: string;
|
|
27
37
|
}
|
|
@@ -30,21 +40,112 @@ export interface GetUserByIdResponse {
|
|
|
30
40
|
user: User | undefined;
|
|
31
41
|
}
|
|
32
42
|
|
|
43
|
+
export interface GetUserByEmailRequest {
|
|
44
|
+
email: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface GetUserByEmailResponse {
|
|
48
|
+
user: User | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface UpdateUserRequest {
|
|
52
|
+
userId: string;
|
|
53
|
+
email?: string | undefined;
|
|
54
|
+
displayName?: string | undefined;
|
|
55
|
+
picture?: string | undefined;
|
|
56
|
+
role?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface UpdateUserResponse {
|
|
60
|
+
user: User | undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface MarkUserVerifiedRequest {
|
|
64
|
+
userId: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface MarkUserVerifiedResponse {
|
|
68
|
+
user: User | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DeleteUserRequest {
|
|
72
|
+
userId: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DeleteUserResponse {
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface UpsertUserFromOAuthRequest {
|
|
79
|
+
email: string;
|
|
80
|
+
displayName: string;
|
|
81
|
+
picture: string;
|
|
82
|
+
isVerified: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface UpsertUserFromOAuthResponse {
|
|
86
|
+
user: User | undefined;
|
|
87
|
+
created: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
33
90
|
export const USER_V1_PACKAGE_NAME = "user.v1";
|
|
34
91
|
|
|
35
92
|
export interface UserServiceClient {
|
|
93
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
94
|
+
|
|
36
95
|
getUserById(request: GetUserByIdRequest): Observable<GetUserByIdResponse>;
|
|
96
|
+
|
|
97
|
+
getUserByEmail(request: GetUserByEmailRequest): Observable<GetUserByEmailResponse>;
|
|
98
|
+
|
|
99
|
+
updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
|
|
100
|
+
|
|
101
|
+
markUserVerified(request: MarkUserVerifiedRequest): Observable<MarkUserVerifiedResponse>;
|
|
102
|
+
|
|
103
|
+
deleteUser(request: DeleteUserRequest): Observable<DeleteUserResponse>;
|
|
104
|
+
|
|
105
|
+
upsertUserFromOAuth(request: UpsertUserFromOAuthRequest): Observable<UpsertUserFromOAuthResponse>;
|
|
37
106
|
}
|
|
38
107
|
|
|
39
108
|
export interface UserServiceController {
|
|
109
|
+
createUser(
|
|
110
|
+
request: CreateUserRequest,
|
|
111
|
+
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
112
|
+
|
|
40
113
|
getUserById(
|
|
41
114
|
request: GetUserByIdRequest,
|
|
42
115
|
): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
|
|
116
|
+
|
|
117
|
+
getUserByEmail(
|
|
118
|
+
request: GetUserByEmailRequest,
|
|
119
|
+
): Promise<GetUserByEmailResponse> | Observable<GetUserByEmailResponse> | GetUserByEmailResponse;
|
|
120
|
+
|
|
121
|
+
updateUser(
|
|
122
|
+
request: UpdateUserRequest,
|
|
123
|
+
): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
|
|
124
|
+
|
|
125
|
+
markUserVerified(
|
|
126
|
+
request: MarkUserVerifiedRequest,
|
|
127
|
+
): Promise<MarkUserVerifiedResponse> | Observable<MarkUserVerifiedResponse> | MarkUserVerifiedResponse;
|
|
128
|
+
|
|
129
|
+
deleteUser(
|
|
130
|
+
request: DeleteUserRequest,
|
|
131
|
+
): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
|
|
132
|
+
|
|
133
|
+
upsertUserFromOAuth(
|
|
134
|
+
request: UpsertUserFromOAuthRequest,
|
|
135
|
+
): Promise<UpsertUserFromOAuthResponse> | Observable<UpsertUserFromOAuthResponse> | UpsertUserFromOAuthResponse;
|
|
43
136
|
}
|
|
44
137
|
|
|
45
138
|
export function UserServiceControllerMethods() {
|
|
46
139
|
return function (constructor: Function) {
|
|
47
|
-
const grpcMethods: string[] = [
|
|
140
|
+
const grpcMethods: string[] = [
|
|
141
|
+
"createUser",
|
|
142
|
+
"getUserById",
|
|
143
|
+
"getUserByEmail",
|
|
144
|
+
"updateUser",
|
|
145
|
+
"markUserVerified",
|
|
146
|
+
"deleteUser",
|
|
147
|
+
"upsertUserFromOAuth",
|
|
148
|
+
];
|
|
48
149
|
for (const method of grpcMethods) {
|
|
49
150
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
50
151
|
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediaryorg/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Protobuf definitions and generated TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"generate": "npm run generate:win",
|
|
9
|
-
"generate:win": "protoc -I .\\proto .\\proto\\auth\\v1\\auth.proto .\\proto\\user\\v1\\user.proto --plugin=protoc-gen-ts_proto=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=.\\generated --ts_proto_opt=nestJs=true,package=omit",
|
|
10
|
-
"generate:ci": "protoc -I ./proto ./proto/auth/v1/auth.proto ./proto/user/v1/user.proto --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit",
|
|
9
|
+
"generate:win": "protoc -I .\\proto .\\proto\\auth\\v1\\auth.proto .\\proto\\user\\v1\\user.proto .\\proto\\profile\\v1\\profile.proto --plugin=protoc-gen-ts_proto=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=.\\generated --ts_proto_opt=nestJs=true,package=omit",
|
|
10
|
+
"generate:ci": "protoc -I ./proto ./proto/auth/v1/auth.proto ./proto/user/v1/user.proto ./proto/profile/v1/profile.proto --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit",
|
|
11
11
|
"build": "tsc -p tsconfig.build.json"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -2,8 +2,6 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
-
import "user/v1/user.proto";
|
|
6
|
-
|
|
7
5
|
service AuthService {
|
|
8
6
|
rpc Register(RegisterRequest) returns (RegisterResponse);
|
|
9
7
|
|
|
@@ -25,58 +23,14 @@ service AuthService {
|
|
|
25
23
|
rpc AdminValidateSession(AdminValidateSessionRequest) returns (AdminValidateSessionResponse);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
string
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
message ConfirmEmailResponse {
|
|
35
|
-
user.v1.User user = 1;
|
|
36
|
-
string session_id = 2;
|
|
37
|
-
int64 max_age_ms = 3;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
message OauthCallbackResponse {
|
|
41
|
-
user.v1.User user = 1;
|
|
42
|
-
string session_id = 2;
|
|
43
|
-
int64 max_age_ms = 3;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message AdminLoginResponse {
|
|
47
|
-
user.v1.User user = 1;
|
|
48
|
-
string session_id = 2;
|
|
49
|
-
int64 max_age_ms = 3;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message ValidateSessionResponse {
|
|
53
|
-
bool valid = 1;
|
|
54
|
-
user.v1.User user = 2;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
message AdminValidateSessionResponse {
|
|
58
|
-
bool valid = 1;
|
|
59
|
-
user.v1.User user = 2;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
message ResendVerificationResponse {
|
|
63
|
-
string message = 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message RequestPasswordResetResponse {
|
|
67
|
-
string message = 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message SetNewPasswordResponse {
|
|
71
|
-
string message = 1;
|
|
26
|
+
// Identity-only view of a user emitted by auth-service.
|
|
27
|
+
message AuthUser {
|
|
28
|
+
string id = 1;
|
|
29
|
+
string email = 2;
|
|
30
|
+
string role = 3;
|
|
31
|
+
bool is_verified = 4;
|
|
72
32
|
}
|
|
73
33
|
|
|
74
|
-
message LogoutResponse {}
|
|
75
|
-
|
|
76
|
-
message AdminLogoutResponse {}
|
|
77
|
-
|
|
78
|
-
// --- Requests ---
|
|
79
|
-
|
|
80
34
|
message RegisterRequest {
|
|
81
35
|
string name = 1;
|
|
82
36
|
string email = 2;
|
|
@@ -94,33 +48,64 @@ message LoginRequest {
|
|
|
94
48
|
string password = 2;
|
|
95
49
|
}
|
|
96
50
|
|
|
51
|
+
message LoginResponse {
|
|
52
|
+
AuthUser user = 1;
|
|
53
|
+
string session_id = 2;
|
|
54
|
+
int64 max_age_ms = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
97
57
|
message LogoutRequest {
|
|
98
58
|
string session_id = 1;
|
|
99
59
|
}
|
|
100
60
|
|
|
61
|
+
message LogoutResponse {}
|
|
62
|
+
|
|
101
63
|
message ValidateSessionRequest {
|
|
102
64
|
string session_id = 1;
|
|
103
65
|
}
|
|
104
66
|
|
|
67
|
+
message ValidateSessionResponse {
|
|
68
|
+
bool valid = 1;
|
|
69
|
+
AuthUser user = 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
105
72
|
message ConfirmEmailRequest {
|
|
106
73
|
string email = 1;
|
|
107
74
|
string code = 2;
|
|
108
75
|
}
|
|
109
76
|
|
|
77
|
+
message ConfirmEmailResponse {
|
|
78
|
+
AuthUser user = 1;
|
|
79
|
+
string session_id = 2;
|
|
80
|
+
int64 max_age_ms = 3;
|
|
81
|
+
}
|
|
82
|
+
|
|
110
83
|
message ResendVerificationRequest {
|
|
111
84
|
string email = 1;
|
|
112
85
|
}
|
|
113
86
|
|
|
87
|
+
message ResendVerificationResponse {
|
|
88
|
+
string message = 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
114
91
|
message RequestPasswordResetRequest {
|
|
115
92
|
string email = 1;
|
|
116
93
|
}
|
|
117
94
|
|
|
95
|
+
message RequestPasswordResetResponse {
|
|
96
|
+
string message = 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
118
99
|
message SetNewPasswordRequest {
|
|
119
100
|
string email = 1;
|
|
120
101
|
string code = 2;
|
|
121
102
|
string password = 3;
|
|
122
103
|
}
|
|
123
104
|
|
|
105
|
+
message SetNewPasswordResponse {
|
|
106
|
+
string message = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
124
109
|
message OauthConnectRequest {
|
|
125
110
|
string provider = 1;
|
|
126
111
|
}
|
|
@@ -132,6 +117,13 @@ message OauthConnectResponse {
|
|
|
132
117
|
message OauthCallbackRequest {
|
|
133
118
|
string provider = 1;
|
|
134
119
|
string code = 2;
|
|
120
|
+
string state = 3;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message OauthCallbackResponse {
|
|
124
|
+
AuthUser user = 1;
|
|
125
|
+
string session_id = 2;
|
|
126
|
+
int64 max_age_ms = 3;
|
|
135
127
|
}
|
|
136
128
|
|
|
137
129
|
message AdminLoginRequest {
|
|
@@ -139,10 +131,23 @@ message AdminLoginRequest {
|
|
|
139
131
|
string password = 2;
|
|
140
132
|
}
|
|
141
133
|
|
|
134
|
+
message AdminLoginResponse {
|
|
135
|
+
AuthUser user = 1;
|
|
136
|
+
string session_id = 2;
|
|
137
|
+
int64 max_age_ms = 3;
|
|
138
|
+
}
|
|
139
|
+
|
|
142
140
|
message AdminLogoutRequest {
|
|
143
141
|
string session_id = 1;
|
|
144
142
|
}
|
|
145
143
|
|
|
144
|
+
message AdminLogoutResponse {}
|
|
145
|
+
|
|
146
146
|
message AdminValidateSessionRequest {
|
|
147
147
|
string session_id = 1;
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
message AdminValidateSessionResponse {
|
|
151
|
+
bool valid = 1;
|
|
152
|
+
AuthUser user = 2;
|
|
153
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package profile.v1;
|
|
4
|
+
|
|
5
|
+
service ProfileService {
|
|
6
|
+
rpc GetProfileByUserId(GetProfileByUserIdRequest) returns (GetProfileByUserIdResponse);
|
|
7
|
+
rpc UpdateProfile(UpdateProfileRequest) returns (UpdateProfileResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message Profile {
|
|
11
|
+
string id = 1;
|
|
12
|
+
string user_id = 2;
|
|
13
|
+
string display_name = 3;
|
|
14
|
+
string picture = 4;
|
|
15
|
+
string created_at = 5;
|
|
16
|
+
string updated_at = 6;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetProfileByUserIdRequest {
|
|
20
|
+
string user_id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GetProfileByUserIdResponse {
|
|
24
|
+
Profile profile = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message UpdateProfileRequest {
|
|
28
|
+
string user_id = 1;
|
|
29
|
+
optional string display_name = 2;
|
|
30
|
+
optional string picture = 3;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message UpdateProfileResponse {
|
|
34
|
+
Profile profile = 1;
|
|
35
|
+
}
|
package/proto/user/v1/user.proto
CHANGED
|
@@ -3,7 +3,13 @@ syntax = "proto3";
|
|
|
3
3
|
package user.v1;
|
|
4
4
|
|
|
5
5
|
service UserService {
|
|
6
|
+
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
|
|
6
7
|
rpc GetUserById(GetUserByIdRequest) returns (GetUserByIdResponse);
|
|
8
|
+
rpc GetUserByEmail(GetUserByEmailRequest) returns (GetUserByEmailResponse);
|
|
9
|
+
rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse);
|
|
10
|
+
rpc MarkUserVerified(MarkUserVerifiedRequest) returns (MarkUserVerifiedResponse);
|
|
11
|
+
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
|
|
12
|
+
rpc UpsertUserFromOAuth(UpsertUserFromOAuthRequest) returns (UpsertUserFromOAuthResponse);
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
message User {
|
|
@@ -12,10 +18,20 @@ message User {
|
|
|
12
18
|
string display_name = 3;
|
|
13
19
|
string picture = 4;
|
|
14
20
|
string role = 5;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
string
|
|
18
|
-
|
|
21
|
+
bool is_verified = 6;
|
|
22
|
+
string created_at = 7;
|
|
23
|
+
string updated_at = 8;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message CreateUserRequest {
|
|
27
|
+
string email = 1;
|
|
28
|
+
string display_name = 2;
|
|
29
|
+
string picture = 3;
|
|
30
|
+
bool is_verified = 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message CreateUserResponse {
|
|
34
|
+
User user = 1;
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
message GetUserByIdRequest {
|
|
@@ -25,3 +41,49 @@ message GetUserByIdRequest {
|
|
|
25
41
|
message GetUserByIdResponse {
|
|
26
42
|
User user = 1;
|
|
27
43
|
}
|
|
44
|
+
|
|
45
|
+
message GetUserByEmailRequest {
|
|
46
|
+
string email = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message GetUserByEmailResponse {
|
|
50
|
+
User user = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message UpdateUserRequest {
|
|
54
|
+
string user_id = 1;
|
|
55
|
+
optional string email = 2;
|
|
56
|
+
optional string display_name = 3;
|
|
57
|
+
optional string picture = 4;
|
|
58
|
+
optional string role = 5;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message UpdateUserResponse {
|
|
62
|
+
User user = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message MarkUserVerifiedRequest {
|
|
66
|
+
string user_id = 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message MarkUserVerifiedResponse {
|
|
70
|
+
User user = 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message DeleteUserRequest {
|
|
74
|
+
string user_id = 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message DeleteUserResponse {}
|
|
78
|
+
|
|
79
|
+
message UpsertUserFromOAuthRequest {
|
|
80
|
+
string email = 1;
|
|
81
|
+
string display_name = 2;
|
|
82
|
+
string picture = 3;
|
|
83
|
+
bool is_verified = 4;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message UpsertUserFromOAuthResponse {
|
|
87
|
+
User user = 1;
|
|
88
|
+
bool created = 2;
|
|
89
|
+
}
|