@booking-guvanch/contracts 1.0.11 → 1.0.13
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.d.ts +65 -0
- package/gen/account.js +40 -0
- package/gen/account.ts +69 -1
- package/gen/auth.d.ts +38 -0
- package/gen/auth.js +28 -0
- package/package.json +2 -2
- package/proto/account.proto +40 -0
package/gen/account.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "account.v1";
|
|
3
|
+
export declare enum Role {
|
|
4
|
+
USER = 0,
|
|
5
|
+
ADMIN = 1,
|
|
6
|
+
UNRECOGNIZED = -1
|
|
7
|
+
}
|
|
8
|
+
export interface InitPhoneCodeRequest {
|
|
9
|
+
phone: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InitPhoneCodeResponse {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ConfirmPhoneCodeRequest {
|
|
16
|
+
phone: string;
|
|
17
|
+
code: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfirmPhoneCodeResponse {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface InitEmailCodeRequest {
|
|
24
|
+
email: string;
|
|
25
|
+
userId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface InitEmailCodeResponse {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ConfirmEmailCodeRequest {
|
|
31
|
+
email: string;
|
|
32
|
+
code: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ConfirmEmailCodeResponse {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface GetAccountRequest {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
export interface GetAccountResponse {
|
|
42
|
+
id: string;
|
|
43
|
+
phone: string;
|
|
44
|
+
email: string;
|
|
45
|
+
isPhoneVerified: boolean;
|
|
46
|
+
isEmailVerified: boolean;
|
|
47
|
+
roles: Role[];
|
|
48
|
+
}
|
|
49
|
+
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
50
|
+
export interface AccountServiceClient {
|
|
51
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
52
|
+
initEmailCode(request: InitEmailCodeRequest): Observable<InitEmailCodeResponse>;
|
|
53
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Observable<ConfirmEmailCodeResponse>;
|
|
54
|
+
initPhoneCode(request: InitPhoneCodeRequest): Observable<InitPhoneCodeResponse>;
|
|
55
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Observable<ConfirmPhoneCodeResponse>;
|
|
56
|
+
}
|
|
57
|
+
export interface AccountServiceController {
|
|
58
|
+
getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
59
|
+
initEmailCode(request: InitEmailCodeRequest): Promise<InitEmailCodeResponse> | Observable<InitEmailCodeResponse> | InitEmailCodeResponse;
|
|
60
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Promise<ConfirmEmailCodeResponse> | Observable<ConfirmEmailCodeResponse> | ConfirmEmailCodeResponse;
|
|
61
|
+
initPhoneCode(request: InitPhoneCodeRequest): Promise<InitPhoneCodeResponse> | Observable<InitPhoneCodeResponse> | InitPhoneCodeResponse;
|
|
62
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Promise<ConfirmPhoneCodeResponse> | Observable<ConfirmPhoneCodeResponse> | ConfirmPhoneCodeResponse;
|
|
63
|
+
}
|
|
64
|
+
export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
|
|
65
|
+
export declare const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/account.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v4.23.4
|
|
6
|
+
// source: account.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.Role = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "account.v1";
|
|
13
|
+
var Role;
|
|
14
|
+
(function (Role) {
|
|
15
|
+
Role[Role["USER"] = 0] = "USER";
|
|
16
|
+
Role[Role["ADMIN"] = 1] = "ADMIN";
|
|
17
|
+
Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
18
|
+
})(Role || (exports.Role = Role = {}));
|
|
19
|
+
exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
20
|
+
function AccountServiceControllerMethods() {
|
|
21
|
+
return function (constructor) {
|
|
22
|
+
const grpcMethods = [
|
|
23
|
+
"getAccount",
|
|
24
|
+
"initEmailCode",
|
|
25
|
+
"confirmEmailCode",
|
|
26
|
+
"initPhoneCode",
|
|
27
|
+
"confirmPhoneCode",
|
|
28
|
+
];
|
|
29
|
+
for (const method of grpcMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
const grpcStreamMethods = [];
|
|
34
|
+
for (const method of grpcStreamMethods) {
|
|
35
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
36
|
+
(0, microservices_1.GrpcStreamMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/account.ts
CHANGED
|
@@ -16,6 +16,44 @@ export enum Role {
|
|
|
16
16
|
UNRECOGNIZED = -1,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export interface InitPhoneCodeRequest {
|
|
20
|
+
phone: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface InitPhoneCodeResponse {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ConfirmPhoneCodeRequest {
|
|
29
|
+
phone: string;
|
|
30
|
+
code: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ConfirmPhoneCodeResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface InitEmailCodeRequest {
|
|
39
|
+
email: string;
|
|
40
|
+
userId: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface InitEmailCodeResponse {
|
|
44
|
+
ok: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailCodeRequest {
|
|
48
|
+
email: string;
|
|
49
|
+
code: string;
|
|
50
|
+
userId: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ConfirmEmailCodeResponse {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
19
57
|
export interface GetAccountRequest {
|
|
20
58
|
id: string;
|
|
21
59
|
}
|
|
@@ -33,17 +71,47 @@ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
|
33
71
|
|
|
34
72
|
export interface AccountServiceClient {
|
|
35
73
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
74
|
+
|
|
75
|
+
initEmailCode(request: InitEmailCodeRequest): Observable<InitEmailCodeResponse>;
|
|
76
|
+
|
|
77
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Observable<ConfirmEmailCodeResponse>;
|
|
78
|
+
|
|
79
|
+
initPhoneCode(request: InitPhoneCodeRequest): Observable<InitPhoneCodeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Observable<ConfirmPhoneCodeResponse>;
|
|
36
82
|
}
|
|
37
83
|
|
|
38
84
|
export interface AccountServiceController {
|
|
39
85
|
getAccount(
|
|
40
86
|
request: GetAccountRequest,
|
|
41
87
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
88
|
+
|
|
89
|
+
initEmailCode(
|
|
90
|
+
request: InitEmailCodeRequest,
|
|
91
|
+
): Promise<InitEmailCodeResponse> | Observable<InitEmailCodeResponse> | InitEmailCodeResponse;
|
|
92
|
+
|
|
93
|
+
confirmEmailCode(
|
|
94
|
+
request: ConfirmEmailCodeRequest,
|
|
95
|
+
): Promise<ConfirmEmailCodeResponse> | Observable<ConfirmEmailCodeResponse> | ConfirmEmailCodeResponse;
|
|
96
|
+
|
|
97
|
+
initPhoneCode(
|
|
98
|
+
request: InitPhoneCodeRequest,
|
|
99
|
+
): Promise<InitPhoneCodeResponse> | Observable<InitPhoneCodeResponse> | InitPhoneCodeResponse;
|
|
100
|
+
|
|
101
|
+
confirmPhoneCode(
|
|
102
|
+
request: ConfirmPhoneCodeRequest,
|
|
103
|
+
): Promise<ConfirmPhoneCodeResponse> | Observable<ConfirmPhoneCodeResponse> | ConfirmPhoneCodeResponse;
|
|
42
104
|
}
|
|
43
105
|
|
|
44
106
|
export function AccountServiceControllerMethods() {
|
|
45
107
|
return function (constructor: Function) {
|
|
46
|
-
const grpcMethods: string[] = [
|
|
108
|
+
const grpcMethods: string[] = [
|
|
109
|
+
"getAccount",
|
|
110
|
+
"initEmailCode",
|
|
111
|
+
"confirmEmailCode",
|
|
112
|
+
"initPhoneCode",
|
|
113
|
+
"confirmPhoneCode",
|
|
114
|
+
];
|
|
47
115
|
for (const method of grpcMethods) {
|
|
48
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
49
117
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/auth.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "auth.v1";
|
|
3
|
+
export interface RefreshTokenRequest {
|
|
4
|
+
refreshToken: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RefreshTokenResponse {
|
|
7
|
+
accessToken: string;
|
|
8
|
+
refreshToken: string;
|
|
9
|
+
}
|
|
10
|
+
export interface VerifyOtpRequest {
|
|
11
|
+
identifier: string;
|
|
12
|
+
type: string;
|
|
13
|
+
code: string;
|
|
14
|
+
}
|
|
15
|
+
export interface VerifyOtpResponse {
|
|
16
|
+
accessToken: string;
|
|
17
|
+
refreshToken: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SendOtpRequest {
|
|
20
|
+
identifier: string;
|
|
21
|
+
type: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SendOtpResponse {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
27
|
+
export interface AuthServiceClient {
|
|
28
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
29
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
30
|
+
refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
|
|
31
|
+
}
|
|
32
|
+
export interface AuthServiceController {
|
|
33
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
34
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
35
|
+
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
|
|
36
|
+
}
|
|
37
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
38
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/gen/auth.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v4.23.4
|
|
6
|
+
// source: auth.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "auth.v1";
|
|
13
|
+
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
|
+
function AuthServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refreshToken"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.AUTH_SERVICE_NAME = "AuthService";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@booking-guvanch/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "tsc -p tsconfig.build.json",
|
|
16
|
+
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.json",
|
|
17
17
|
"generate": "protoc -I ./proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit ./proto/*.proto"
|
|
18
18
|
},
|
|
19
19
|
"license": "ISC",
|
package/proto/account.proto
CHANGED
|
@@ -4,8 +4,48 @@ package account.v1;
|
|
|
4
4
|
|
|
5
5
|
service AccountService {
|
|
6
6
|
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
rpc InitEmailCode(InitEmailCodeRequest) returns (InitEmailCodeResponse);
|
|
8
|
+
rpc ConfirmEmailCode(ConfirmEmailCodeRequest) returns (ConfirmEmailCodeResponse);
|
|
9
|
+
rpc InitPhoneCode(InitPhoneCodeRequest) returns (InitPhoneCodeResponse);
|
|
10
|
+
rpc ConfirmPhoneCode(ConfirmPhoneCodeRequest) returns (ConfirmPhoneCodeResponse);
|
|
7
11
|
}
|
|
8
12
|
|
|
13
|
+
message InitPhoneCodeRequest {
|
|
14
|
+
string phone = 1;
|
|
15
|
+
string user_id = 2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message InitPhoneCodeResponse {
|
|
19
|
+
bool ok = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ConfirmPhoneCodeRequest {
|
|
23
|
+
string phone = 1;
|
|
24
|
+
string code = 2;
|
|
25
|
+
string user_id = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ConfirmPhoneCodeResponse {
|
|
29
|
+
bool ok = 1;
|
|
30
|
+
}
|
|
31
|
+
message InitEmailCodeRequest {
|
|
32
|
+
string email = 1;
|
|
33
|
+
string user_id = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message InitEmailCodeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message ConfirmEmailCodeRequest {
|
|
41
|
+
string email = 1;
|
|
42
|
+
string code = 2;
|
|
43
|
+
string user_id = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message ConfirmEmailCodeResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|
|
9
49
|
message GetAccountRequest {
|
|
10
50
|
string id = 1;
|
|
11
51
|
}
|