@sakura-skytree/leaf-eats-contracts 1.0.7 → 1.0.9
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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +2 -1
- package/gen/auth.ts +2 -31
- package/gen/session.ts +81 -0
- package/package.json +1 -1
- package/proto/auth.proto +1 -21
- package/proto/session.proto +38 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -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
|
@@ -17,7 +17,7 @@ export interface CreateUserRequest {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface CreateUserResponse {
|
|
20
|
-
sessionId: string
|
|
20
|
+
sessionId: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface LoginRequest {
|
|
@@ -29,23 +29,6 @@ export interface LoginResponse {
|
|
|
29
29
|
sessionId: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export interface GetUserSessionsRequest {
|
|
33
|
-
userId: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface GetUserSessionsResponse {
|
|
37
|
-
sessionId: string[];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface RemoveUserSessionRequest {
|
|
41
|
-
userId: string;
|
|
42
|
-
sessionId: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface RemoveUserSessionResponse {
|
|
46
|
-
ok: boolean;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
32
|
export interface CheckUserResponse {
|
|
50
33
|
check: string;
|
|
51
34
|
}
|
|
@@ -58,10 +41,6 @@ export interface AuthServiceClient {
|
|
|
58
41
|
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
59
42
|
|
|
60
43
|
login(request: LoginRequest): Observable<LoginResponse>;
|
|
61
|
-
|
|
62
|
-
getUserSessions(request: GetUserSessionsRequest): Observable<GetUserSessionsResponse>;
|
|
63
|
-
|
|
64
|
-
removeUserSession(request: RemoveUserSessionRequest): Observable<RemoveUserSessionResponse>;
|
|
65
44
|
}
|
|
66
45
|
|
|
67
46
|
export interface AuthServiceController {
|
|
@@ -72,19 +51,11 @@ export interface AuthServiceController {
|
|
|
72
51
|
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
73
52
|
|
|
74
53
|
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
75
|
-
|
|
76
|
-
getUserSessions(
|
|
77
|
-
request: GetUserSessionsRequest,
|
|
78
|
-
): Promise<GetUserSessionsResponse> | Observable<GetUserSessionsResponse> | GetUserSessionsResponse;
|
|
79
|
-
|
|
80
|
-
removeUserSession(
|
|
81
|
-
request: RemoveUserSessionRequest,
|
|
82
|
-
): Promise<RemoveUserSessionResponse> | Observable<RemoveUserSessionResponse> | RemoveUserSessionResponse;
|
|
83
54
|
}
|
|
84
55
|
|
|
85
56
|
export function AuthServiceControllerMethods() {
|
|
86
57
|
return function (constructor: Function) {
|
|
87
|
-
const grpcMethods: string[] = ["checkUser", "createUser", "login"
|
|
58
|
+
const grpcMethods: string[] = ["checkUser", "createUser", "login"];
|
|
88
59
|
for (const method of grpcMethods) {
|
|
89
60
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
90
61
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/session.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.0
|
|
4
|
+
// protoc v7.35.1
|
|
5
|
+
// source: session.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "session.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateSessionRequest {
|
|
14
|
+
accountId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CreateSessionResponse {
|
|
18
|
+
session: Session | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface GetUserSessionsRequest {
|
|
22
|
+
accountId: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface GetUserSessionsResponse {
|
|
26
|
+
sessions: Session[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DestroySessionRequest {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
accountId: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DestroySessionResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Session {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
43
|
+
|
|
44
|
+
export interface SessionServiceClient {
|
|
45
|
+
createSession(request: CreateSessionRequest): Observable<CreateSessionResponse>;
|
|
46
|
+
|
|
47
|
+
getUserSessions(request: GetUserSessionsRequest): Observable<GetUserSessionsResponse>;
|
|
48
|
+
|
|
49
|
+
destroySession(request: DestroySessionRequest): Observable<DestroySessionResponse>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface SessionServiceController {
|
|
53
|
+
createSession(
|
|
54
|
+
request: CreateSessionRequest,
|
|
55
|
+
): Promise<CreateSessionResponse> | Observable<CreateSessionResponse> | CreateSessionResponse;
|
|
56
|
+
|
|
57
|
+
getUserSessions(
|
|
58
|
+
request: GetUserSessionsRequest,
|
|
59
|
+
): Promise<GetUserSessionsResponse> | Observable<GetUserSessionsResponse> | GetUserSessionsResponse;
|
|
60
|
+
|
|
61
|
+
destroySession(
|
|
62
|
+
request: DestroySessionRequest,
|
|
63
|
+
): Promise<DestroySessionResponse> | Observable<DestroySessionResponse> | DestroySessionResponse;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function SessionServiceControllerMethods() {
|
|
67
|
+
return function (constructor: Function) {
|
|
68
|
+
const grpcMethods: string[] = ["createSession", "getUserSessions", "destroySession"];
|
|
69
|
+
for (const method of grpcMethods) {
|
|
70
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
71
|
+
GrpcMethod("SessionService", method)(constructor.prototype[method], method, descriptor);
|
|
72
|
+
}
|
|
73
|
+
const grpcStreamMethods: string[] = [];
|
|
74
|
+
for (const method of grpcStreamMethods) {
|
|
75
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
76
|
+
GrpcStreamMethod("SessionService", method)(constructor.prototype[method], method, descriptor);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const SESSION_SERVICE_NAME = "SessionService";
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -9,9 +9,6 @@ service AuthService {
|
|
|
9
9
|
|
|
10
10
|
rpc CreateUser(CreateUserRequest) returns(CreateUserResponse);
|
|
11
11
|
rpc Login(LoginRequest) returns(LoginResponse);
|
|
12
|
-
|
|
13
|
-
rpc GetUserSessions(GetUserSessionsRequest) returns(GetUserSessionsResponse);
|
|
14
|
-
rpc RemoveUserSession(RemoveUserSessionRequest) returns(RemoveUserSessionResponse);
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
message CreateUserRequest {
|
|
@@ -20,7 +17,7 @@ message CreateUserRequest {
|
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
message CreateUserResponse {
|
|
23
|
-
|
|
20
|
+
string session_id = 1;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
message LoginRequest {
|
|
@@ -32,23 +29,6 @@ message LoginResponse {
|
|
|
32
29
|
string session_id = 1;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
message GetUserSessionsRequest {
|
|
36
|
-
string user_id = 1;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
message GetUserSessionsResponse {
|
|
40
|
-
repeated string session_id = 1;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
message RemoveUserSessionRequest {
|
|
44
|
-
string user_id = 1;
|
|
45
|
-
string session_id = 2;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
message RemoveUserSessionResponse {
|
|
49
|
-
bool ok = 1;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
32
|
message CheckUserResponse {
|
|
53
33
|
string check = 1;
|
|
54
34
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package session.v1;
|
|
4
|
+
|
|
5
|
+
service SessionService {
|
|
6
|
+
rpc CreateSession(CreateSessionRequest) returns(CreateSessionResponse);
|
|
7
|
+
rpc GetUserSessions(GetUserSessionsRequest) returns(GetUserSessionsResponse);
|
|
8
|
+
rpc DestroySession(DestroySessionRequest) returns(DestroySessionResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message CreateSessionRequest {
|
|
12
|
+
string account_id = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message CreateSessionResponse {
|
|
16
|
+
Session session = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetUserSessionsRequest {
|
|
20
|
+
string account_id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GetUserSessionsResponse {
|
|
24
|
+
repeated Session sessions = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message DestroySessionRequest {
|
|
28
|
+
string session_id = 1;
|
|
29
|
+
string account_id = 2;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message DestroySessionResponse {
|
|
33
|
+
bool ok = 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message Session {
|
|
37
|
+
string id = 1;
|
|
38
|
+
}
|