@taskora-uni/contracts 6.0.0 → 6.0.1

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.
@@ -19,16 +19,43 @@ export interface RefreshTokensResponse {
19
19
  accessToken: string;
20
20
  refreshToken: string;
21
21
  }
22
+ export interface StartRegistrationRequest {
23
+ invitationToken: string;
24
+ firstName: string;
25
+ lastName: string;
26
+ email: string;
27
+ password: string;
28
+ }
29
+ export interface StartRegistrationResponse {
30
+ registrationId: string;
31
+ }
32
+ export interface ResendRegistrationOtpRequest {
33
+ registrationId: string;
34
+ }
35
+ export interface VerifyRegistrationOtpRequest {
36
+ registrationId: string;
37
+ otpCode: string;
38
+ }
39
+ export interface VerifyRegistrationOtpResponse {
40
+ accessToken: string;
41
+ refreshToken: string;
42
+ }
22
43
  export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
44
  export interface AuthServiceClient {
24
45
  login(request: LoginRequest): Observable<LoginResponse>;
25
46
  logout(request: LogoutRequest): Observable<Empty>;
26
47
  refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
48
+ startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
49
+ resendRegistrationOtp(request: ResendRegistrationOtpRequest): Observable<Empty>;
50
+ verifyRegistrationOtp(request: VerifyRegistrationOtpRequest): Observable<VerifyRegistrationOtpResponse>;
27
51
  }
28
52
  export interface AuthServiceController {
29
53
  login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
30
54
  logout(request: LogoutRequest): void | Promise<void>;
31
55
  refreshTokens(request: RefreshTokensRequest): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
56
+ startRegistration(request: StartRegistrationRequest): Promise<StartRegistrationResponse> | Observable<StartRegistrationResponse> | StartRegistrationResponse;
57
+ resendRegistrationOtp(request: ResendRegistrationOtpRequest): void | Promise<void>;
58
+ verifyRegistrationOtp(request: VerifyRegistrationOtpRequest): Promise<VerifyRegistrationOtpResponse> | Observable<VerifyRegistrationOtpResponse> | VerifyRegistrationOtpResponse;
32
59
  }
33
60
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
34
61
  export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -13,7 +13,14 @@ 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 = ["login", "logout", "refreshTokens"];
16
+ const grpcMethods = [
17
+ "login",
18
+ "logout",
19
+ "refreshTokens",
20
+ "startRegistration",
21
+ "resendRegistrationOtp",
22
+ "verifyRegistrationOtp",
23
+ ];
17
24
  for (const method of grpcMethods) {
18
25
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
26
  (0, microservices_1.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": "6.0.0",
3
+ "version": "6.0.1",
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
@@ -8,6 +8,10 @@ service AuthService {
8
8
  rpc Login(LoginRequest) returns (LoginResponse);
9
9
  rpc Logout(LogoutRequest) returns (google.protobuf.Empty);
10
10
  rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
11
+
12
+ rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
13
+ rpc ResendRegistrationOtp(ResendRegistrationOtpRequest) returns (google.protobuf.Empty);
14
+ rpc VerifyRegistrationOtp(VerifyRegistrationOtpRequest) returns (VerifyRegistrationOtpResponse);
11
15
  }
12
16
 
13
17
  message LoginRequest {
@@ -32,3 +36,29 @@ message RefreshTokensResponse {
32
36
  string access_token = 1;
33
37
  string refresh_token = 2;
34
38
  }
39
+
40
+ message StartRegistrationRequest {
41
+ string invitation_token = 1;
42
+ string first_name = 2;
43
+ string last_name = 3;
44
+ string email = 4;
45
+ string password = 5;
46
+ }
47
+
48
+ message StartRegistrationResponse {
49
+ string registration_id = 1;
50
+ }
51
+
52
+ message ResendRegistrationOtpRequest {
53
+ string registration_id = 1;
54
+ }
55
+
56
+ message VerifyRegistrationOtpRequest {
57
+ string registration_id = 1;
58
+ string otp_code = 2;
59
+ }
60
+
61
+ message VerifyRegistrationOtpResponse {
62
+ string access_token = 1;
63
+ string refresh_token = 2;
64
+ }