@taskora-uni/contracts 1.2.1 → 2.0.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/generated/auth.ts +7 -5
- package/generated/invitation.ts +41 -16
- package/package.json +1 -1
- package/proto/auth.proto +4 -4
- package/proto/invitation.proto +28 -18
package/generated/auth.ts
CHANGED
|
@@ -20,11 +20,11 @@ export interface LoginResponse {
|
|
|
20
20
|
refreshToken: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export interface
|
|
23
|
+
export interface RefreshTokensRequest {
|
|
24
24
|
refreshToken: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export interface
|
|
27
|
+
export interface RefreshTokensResponse {
|
|
28
28
|
accessToken: string;
|
|
29
29
|
refreshToken: string;
|
|
30
30
|
}
|
|
@@ -34,18 +34,20 @@ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
|
34
34
|
export interface AuthServiceClient {
|
|
35
35
|
login(request: LoginRequest): Observable<LoginResponse>;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface AuthServiceController {
|
|
41
41
|
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
refreshTokens(
|
|
44
|
+
request: RefreshTokensRequest,
|
|
45
|
+
): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export function AuthServiceControllerMethods() {
|
|
47
49
|
return function (constructor: Function) {
|
|
48
|
-
const grpcMethods: string[] = ["login", "
|
|
50
|
+
const grpcMethods: string[] = ["login", "refreshTokens"];
|
|
49
51
|
for (const method of grpcMethods) {
|
|
50
52
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
51
53
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/generated/invitation.ts
CHANGED
|
@@ -12,54 +12,79 @@ import { Timestamp } from "./google/protobuf/timestamp";
|
|
|
12
12
|
|
|
13
13
|
export const protobufPackage = "invitation.v1";
|
|
14
14
|
|
|
15
|
-
export interface
|
|
15
|
+
export interface CreateInvitationResponse {
|
|
16
16
|
token: string;
|
|
17
17
|
expiresAt: Timestamp | undefined;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export interface InvitationUsedBy {
|
|
21
|
+
id: string;
|
|
22
|
+
email: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
export interface Invitation {
|
|
21
26
|
id: string;
|
|
22
|
-
|
|
27
|
+
usedBy?: InvitationUsedBy | undefined;
|
|
23
28
|
expiresAt: Timestamp | undefined;
|
|
24
29
|
usedAt?: Timestamp | undefined;
|
|
25
30
|
createdAt: Timestamp | undefined;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
export interface
|
|
33
|
+
export interface ListInvitationsResponse {
|
|
29
34
|
invitations: Invitation[];
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
export interface
|
|
37
|
+
export interface ValidateInvitationTokenRequest {
|
|
33
38
|
token: string;
|
|
34
39
|
}
|
|
35
40
|
|
|
36
|
-
export interface
|
|
41
|
+
export interface ValidateInvitationTokenResponse {
|
|
37
42
|
isValid: boolean;
|
|
38
43
|
}
|
|
39
44
|
|
|
45
|
+
export interface DeleteInvitationRequest {
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
export const INVITATION_V1_PACKAGE_NAME = "invitation.v1";
|
|
41
50
|
|
|
42
51
|
export interface InvitationServiceClient {
|
|
43
|
-
|
|
52
|
+
createInvitation(request: Empty): Observable<CreateInvitationResponse>;
|
|
53
|
+
|
|
54
|
+
listInvitations(request: Empty): Observable<ListInvitationsResponse>;
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
validateInvitationToken(request: ValidateInvitationTokenRequest): Observable<ValidateInvitationTokenResponse>;
|
|
46
57
|
|
|
47
|
-
|
|
58
|
+
deleteInvitation(request: DeleteInvitationRequest): Observable<Empty>;
|
|
48
59
|
}
|
|
49
60
|
|
|
50
61
|
export interface InvitationServiceController {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
request:
|
|
57
|
-
): Promise<
|
|
62
|
+
createInvitation(
|
|
63
|
+
request: Empty,
|
|
64
|
+
): Promise<CreateInvitationResponse> | Observable<CreateInvitationResponse> | CreateInvitationResponse;
|
|
65
|
+
|
|
66
|
+
listInvitations(
|
|
67
|
+
request: Empty,
|
|
68
|
+
): Promise<ListInvitationsResponse> | Observable<ListInvitationsResponse> | ListInvitationsResponse;
|
|
69
|
+
|
|
70
|
+
validateInvitationToken(
|
|
71
|
+
request: ValidateInvitationTokenRequest,
|
|
72
|
+
):
|
|
73
|
+
| Promise<ValidateInvitationTokenResponse>
|
|
74
|
+
| Observable<ValidateInvitationTokenResponse>
|
|
75
|
+
| ValidateInvitationTokenResponse;
|
|
76
|
+
|
|
77
|
+
deleteInvitation(request: DeleteInvitationRequest): void | Promise<void>;
|
|
58
78
|
}
|
|
59
79
|
|
|
60
80
|
export function InvitationServiceControllerMethods() {
|
|
61
81
|
return function (constructor: Function) {
|
|
62
|
-
const grpcMethods: string[] = [
|
|
82
|
+
const grpcMethods: string[] = [
|
|
83
|
+
"createInvitation",
|
|
84
|
+
"listInvitations",
|
|
85
|
+
"validateInvitationToken",
|
|
86
|
+
"deleteInvitation",
|
|
87
|
+
];
|
|
63
88
|
for (const method of grpcMethods) {
|
|
64
89
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
90
|
GrpcMethod("InvitationService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -4,7 +4,7 @@ package auth.v1;
|
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc Login(LoginRequest) returns (LoginResponse);
|
|
7
|
-
rpc
|
|
7
|
+
rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
message LoginRequest {
|
|
@@ -17,11 +17,11 @@ message LoginResponse {
|
|
|
17
17
|
string refresh_token = 2;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
message
|
|
21
|
-
|
|
20
|
+
message RefreshTokensRequest {
|
|
21
|
+
string refresh_token = 1;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
message
|
|
24
|
+
message RefreshTokensResponse {
|
|
25
25
|
string access_token = 1;
|
|
26
26
|
string refresh_token = 2;
|
|
27
27
|
}
|
package/proto/invitation.proto
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
syntax="proto3";
|
|
1
|
+
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package invitation.v1;
|
|
4
4
|
|
|
@@ -6,32 +6,42 @@ import "google/protobuf/empty.proto";
|
|
|
6
6
|
import "google/protobuf/timestamp.proto";
|
|
7
7
|
|
|
8
8
|
service InvitationService {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
rpc CreateInvitation(google.protobuf.Empty) returns (CreateInvitationResponse);
|
|
10
|
+
rpc ListInvitations(google.protobuf.Empty) returns (ListInvitationsResponse);
|
|
11
|
+
rpc ValidateInvitationToken(ValidateInvitationTokenRequest) returns (ValidateInvitationTokenResponse);
|
|
12
|
+
rpc DeleteInvitation(DeleteInvitationRequest) returns (google.protobuf.Empty);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
message
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
message CreateInvitationResponse {
|
|
16
|
+
string token = 1;
|
|
17
|
+
google.protobuf.Timestamp expires_at = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message InvitationUsedBy {
|
|
21
|
+
string id = 1;
|
|
22
|
+
string email = 2;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
message Invitation {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
string id = 1;
|
|
27
|
+
optional InvitationUsedBy used_by = 2;
|
|
28
|
+
google.protobuf.Timestamp expires_at = 3;
|
|
29
|
+
optional google.protobuf.Timestamp used_at = 4;
|
|
30
|
+
google.protobuf.Timestamp created_at = 5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message ListInvitationsResponse {
|
|
34
|
+
repeated Invitation invitations = 1;
|
|
25
35
|
}
|
|
26
36
|
|
|
27
|
-
message
|
|
28
|
-
|
|
37
|
+
message ValidateInvitationTokenRequest {
|
|
38
|
+
string token = 1;
|
|
29
39
|
}
|
|
30
40
|
|
|
31
|
-
message
|
|
32
|
-
|
|
41
|
+
message ValidateInvitationTokenResponse {
|
|
42
|
+
bool is_valid = 1;
|
|
33
43
|
}
|
|
34
44
|
|
|
35
|
-
message
|
|
36
|
-
|
|
45
|
+
message DeleteInvitationRequest {
|
|
46
|
+
string id = 1;
|
|
37
47
|
}
|