@shipsync-software/contracts 1.0.9 → 1.1.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/gen/acccount.ts +116 -0
- package/gen/auth.ts +13 -1
- package/package.json +1 -1
- package/proto/acccount.proto +68 -0
- package/proto/auth.proto +10 -0
package/gen/acccount.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: acccount.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 CompanyType {
|
|
14
|
+
CONTRACTOR = 0,
|
|
15
|
+
CUSTOMER = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface CreateAccountRequest {
|
|
20
|
+
email: string;
|
|
21
|
+
phone?: string | undefined;
|
|
22
|
+
isExternal: boolean;
|
|
23
|
+
roleId?: string | undefined;
|
|
24
|
+
companyId?: string | undefined;
|
|
25
|
+
companyType?: CompanyType | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CreateAccountResponse {
|
|
29
|
+
id: string;
|
|
30
|
+
success: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UpdateAccountRequest {
|
|
34
|
+
id: string;
|
|
35
|
+
email?: string | undefined;
|
|
36
|
+
phone?: string | undefined;
|
|
37
|
+
isExternal?: boolean | undefined;
|
|
38
|
+
roleId?: string | undefined;
|
|
39
|
+
companyId?: string | undefined;
|
|
40
|
+
companyType?: CompanyType | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface UpdateAccountResponse {
|
|
44
|
+
success: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface FindOneAccountRequest {
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
email?: string | undefined;
|
|
50
|
+
phone?: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FindOneAccountResponse {
|
|
54
|
+
id: string;
|
|
55
|
+
email: string;
|
|
56
|
+
phone?: string | undefined;
|
|
57
|
+
isExternal: boolean;
|
|
58
|
+
roleId?: string | undefined;
|
|
59
|
+
companyId?: string | undefined;
|
|
60
|
+
companyType?: CompanyType | undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DeleteAccountRequest {
|
|
64
|
+
id: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface DeleteAccountResponse {
|
|
68
|
+
success: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
72
|
+
|
|
73
|
+
export interface AccountsServiceClient {
|
|
74
|
+
create(request: CreateAccountRequest): Observable<CreateAccountResponse>;
|
|
75
|
+
|
|
76
|
+
update(request: UpdateAccountRequest): Observable<UpdateAccountResponse>;
|
|
77
|
+
|
|
78
|
+
findOne(request: FindOneAccountRequest): Observable<FindOneAccountResponse>;
|
|
79
|
+
|
|
80
|
+
delete(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface AccountsServiceController {
|
|
84
|
+
create(
|
|
85
|
+
request: CreateAccountRequest,
|
|
86
|
+
): Promise<CreateAccountResponse> | Observable<CreateAccountResponse> | CreateAccountResponse;
|
|
87
|
+
|
|
88
|
+
update(
|
|
89
|
+
request: UpdateAccountRequest,
|
|
90
|
+
): Promise<UpdateAccountResponse> | Observable<UpdateAccountResponse> | UpdateAccountResponse;
|
|
91
|
+
|
|
92
|
+
findOne(
|
|
93
|
+
request: FindOneAccountRequest,
|
|
94
|
+
): Promise<FindOneAccountResponse> | Observable<FindOneAccountResponse> | FindOneAccountResponse;
|
|
95
|
+
|
|
96
|
+
delete(
|
|
97
|
+
request: DeleteAccountRequest,
|
|
98
|
+
): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function AccountsServiceControllerMethods() {
|
|
102
|
+
return function (constructor: Function) {
|
|
103
|
+
const grpcMethods: string[] = ["create", "update", "findOne", "delete"];
|
|
104
|
+
for (const method of grpcMethods) {
|
|
105
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
106
|
+
GrpcMethod("AccountsService", method)(constructor.prototype[method], method, descriptor);
|
|
107
|
+
}
|
|
108
|
+
const grpcStreamMethods: string[] = [];
|
|
109
|
+
for (const method of grpcStreamMethods) {
|
|
110
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
111
|
+
GrpcStreamMethod("AccountsService", method)(constructor.prototype[method], method, descriptor);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const ACCOUNTS_SERVICE_NAME = "AccountsService";
|
package/gen/auth.ts
CHANGED
|
@@ -39,6 +39,14 @@ export interface RefreshResponse {
|
|
|
39
39
|
refreshToken: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export interface LogoutRequest {
|
|
43
|
+
refreshToken: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface LogoutResponse {
|
|
47
|
+
ok: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
51
|
|
|
44
52
|
export interface AuthServiceClient {
|
|
@@ -47,6 +55,8 @@ export interface AuthServiceClient {
|
|
|
47
55
|
verify(request: VerifyRequest): Observable<VerifyResponse>;
|
|
48
56
|
|
|
49
57
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
58
|
+
|
|
59
|
+
logout(request: LogoutRequest): Observable<LogoutResponse>;
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
export interface AuthServiceController {
|
|
@@ -55,11 +65,13 @@ export interface AuthServiceController {
|
|
|
55
65
|
verify(request: VerifyRequest): Promise<VerifyResponse> | Observable<VerifyResponse> | VerifyResponse;
|
|
56
66
|
|
|
57
67
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
68
|
+
|
|
69
|
+
logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
export function AuthServiceControllerMethods() {
|
|
61
73
|
return function (constructor: Function) {
|
|
62
|
-
const grpcMethods: string[] = ["login", "verify", "refresh"];
|
|
74
|
+
const grpcMethods: string[] = ["login", "verify", "refresh", "logout"];
|
|
63
75
|
for (const method of grpcMethods) {
|
|
64
76
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
77
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
enum CompanyType {
|
|
6
|
+
CONTRACTOR = 0;
|
|
7
|
+
CUSTOMER = 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
service AccountsService{
|
|
11
|
+
rpc Create (CreateAccountRequest) returns (CreateAccountResponse);
|
|
12
|
+
rpc Update (UpdateAccountRequest) returns (UpdateAccountResponse);
|
|
13
|
+
rpc FindOne (FindOneAccountRequest) returns (FindOneAccountResponse);
|
|
14
|
+
rpc Delete (DeleteAccountRequest) returns (DeleteAccountResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message CreateAccountRequest {
|
|
18
|
+
string email = 1;
|
|
19
|
+
optional string phone = 2;
|
|
20
|
+
bool is_external = 3;
|
|
21
|
+
optional string role_id = 4;
|
|
22
|
+
optional string company_id = 5;
|
|
23
|
+
optional CompanyType company_type = 6;
|
|
24
|
+
}
|
|
25
|
+
message CreateAccountResponse {
|
|
26
|
+
string id = 1;
|
|
27
|
+
bool success = 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message UpdateAccountRequest {
|
|
31
|
+
string id = 1;
|
|
32
|
+
optional string email = 2;
|
|
33
|
+
optional string phone = 3;
|
|
34
|
+
optional bool is_external = 4;
|
|
35
|
+
optional string role_id = 5;
|
|
36
|
+
optional string company_id = 6;
|
|
37
|
+
optional CompanyType company_type = 7;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message UpdateAccountResponse {
|
|
41
|
+
bool success = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message FindOneAccountRequest {
|
|
45
|
+
oneof criteria {
|
|
46
|
+
string id = 1;
|
|
47
|
+
string email = 2;
|
|
48
|
+
string phone = 3;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message FindOneAccountResponse {
|
|
53
|
+
string id = 1;
|
|
54
|
+
string email = 2;
|
|
55
|
+
optional string phone = 3;
|
|
56
|
+
bool is_external = 4;
|
|
57
|
+
optional string role_id = 5;
|
|
58
|
+
optional string company_id = 6;
|
|
59
|
+
optional CompanyType company_type = 7;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message DeleteAccountRequest {
|
|
63
|
+
string id = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message DeleteAccountResponse {
|
|
67
|
+
bool success = 1;
|
|
68
|
+
}
|
package/proto/auth.proto
CHANGED
|
@@ -6,6 +6,7 @@ service AuthService{
|
|
|
6
6
|
rpc Login (LoginRequest) returns (LoginResponse);
|
|
7
7
|
rpc Verify (VerifyRequest) returns (VerifyResponse);
|
|
8
8
|
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
9
|
+
rpc Logout (LogoutRequest) returns (LogoutResponse);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
message LoginRequest{
|
|
@@ -36,3 +37,12 @@ message RefreshResponse {
|
|
|
36
37
|
string access_token = 1;
|
|
37
38
|
string refresh_token = 2;
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
message LogoutRequest {
|
|
42
|
+
string refresh_token = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
message LogoutResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|