@candesk/contracts 1.0.11 → 1.2.0
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/gen/account.js +1 -1
- package/dist/gen/auth.d.ts +8 -0
- package/dist/gen/auth.js +2 -2
- package/package.json +1 -1
- package/proto/account.proto +68 -68
- package/proto/auth.proto +47 -38
package/dist/gen/account.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.4
|
|
5
|
-
// protoc
|
|
5
|
+
// protoc v3.21.12
|
|
6
6
|
// source: account.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.Role = exports.protobufPackage = void 0;
|
package/dist/gen/auth.d.ts
CHANGED
|
@@ -23,16 +23,24 @@ export interface RefreshResponse {
|
|
|
23
23
|
accessToken: string;
|
|
24
24
|
refreshToken: string;
|
|
25
25
|
}
|
|
26
|
+
export interface LogoutRequest {
|
|
27
|
+
refreshToken: string;
|
|
28
|
+
}
|
|
29
|
+
export interface LogoutResponse {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
}
|
|
26
32
|
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
27
33
|
export interface AuthServiceClient {
|
|
28
34
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
29
35
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
30
36
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
37
|
+
logout(request: LogoutRequest): Observable<LogoutResponse>;
|
|
31
38
|
}
|
|
32
39
|
export interface AuthServiceController {
|
|
33
40
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
34
41
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
35
42
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
43
|
+
logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
36
44
|
}
|
|
37
45
|
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
38
46
|
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.12.4
|
|
5
|
-
// protoc
|
|
5
|
+
// protoc v3.21.12
|
|
6
6
|
// source: auth.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
@@ -13,7 +13,7 @@ exports.protobufPackage = "auth.v1";
|
|
|
13
13
|
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
14
|
function AuthServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
|
|
16
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "logout"];
|
|
17
17
|
for (const method of grpcMethods) {
|
|
18
18
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
19
|
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package account.v1;
|
|
4
|
-
|
|
5
|
-
service AccountService {
|
|
6
|
-
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
-
|
|
8
|
-
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
|
-
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
|
-
|
|
11
|
-
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
12
|
-
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message GetAccountRequest {
|
|
16
|
-
string id = 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message GetAccountResponse {
|
|
20
|
-
string id = 1;
|
|
21
|
-
string phone = 2;
|
|
22
|
-
string email = 3;
|
|
23
|
-
bool is_phone_verified = 4;
|
|
24
|
-
bool is_email_verified = 5;
|
|
25
|
-
Role role = 6;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message InitEmailChangeRequest {
|
|
29
|
-
string email = 1;
|
|
30
|
-
string user_id = 2;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message InitEmailChangeResponse {
|
|
34
|
-
bool ok = 1;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
message ConfirmEmailChangeRequest {
|
|
38
|
-
string email = 1;
|
|
39
|
-
string code = 2;
|
|
40
|
-
string user_id = 3;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
message ConfirmEmailChangeResponse {
|
|
44
|
-
bool ok = 1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
message InitPhoneChangeRequest {
|
|
48
|
-
string phone = 1;
|
|
49
|
-
string user_id = 2;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message InitPhoneChangeResponse {
|
|
53
|
-
bool ok = 1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
message ConfirmPhoneChangeRequest {
|
|
57
|
-
string phone = 1;
|
|
58
|
-
string code = 2;
|
|
59
|
-
string user_id = 3;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
message ConfirmPhoneChangeResponse {
|
|
63
|
-
bool ok = 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
enum Role {
|
|
67
|
-
USER = 0;
|
|
68
|
-
ADMIN = 1;
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
6
|
+
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
|
|
8
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
|
+
|
|
11
|
+
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
12
|
+
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetAccountRequest {
|
|
16
|
+
string id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetAccountResponse {
|
|
20
|
+
string id = 1;
|
|
21
|
+
string phone = 2;
|
|
22
|
+
string email = 3;
|
|
23
|
+
bool is_phone_verified = 4;
|
|
24
|
+
bool is_email_verified = 5;
|
|
25
|
+
Role role = 6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message InitEmailChangeRequest {
|
|
29
|
+
string email = 1;
|
|
30
|
+
string user_id = 2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message InitEmailChangeResponse {
|
|
34
|
+
bool ok = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message ConfirmEmailChangeRequest {
|
|
38
|
+
string email = 1;
|
|
39
|
+
string code = 2;
|
|
40
|
+
string user_id = 3;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message ConfirmEmailChangeResponse {
|
|
44
|
+
bool ok = 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message InitPhoneChangeRequest {
|
|
48
|
+
string phone = 1;
|
|
49
|
+
string user_id = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message InitPhoneChangeResponse {
|
|
53
|
+
bool ok = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message ConfirmPhoneChangeRequest {
|
|
57
|
+
string phone = 1;
|
|
58
|
+
string code = 2;
|
|
59
|
+
string user_id = 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message ConfirmPhoneChangeResponse {
|
|
63
|
+
bool ok = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
enum Role {
|
|
67
|
+
USER = 0;
|
|
68
|
+
ADMIN = 1;
|
|
69
69
|
}
|
package/proto/auth.proto
CHANGED
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package auth.v1;
|
|
4
|
-
|
|
5
|
-
service AuthService {
|
|
6
|
-
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
-
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
-
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
string
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
string
|
|
23
|
-
string
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
string
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
string
|
|
38
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
service AuthService {
|
|
6
|
+
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
+
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
9
|
+
rpc Logout (LogoutRequest) returns (LogoutResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message SendOtpRequest {
|
|
13
|
+
string identifier = 1;
|
|
14
|
+
string type = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message SendOtpResponse {
|
|
18
|
+
bool ok = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message VerifyOtpRequest {
|
|
22
|
+
string identifier = 1;
|
|
23
|
+
string type = 2;
|
|
24
|
+
string code = 3;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message VerifyOtpResponse {
|
|
28
|
+
string access_token = 1;
|
|
29
|
+
string refresh_token = 2;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message RefreshRequest {
|
|
33
|
+
string refresh_token = 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message RefreshResponse {
|
|
37
|
+
string access_token = 1;
|
|
38
|
+
string refresh_token = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message LogoutRequest {
|
|
42
|
+
string refresh_token = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message LogoutResponse {
|
|
46
|
+
bool ok = 1;
|
|
47
|
+
}
|