@sakura-skytree/leaf-eats-contracts 1.0.8 → 1.1.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.
@@ -1,3 +1,4 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly SESSION: string;
3
4
  };
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTO_PATHS = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
- AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto')
6
+ AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
+ SESSION: (0, path_1.join)(__dirname, '../../proto/session.proto')
7
8
  };
package/gen/auth.ts CHANGED
@@ -33,6 +33,11 @@ export interface CheckUserResponse {
33
33
  check: string;
34
34
  }
35
35
 
36
+ export interface Account {
37
+ id: string;
38
+ email: string;
39
+ }
40
+
36
41
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
37
42
 
38
43
  export interface AuthServiceClient {
package/gen/session.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  /* eslint-disable */
8
8
  import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
9
  import { Observable } from "rxjs";
10
+ import { Account } from "./auth";
10
11
 
11
12
  export const protobufPackage = "session.v1";
12
13
 
@@ -35,6 +36,14 @@ export interface DestroySessionResponse {
35
36
  ok: boolean;
36
37
  }
37
38
 
39
+ export interface GetAccountBySessionRequest {
40
+ sessionId: string;
41
+ }
42
+
43
+ export interface GetAccountBySessionResponse {
44
+ account: Account | undefined;
45
+ }
46
+
38
47
  export interface Session {
39
48
  id: string;
40
49
  }
@@ -47,6 +56,8 @@ export interface SessionServiceClient {
47
56
  getUserSessions(request: GetUserSessionsRequest): Observable<GetUserSessionsResponse>;
48
57
 
49
58
  destroySession(request: DestroySessionRequest): Observable<DestroySessionResponse>;
59
+
60
+ getAccountBySession(request: GetAccountBySessionRequest): Observable<GetAccountBySessionResponse>;
50
61
  }
51
62
 
52
63
  export interface SessionServiceController {
@@ -61,11 +72,15 @@ export interface SessionServiceController {
61
72
  destroySession(
62
73
  request: DestroySessionRequest,
63
74
  ): Promise<DestroySessionResponse> | Observable<DestroySessionResponse> | DestroySessionResponse;
75
+
76
+ getAccountBySession(
77
+ request: GetAccountBySessionRequest,
78
+ ): Promise<GetAccountBySessionResponse> | Observable<GetAccountBySessionResponse> | GetAccountBySessionResponse;
64
79
  }
65
80
 
66
81
  export function SessionServiceControllerMethods() {
67
82
  return function (constructor: Function) {
68
- const grpcMethods: string[] = ["createSession", "getUserSessions", "destroySession"];
83
+ const grpcMethods: string[] = ["createSession", "getUserSessions", "destroySession", "getAccountBySession"];
69
84
  for (const method of grpcMethods) {
70
85
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
71
86
  GrpcMethod("SessionService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-skytree/leaf-eats-contracts",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/",
package/proto/auth.proto CHANGED
@@ -31,4 +31,9 @@ message LoginResponse {
31
31
 
32
32
  message CheckUserResponse {
33
33
  string check = 1;
34
+ }
35
+
36
+ message Account {
37
+ string id = 1;
38
+ string email = 2;
34
39
  }
@@ -2,10 +2,14 @@ syntax = "proto3";
2
2
 
3
3
  package session.v1;
4
4
 
5
+ import "auth.proto";
6
+
5
7
  service SessionService {
6
8
  rpc CreateSession(CreateSessionRequest) returns(CreateSessionResponse);
7
9
  rpc GetUserSessions(GetUserSessionsRequest) returns(GetUserSessionsResponse);
8
10
  rpc DestroySession(DestroySessionRequest) returns(DestroySessionResponse);
11
+
12
+ rpc GetAccountBySession(GetAccountBySessionRequest) returns(GetAccountBySessionResponse);
9
13
  }
10
14
 
11
15
  message CreateSessionRequest {
@@ -33,6 +37,14 @@ message DestroySessionResponse {
33
37
  bool ok = 1;
34
38
  }
35
39
 
40
+ message GetAccountBySessionRequest{
41
+ string session_id = 1;
42
+ }
43
+
44
+ message GetAccountBySessionResponse{
45
+ auth.v1.Account account = 1;
46
+ }
47
+
36
48
  message Session {
37
49
  string id = 1;
38
50
  }