@nexiolab/contracts 1.0.12 → 1.0.14
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/account.ts +86 -2
- package/gen/auth.ts +40 -2
- package/gen/example.ts +1 -1
- package/gen/google/protobuf/any.ts +1 -1
- package/gen/google/protobuf/duration.ts +1 -1
- package/gen/google/protobuf/empty.ts +1 -1
- package/gen/google/protobuf/struct.ts +1 -1
- package/gen/google/protobuf/timestamp.ts +1 -1
- package/package.json +1 -1
- package/proto/account.proto +46 -0
- package/proto/auth.proto +26 -3
package/gen/account.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.1
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: account.proto
|
|
6
6
|
|
|
@@ -29,6 +29,44 @@ export interface GetAccountResponse {
|
|
|
29
29
|
role: Role;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export interface InitEmailChangeRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InitEmailChangeResponse {
|
|
38
|
+
ok: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ConfirmEmailChangeRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
code: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailChangeResponse {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
phone: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface InitPhoneChangeResponse {
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ConfirmPhoneChangeRequest {
|
|
61
|
+
phone: string;
|
|
62
|
+
code: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConfirmPhoneChangeResponse {
|
|
67
|
+
ok: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
32
70
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
33
71
|
|
|
34
72
|
/** AccountService provides account related operations */
|
|
@@ -37,6 +75,22 @@ export interface AccountServiceClient {
|
|
|
37
75
|
/** GetAccount returns account */
|
|
38
76
|
|
|
39
77
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
78
|
+
|
|
79
|
+
/** Initializes email changing */
|
|
80
|
+
|
|
81
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
82
|
+
|
|
83
|
+
/** Confirms email changing */
|
|
84
|
+
|
|
85
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
86
|
+
|
|
87
|
+
/** Initializes email changing */
|
|
88
|
+
|
|
89
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
90
|
+
|
|
91
|
+
/** Confirms email changing */
|
|
92
|
+
|
|
93
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
40
94
|
}
|
|
41
95
|
|
|
42
96
|
/** AccountService provides account related operations */
|
|
@@ -47,11 +101,41 @@ export interface AccountServiceController {
|
|
|
47
101
|
getAccount(
|
|
48
102
|
request: GetAccountRequest,
|
|
49
103
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
104
|
+
|
|
105
|
+
/** Initializes email changing */
|
|
106
|
+
|
|
107
|
+
initEmailChange(
|
|
108
|
+
request: InitEmailChangeRequest,
|
|
109
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
110
|
+
|
|
111
|
+
/** Confirms email changing */
|
|
112
|
+
|
|
113
|
+
confirmEmailChange(
|
|
114
|
+
request: ConfirmEmailChangeRequest,
|
|
115
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
116
|
+
|
|
117
|
+
/** Initializes email changing */
|
|
118
|
+
|
|
119
|
+
initPhoneChange(
|
|
120
|
+
request: InitPhoneChangeRequest,
|
|
121
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
122
|
+
|
|
123
|
+
/** Confirms email changing */
|
|
124
|
+
|
|
125
|
+
confirmPhoneChange(
|
|
126
|
+
request: ConfirmPhoneChangeRequest,
|
|
127
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
50
128
|
}
|
|
51
129
|
|
|
52
130
|
export function AccountServiceControllerMethods() {
|
|
53
131
|
return function (constructor: Function) {
|
|
54
|
-
const grpcMethods: string[] = [
|
|
132
|
+
const grpcMethods: string[] = [
|
|
133
|
+
"getAccount",
|
|
134
|
+
"initEmailChange",
|
|
135
|
+
"confirmEmailChange",
|
|
136
|
+
"initPhoneChange",
|
|
137
|
+
"confirmPhoneChange",
|
|
138
|
+
];
|
|
55
139
|
for (const method of grpcMethods) {
|
|
56
140
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
141
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/auth.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.1
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
10
11
|
|
|
11
12
|
export const protobufPackage = "auth.v1";
|
|
12
13
|
|
|
@@ -39,6 +40,25 @@ export interface RefreshResponse {
|
|
|
39
40
|
refreshToken: string;
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
export interface TelegramInitResponse {
|
|
44
|
+
url: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TelegramVerifyRequest {
|
|
48
|
+
query: { [key: string]: string };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
52
|
+
key: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TelegramVerifyResponse {
|
|
57
|
+
url?: string | undefined;
|
|
58
|
+
accessToken?: string | undefined;
|
|
59
|
+
refreshToken?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
42
62
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
63
|
|
|
44
64
|
/** AuthService provides authentication related operations */
|
|
@@ -55,6 +75,14 @@ export interface AuthServiceClient {
|
|
|
55
75
|
/** Refreshes access token */
|
|
56
76
|
|
|
57
77
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
78
|
+
|
|
79
|
+
/** Initialize telegram verification */
|
|
80
|
+
|
|
81
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
82
|
+
|
|
83
|
+
/** Confirm telegram verification */
|
|
84
|
+
|
|
85
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
58
86
|
}
|
|
59
87
|
|
|
60
88
|
/** AuthService provides authentication related operations */
|
|
@@ -71,11 +99,21 @@ export interface AuthServiceController {
|
|
|
71
99
|
/** Refreshes access token */
|
|
72
100
|
|
|
73
101
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
102
|
+
|
|
103
|
+
/** Initialize telegram verification */
|
|
104
|
+
|
|
105
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
106
|
+
|
|
107
|
+
/** Confirm telegram verification */
|
|
108
|
+
|
|
109
|
+
telegramVerify(
|
|
110
|
+
request: TelegramVerifyRequest,
|
|
111
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
74
112
|
}
|
|
75
113
|
|
|
76
114
|
export function AuthServiceControllerMethods() {
|
|
77
115
|
return function (constructor: Function) {
|
|
78
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
116
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
|
|
79
117
|
for (const method of grpcMethods) {
|
|
80
118
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
81
119
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/example.ts
CHANGED
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -6,6 +6,14 @@ package account.v1;
|
|
|
6
6
|
service AccountService {
|
|
7
7
|
// GetAccount returns account
|
|
8
8
|
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
9
|
+
// Initializes email changing
|
|
10
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
11
|
+
// Confirms email changing
|
|
12
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
13
|
+
// Initializes email changing
|
|
14
|
+
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
15
|
+
// Confirms email changing
|
|
16
|
+
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
message GetAccountRequest {
|
|
@@ -21,6 +29,44 @@ message GetAccountResponse {
|
|
|
21
29
|
Role role = 6;
|
|
22
30
|
}
|
|
23
31
|
|
|
32
|
+
message InitEmailChangeRequest {
|
|
33
|
+
string email = 1;
|
|
34
|
+
string user_id = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message InitEmailChangeResponse {
|
|
38
|
+
bool ok = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message ConfirmEmailChangeRequest {
|
|
42
|
+
string email = 1;
|
|
43
|
+
string code = 2;
|
|
44
|
+
string user_id = 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message ConfirmEmailChangeResponse {
|
|
48
|
+
bool ok = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message InitPhoneChangeRequest {
|
|
52
|
+
string phone = 1;
|
|
53
|
+
string user_id = 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message InitPhoneChangeResponse {
|
|
57
|
+
bool ok = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message ConfirmPhoneChangeRequest {
|
|
61
|
+
string phone = 1;
|
|
62
|
+
string code = 2;
|
|
63
|
+
string user_id = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ConfirmPhoneChangeResponse {
|
|
67
|
+
bool ok = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
24
70
|
enum Role {
|
|
25
71
|
USER = 0;
|
|
26
72
|
ADMIN = 1;
|
package/proto/auth.proto
CHANGED
|
@@ -2,14 +2,21 @@ syntax="proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
// AuthService provides authentication related operations
|
|
6
8
|
service AuthService {
|
|
7
9
|
// SendOtp sends an OTP to the user
|
|
8
10
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
-
//Verifies otp code from user
|
|
11
|
+
// Verifies otp code from user
|
|
10
12
|
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
-
//Refreshes access token
|
|
12
|
-
rpc Refresh(RefreshRequest) returns (RefreshResponse);
|
|
13
|
+
// Refreshes access token
|
|
14
|
+
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
15
|
+
|
|
16
|
+
// Initialize telegram verification
|
|
17
|
+
rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
|
|
18
|
+
// Confirm telegram verification
|
|
19
|
+
rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
message SendOtpRequest {
|
|
@@ -39,4 +46,20 @@ message RefreshRequest {
|
|
|
39
46
|
message RefreshResponse {
|
|
40
47
|
string access_token = 1;
|
|
41
48
|
string refresh_token = 2;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message TelegramInitResponse {
|
|
52
|
+
string url = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message TelegramVerifyRequest {
|
|
56
|
+
map<string, string> query = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message TelegramVerifyResponse {
|
|
60
|
+
oneof result {
|
|
61
|
+
string url = 1;
|
|
62
|
+
string access_token = 2;
|
|
63
|
+
string refresh_token = 3;
|
|
64
|
+
}
|
|
42
65
|
}
|