@shipsync-software/contracts 1.0.6 → 1.0.8

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/auth.ts CHANGED
@@ -10,28 +10,43 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
- export interface SendOtpRequest {
13
+ export interface LoginRequest {
14
14
  identifier: string;
15
15
  method: string;
16
16
  }
17
17
 
18
- export interface SendOtpResponse {
19
- ok: boolean;
18
+ export interface LoginResponse {
19
+ reqId: string;
20
+ }
21
+
22
+ export interface VerifyRequest {
23
+ reqId: string;
24
+ code: string;
25
+ }
26
+
27
+ export interface VerifyResponse {
28
+ accessToken: string;
29
+ refreshToken: string;
30
+ redirectUrl: string;
20
31
  }
21
32
 
22
33
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
34
 
24
35
  export interface AuthServiceClient {
25
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
36
+ login(request: LoginRequest): Observable<LoginResponse>;
37
+
38
+ verify(request: VerifyRequest): Observable<VerifyResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
- sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
42
+ login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
43
+
44
+ verify(request: VerifyRequest): Promise<VerifyResponse> | Observable<VerifyResponse> | VerifyResponse;
30
45
  }
31
46
 
32
47
  export function AuthServiceControllerMethods() {
33
48
  return function (constructor: Function) {
34
- const grpcMethods: string[] = ["sendOtp"];
49
+ const grpcMethods: string[] = ["login", "verify"];
35
50
  for (const method of grpcMethods) {
36
51
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
52
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipsync-software/contracts",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -3,14 +3,26 @@ syntax = "proto3";
3
3
  package auth.v1;
4
4
 
5
5
  service AuthService{
6
- rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
6
+ rpc Login (LoginRequest) returns (LoginResponse);
7
+ rpc Verify (VerifyRequest) returns (VerifyResponse);
7
8
  }
8
9
 
9
- message SendOtpRequest{
10
+ message LoginRequest{
10
11
  string identifier =1;
11
12
  string method = 2;
12
13
  }
13
14
 
14
- message SendOtpResponse{
15
- bool ok = 1;
15
+ message LoginResponse{
16
+ string req_id = 1;
17
+ }
18
+
19
+ message VerifyRequest{
20
+ string req_id = 1;
21
+ string code = 2;
22
+ }
23
+
24
+ message VerifyResponse {
25
+ string access_token = 1;
26
+ string refresh_token = 2;
27
+ string redirect_url = 3;
16
28
  }