@booking-guvanch/contracts 1.0.9 → 1.0.11
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 +59 -0
- package/gen/auth.ts +16 -1
- package/package.json +1 -1
- package/proto/account.proto +25 -0
- package/proto/auth.proto +9 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/account.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v4.23.4
|
|
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
|
+
roles: Role[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
33
|
+
|
|
34
|
+
export interface AccountServiceClient {
|
|
35
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AccountServiceController {
|
|
39
|
+
getAccount(
|
|
40
|
+
request: GetAccountRequest,
|
|
41
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function AccountServiceControllerMethods() {
|
|
45
|
+
return function (constructor: Function) {
|
|
46
|
+
const grpcMethods: string[] = ["getAccount"];
|
|
47
|
+
for (const method of grpcMethods) {
|
|
48
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
49
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
50
|
+
}
|
|
51
|
+
const grpcStreamMethods: string[] = [];
|
|
52
|
+
for (const method of grpcStreamMethods) {
|
|
53
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
54
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/auth.ts
CHANGED
|
@@ -10,6 +10,15 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export interface RefreshTokenRequest {
|
|
14
|
+
refreshToken: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RefreshTokenResponse {
|
|
18
|
+
accessToken: string;
|
|
19
|
+
refreshToken: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
export interface VerifyOtpRequest {
|
|
14
23
|
identifier: string;
|
|
15
24
|
type: string;
|
|
@@ -36,17 +45,23 @@ export interface AuthServiceClient {
|
|
|
36
45
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
37
46
|
|
|
38
47
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
48
|
+
|
|
49
|
+
refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
export interface AuthServiceController {
|
|
42
53
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
43
54
|
|
|
44
55
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
56
|
+
|
|
57
|
+
refreshToken(
|
|
58
|
+
request: RefreshTokenRequest,
|
|
59
|
+
): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
|
|
45
60
|
}
|
|
46
61
|
|
|
47
62
|
export function AuthServiceControllerMethods() {
|
|
48
63
|
return function (constructor: Function) {
|
|
49
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
64
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
|
|
50
65
|
for (const method of grpcMethods) {
|
|
51
66
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
52
67
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
6
|
+
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message GetAccountRequest {
|
|
10
|
+
string id = 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message GetAccountResponse {
|
|
14
|
+
string id = 1;
|
|
15
|
+
string phone = 2;
|
|
16
|
+
string email = 3;
|
|
17
|
+
bool is_phone_verified = 4;
|
|
18
|
+
bool is_email_verified = 5;
|
|
19
|
+
repeated Role roles = 6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum Role {
|
|
23
|
+
USER = 0;
|
|
24
|
+
ADMIN = 1;
|
|
25
|
+
}
|
package/proto/auth.proto
CHANGED
|
@@ -5,7 +5,16 @@ package auth.v1;
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
7
7
|
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
+
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message RefreshTokenRequest {
|
|
12
|
+
string refresh_token = 1;
|
|
13
|
+
}
|
|
8
14
|
|
|
15
|
+
message RefreshTokenResponse {
|
|
16
|
+
string access_token = 1;
|
|
17
|
+
string refresh_token = 2;
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
message VerifyOtpRequest {
|