@kottvideo/contracts 1.0.5 → 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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/account.ts +137 -0
- package/package.json +1 -1
- package/proto/account.proto +73 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/account.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
/** Email change */
|
|
33
|
+
export interface BeginEmailChangeRequest {
|
|
34
|
+
userId: string;
|
|
35
|
+
email: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BeginEmailChangeResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConfirmEmailChangeRequest {
|
|
43
|
+
userId: string;
|
|
44
|
+
email: string;
|
|
45
|
+
code: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ConfirmEmailChangeResponse {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Phone change */
|
|
53
|
+
export interface BeginPhoneChangeRequest {
|
|
54
|
+
userId: string;
|
|
55
|
+
phone: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface BeginPhoneChangeResponse {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ConfirmPhoneChangeRequest {
|
|
63
|
+
userId: string;
|
|
64
|
+
phone: string;
|
|
65
|
+
code: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ConfirmPhoneChangeResponse {
|
|
69
|
+
ok: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
73
|
+
|
|
74
|
+
export interface AccountServiceClient {
|
|
75
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
76
|
+
|
|
77
|
+
/** Email change */
|
|
78
|
+
|
|
79
|
+
beginEmailChange(request: BeginEmailChangeRequest): Observable<BeginEmailChangeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
82
|
+
|
|
83
|
+
/** Phone Change */
|
|
84
|
+
|
|
85
|
+
beginPhoneChange(request: BeginPhoneChangeRequest): Observable<BeginPhoneChangeResponse>;
|
|
86
|
+
|
|
87
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AccountServiceController {
|
|
91
|
+
getAccount(
|
|
92
|
+
request: GetAccountRequest,
|
|
93
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
94
|
+
|
|
95
|
+
/** Email change */
|
|
96
|
+
|
|
97
|
+
beginEmailChange(
|
|
98
|
+
request: BeginEmailChangeRequest,
|
|
99
|
+
): Promise<BeginEmailChangeResponse> | Observable<BeginEmailChangeResponse> | BeginEmailChangeResponse;
|
|
100
|
+
|
|
101
|
+
confirmEmailChange(
|
|
102
|
+
request: ConfirmEmailChangeRequest,
|
|
103
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
104
|
+
|
|
105
|
+
/** Phone Change */
|
|
106
|
+
|
|
107
|
+
beginPhoneChange(
|
|
108
|
+
request: BeginPhoneChangeRequest,
|
|
109
|
+
): Promise<BeginPhoneChangeResponse> | Observable<BeginPhoneChangeResponse> | BeginPhoneChangeResponse;
|
|
110
|
+
|
|
111
|
+
confirmPhoneChange(
|
|
112
|
+
request: ConfirmPhoneChangeRequest,
|
|
113
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function AccountServiceControllerMethods() {
|
|
117
|
+
return function (constructor: Function) {
|
|
118
|
+
const grpcMethods: string[] = [
|
|
119
|
+
"getAccount",
|
|
120
|
+
"beginEmailChange",
|
|
121
|
+
"confirmEmailChange",
|
|
122
|
+
"beginPhoneChange",
|
|
123
|
+
"confirmPhoneChange",
|
|
124
|
+
];
|
|
125
|
+
for (const method of grpcMethods) {
|
|
126
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
127
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
128
|
+
}
|
|
129
|
+
const grpcStreamMethods: string[] = [];
|
|
130
|
+
for (const method of grpcStreamMethods) {
|
|
131
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
132
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
6
|
+
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
|
|
8
|
+
// Email change
|
|
9
|
+
rpc BeginEmailChange (BeginEmailChangeRequest) returns (BeginEmailChangeResponse);
|
|
10
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
11
|
+
|
|
12
|
+
// Phone Change
|
|
13
|
+
rpc BeginPhoneChange (BeginPhoneChangeRequest) returns (BeginPhoneChangeResponse);
|
|
14
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message GetAccountRequest {
|
|
18
|
+
string id = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message GetAccountResponse {
|
|
22
|
+
string id = 1;
|
|
23
|
+
string phone = 2;
|
|
24
|
+
string email = 3;
|
|
25
|
+
bool is_phone_verified = 4;
|
|
26
|
+
bool is_email_verified = 5;
|
|
27
|
+
Role role = 6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Email change
|
|
31
|
+
message BeginEmailChangeRequest {
|
|
32
|
+
string user_id = 1;
|
|
33
|
+
string email = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message BeginEmailChangeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message ConfirmEmailChangeRequest {
|
|
41
|
+
string user_id = 1;
|
|
42
|
+
string email = 2;
|
|
43
|
+
string code = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message ConfirmEmailChangeResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Phone change
|
|
51
|
+
message BeginPhoneChangeRequest {
|
|
52
|
+
string user_id = 1;
|
|
53
|
+
string phone = 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message BeginPhoneChangeResponse {
|
|
57
|
+
bool ok = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message ConfirmPhoneChangeRequest {
|
|
61
|
+
string user_id = 1;
|
|
62
|
+
string phone = 2;
|
|
63
|
+
string code = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ConfirmPhoneChangeResponse {
|
|
67
|
+
bool ok = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
enum Role {
|
|
71
|
+
USER = 0;
|
|
72
|
+
ADMIN = 1;
|
|
73
|
+
}
|