@eternalvisionshining/contracts 1.0.12 → 1.0.13
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/profile.ts +69 -0
- package/package.json +1 -1
- package/proto/profile.proto +34 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/profile.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: profile.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "profile.v1";
|
|
12
|
+
|
|
13
|
+
export interface GetMeRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetMeResponse {
|
|
18
|
+
profile: Profile | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateProfileRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateProfileResponse {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Profile {
|
|
30
|
+
id: string;
|
|
31
|
+
firstName?: string | undefined;
|
|
32
|
+
lastName?: string | undefined;
|
|
33
|
+
phone?: string | undefined;
|
|
34
|
+
email?: string | undefined;
|
|
35
|
+
avatar?: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const PROFILE_V1_PACKAGE_NAME = "profile.v1";
|
|
39
|
+
|
|
40
|
+
export interface ProfileServiceClient {
|
|
41
|
+
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
42
|
+
|
|
43
|
+
createProfile(request: CreateProfileRequest): Observable<CreateProfileResponse>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ProfileServiceController {
|
|
47
|
+
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
48
|
+
|
|
49
|
+
createProfile(
|
|
50
|
+
request: CreateProfileRequest,
|
|
51
|
+
): Promise<CreateProfileResponse> | Observable<CreateProfileResponse> | CreateProfileResponse;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function ProfileServiceControllerMethods() {
|
|
55
|
+
return function (constructor: Function) {
|
|
56
|
+
const grpcMethods: string[] = ["getMe", "createProfile"];
|
|
57
|
+
for (const method of grpcMethods) {
|
|
58
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
59
|
+
GrpcMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
60
|
+
}
|
|
61
|
+
const grpcStreamMethods: string[] = [];
|
|
62
|
+
for (const method of grpcStreamMethods) {
|
|
63
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
64
|
+
GrpcStreamMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const PROFILE_SERVICE_NAME = "ProfileService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package profile.v1;
|
|
4
|
+
|
|
5
|
+
service ProfileService {
|
|
6
|
+
rpc GetMe(GetMeRequest) returns (GetMeResponse);
|
|
7
|
+
rpc CreateProfile(CreateProfileRequest) returns (CreateProfileResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message GetMeRequest {
|
|
11
|
+
string id = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
message GetMeResponse {
|
|
16
|
+
Profile profile = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message CreateProfileRequest {
|
|
20
|
+
string id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message CreateProfileResponse {
|
|
24
|
+
bool ok = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message Profile {
|
|
28
|
+
string id = 1;
|
|
29
|
+
optional string first_name = 2;
|
|
30
|
+
optional string last_name = 3;
|
|
31
|
+
optional string phone = 4;
|
|
32
|
+
optional string email = 5;
|
|
33
|
+
optional string avatar = 6;
|
|
34
|
+
}
|