@sakura-skytree/leaf-eats-contracts 1.1.1 → 1.1.3
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/profile.ts +68 -0
- package/package.json +1 -1
- package/proto/profile.proto +31 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -4,5 +4,6 @@ exports.PROTO_PATHS = void 0;
|
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
exports.PROTO_PATHS = {
|
|
6
6
|
AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
|
|
7
|
-
SESSION: (0, path_1.join)(__dirname, '../../proto/session.proto')
|
|
7
|
+
SESSION: (0, path_1.join)(__dirname, '../../proto/session.proto'),
|
|
8
|
+
PROFILE: (0, path_1.join)(__dirname, '../../proto/profile.proto')
|
|
8
9
|
};
|
package/gen/profile.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
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: 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 GetProfileRequest {
|
|
14
|
+
accountId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetProfileResponse {
|
|
18
|
+
profile: Profile | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface UpdateProfileRequest {
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
address?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface UpdateProfileResponse {
|
|
27
|
+
profile: Profile | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Profile {
|
|
31
|
+
name: string;
|
|
32
|
+
address: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const PROFILE_V1_PACKAGE_NAME = "profile.v1";
|
|
36
|
+
|
|
37
|
+
export interface ProfileServiceClient {
|
|
38
|
+
getProfile(request: GetProfileRequest): Observable<GetProfileResponse>;
|
|
39
|
+
|
|
40
|
+
updateProfile(request: UpdateProfileRequest): Observable<UpdateProfileResponse>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ProfileServiceController {
|
|
44
|
+
getProfile(
|
|
45
|
+
request: GetProfileRequest,
|
|
46
|
+
): Promise<GetProfileResponse> | Observable<GetProfileResponse> | GetProfileResponse;
|
|
47
|
+
|
|
48
|
+
updateProfile(
|
|
49
|
+
request: UpdateProfileRequest,
|
|
50
|
+
): Promise<UpdateProfileResponse> | Observable<UpdateProfileResponse> | UpdateProfileResponse;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function ProfileServiceControllerMethods() {
|
|
54
|
+
return function (constructor: Function) {
|
|
55
|
+
const grpcMethods: string[] = ["getProfile", "updateProfile"];
|
|
56
|
+
for (const method of grpcMethods) {
|
|
57
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
58
|
+
GrpcMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
59
|
+
}
|
|
60
|
+
const grpcStreamMethods: string[] = [];
|
|
61
|
+
for (const method of grpcStreamMethods) {
|
|
62
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
+
GrpcStreamMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const PROFILE_SERVICE_NAME = "ProfileService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package profile.v1;
|
|
4
|
+
|
|
5
|
+
service ProfileService {
|
|
6
|
+
rpc GetProfile(GetProfileRequest) returns(GetProfileResponse);
|
|
7
|
+
|
|
8
|
+
rpc UpdateProfile(UpdateProfileRequest) returns(UpdateProfileResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message GetProfileRequest{
|
|
12
|
+
string account_id = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetProfileResponse{
|
|
16
|
+
Profile profile = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message UpdateProfileRequest{
|
|
20
|
+
optional string name = 1;
|
|
21
|
+
optional string address = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message UpdateProfileResponse{
|
|
25
|
+
Profile profile = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message Profile {
|
|
29
|
+
string name = 1;
|
|
30
|
+
string address = 2;
|
|
31
|
+
}
|