@shipsync-software/contracts 1.0.5 → 1.0.7

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.
@@ -0,0 +1 @@
1
+ export * from "./proto";
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./proto"), exports);
@@ -0,0 +1 @@
1
+ export * from "./paths";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./paths"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const PROTO_PATHS: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATHS = void 0;
4
+ const path_1 = require("path");
5
+ exports.PROTO_PATHS = {
6
+ AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ };
package/gen/auth.ts CHANGED
@@ -10,28 +10,42 @@ 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;
20
30
  }
21
31
 
22
32
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
33
 
24
34
  export interface AuthServiceClient {
25
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
35
+ login(request: LoginRequest): Observable<LoginResponse>;
36
+
37
+ verify(request: VerifyRequest): Observable<VerifyResponse>;
26
38
  }
27
39
 
28
40
  export interface AuthServiceController {
29
- sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
41
+ login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
42
+
43
+ verify(request: VerifyRequest): Promise<VerifyResponse> | Observable<VerifyResponse> | VerifyResponse;
30
44
  }
31
45
 
32
46
  export function AuthServiceControllerMethods() {
33
47
  return function (constructor: Function) {
34
- const grpcMethods: string[] = ["sendOtp"];
48
+ const grpcMethods: string[] = ["login", "verify"];
35
49
  for (const method of grpcMethods) {
36
50
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
51
  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.5",
3
+ "version": "1.0.7",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,7 +10,8 @@
10
10
  },
11
11
  "files": [
12
12
  "proto",
13
- "gen"
13
+ "gen",
14
+ "dist"
14
15
  ],
15
16
  "author": {
16
17
  "name": "Ivan Hrabovets",
package/proto/auth.proto CHANGED
@@ -3,14 +3,25 @@ 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;
16
27
  }