@taskora-uni/contracts 2.0.0 → 3.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 CHANGED
@@ -29,12 +29,39 @@ export interface RefreshTokensResponse {
29
29
  refreshToken: string;
30
30
  }
31
31
 
32
+ export interface StartRegistrationRequest {
33
+ email: string;
34
+ password: string;
35
+ token: string;
36
+ }
37
+
38
+ export interface StartRegistrationResponse {
39
+ id: string;
40
+ }
41
+
42
+ export interface CompleteRegistrationRequest {
43
+ id: string;
44
+ code: string;
45
+ token: string;
46
+ firstName: string;
47
+ lastName: string;
48
+ }
49
+
50
+ export interface CompleteRegistrationResponse {
51
+ accessToken: string;
52
+ refreshToken: string;
53
+ }
54
+
32
55
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
33
56
 
34
57
  export interface AuthServiceClient {
35
58
  login(request: LoginRequest): Observable<LoginResponse>;
36
59
 
37
60
  refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
61
+
62
+ startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
63
+
64
+ completeRegistration(request: CompleteRegistrationRequest): Observable<CompleteRegistrationResponse>;
38
65
  }
39
66
 
40
67
  export interface AuthServiceController {
@@ -43,11 +70,19 @@ export interface AuthServiceController {
43
70
  refreshTokens(
44
71
  request: RefreshTokensRequest,
45
72
  ): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
73
+
74
+ startRegistration(
75
+ request: StartRegistrationRequest,
76
+ ): Promise<StartRegistrationResponse> | Observable<StartRegistrationResponse> | StartRegistrationResponse;
77
+
78
+ completeRegistration(
79
+ request: CompleteRegistrationRequest,
80
+ ): Promise<CompleteRegistrationResponse> | Observable<CompleteRegistrationResponse> | CompleteRegistrationResponse;
46
81
  }
47
82
 
48
83
  export function AuthServiceControllerMethods() {
49
84
  return function (constructor: Function) {
50
- const grpcMethods: string[] = ["login", "refreshTokens"];
85
+ const grpcMethods: string[] = ["login", "refreshTokens", "startRegistration", "completeRegistration"];
51
86
  for (const method of grpcMethods) {
52
87
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
53
88
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/proto/auth.proto CHANGED
@@ -5,6 +5,8 @@ package auth.v1;
5
5
  service AuthService {
6
6
  rpc Login(LoginRequest) returns (LoginResponse);
7
7
  rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
8
+ rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
9
+ rpc CompleteRegistration(CompleteRegistrationRequest) returns (CompleteRegistrationResponse);
8
10
  }
9
11
 
10
12
  message LoginRequest {
@@ -25,3 +27,26 @@ message RefreshTokensResponse {
25
27
  string access_token = 1;
26
28
  string refresh_token = 2;
27
29
  }
30
+
31
+ message StartRegistrationRequest {
32
+ string email = 1;
33
+ string password = 2;
34
+ string token = 3;
35
+ }
36
+
37
+ message StartRegistrationResponse {
38
+ string id = 1;
39
+ }
40
+
41
+ message CompleteRegistrationRequest {
42
+ string id = 1;
43
+ string code = 2;
44
+ string token = 3;
45
+ string first_name = 4;
46
+ string last_name = 5;
47
+ }
48
+
49
+ message CompleteRegistrationResponse {
50
+ string access_token = 1;
51
+ string refresh_token = 2;
52
+ }