@requ1emz/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 +1 -0
- package/gen/auth.ts +1 -1
- package/gen/user.ts +95 -0
- package/package.json +1 -1
- package/proto/auth.proto +1 -1
- package/proto/user.proto +47 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/auth.ts
CHANGED
package/gen/user.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: user.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "user.v1";
|
|
12
|
+
|
|
13
|
+
export interface SendCreateUserRequest {
|
|
14
|
+
email: string;
|
|
15
|
+
password: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SendCreateUserResponse {
|
|
19
|
+
accountId: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SendGetUserRequest {
|
|
23
|
+
accountId: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SendGetUserResponse {
|
|
27
|
+
accountId: string;
|
|
28
|
+
email: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface SendUpdateUserRequest {
|
|
32
|
+
accountId: string;
|
|
33
|
+
email: string;
|
|
34
|
+
password: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface SendUpdateUserResponse {
|
|
38
|
+
accountId: string;
|
|
39
|
+
email: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SendDeleteUserRequest {
|
|
43
|
+
accountId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface SendDeleteUserResponse {
|
|
47
|
+
status: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const USER_V1_PACKAGE_NAME = "user.v1";
|
|
51
|
+
|
|
52
|
+
export interface UserServiceClient {
|
|
53
|
+
createUser(request: SendCreateUserRequest): Observable<SendCreateUserResponse>;
|
|
54
|
+
|
|
55
|
+
getUser(request: SendGetUserRequest): Observable<SendGetUserResponse>;
|
|
56
|
+
|
|
57
|
+
updateUser(request: SendUpdateUserRequest): Observable<SendUpdateUserResponse>;
|
|
58
|
+
|
|
59
|
+
deleteUser(request: SendDeleteUserRequest): Observable<SendDeleteUserResponse>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface UserServiceController {
|
|
63
|
+
createUser(
|
|
64
|
+
request: SendCreateUserRequest,
|
|
65
|
+
): Promise<SendCreateUserResponse> | Observable<SendCreateUserResponse> | SendCreateUserResponse;
|
|
66
|
+
|
|
67
|
+
getUser(
|
|
68
|
+
request: SendGetUserRequest,
|
|
69
|
+
): Promise<SendGetUserResponse> | Observable<SendGetUserResponse> | SendGetUserResponse;
|
|
70
|
+
|
|
71
|
+
updateUser(
|
|
72
|
+
request: SendUpdateUserRequest,
|
|
73
|
+
): Promise<SendUpdateUserResponse> | Observable<SendUpdateUserResponse> | SendUpdateUserResponse;
|
|
74
|
+
|
|
75
|
+
deleteUser(
|
|
76
|
+
request: SendDeleteUserRequest,
|
|
77
|
+
): Promise<SendDeleteUserResponse> | Observable<SendDeleteUserResponse> | SendDeleteUserResponse;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function UserServiceControllerMethods() {
|
|
81
|
+
return function (constructor: Function) {
|
|
82
|
+
const grpcMethods: string[] = ["createUser", "getUser", "updateUser", "deleteUser"];
|
|
83
|
+
for (const method of grpcMethods) {
|
|
84
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
85
|
+
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
86
|
+
}
|
|
87
|
+
const grpcStreamMethods: string[] = [];
|
|
88
|
+
for (const method of grpcStreamMethods) {
|
|
89
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
90
|
+
GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const USER_SERVICE_NAME = "UserService";
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
package/proto/user.proto
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package user.v1;
|
|
4
|
+
|
|
5
|
+
service UserService {
|
|
6
|
+
rpc CreateUser (SendCreateUserRequest) returns (SendCreateUserResponse);
|
|
7
|
+
rpc GetUser (SendGetUserRequest) returns (SendGetUserResponse);
|
|
8
|
+
rpc UpdateUser (SendUpdateUserRequest) returns (SendUpdateUserResponse);
|
|
9
|
+
rpc DeleteUser (SendDeleteUserRequest) returns (SendDeleteUserResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message SendCreateUserRequest {
|
|
13
|
+
string email = 1;
|
|
14
|
+
string password = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message SendCreateUserResponse {
|
|
18
|
+
string account_id = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message SendGetUserRequest {
|
|
22
|
+
string account_id = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message SendGetUserResponse {
|
|
26
|
+
string account_id = 1;
|
|
27
|
+
string email = 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message SendUpdateUserRequest {
|
|
31
|
+
string account_id = 1;
|
|
32
|
+
string email = 2;
|
|
33
|
+
string password = 3;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message SendUpdateUserResponse {
|
|
37
|
+
string account_id = 1;
|
|
38
|
+
string email = 2;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message SendDeleteUserRequest {
|
|
42
|
+
string account_id = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message SendDeleteUserResponse {
|
|
46
|
+
bool status = 1;
|
|
47
|
+
}
|