@eternalvisionshining/contracts 1.0.12 → 1.0.14

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,4 +1,5 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
+ readonly PROFILE: string;
4
5
  };
@@ -5,4 +5,5 @@ const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
7
  ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
8
+ PROFILE: (0, path_1.join)(__dirname, "../../proto/profile.proto"),
8
9
  };
package/gen/profile.ts ADDED
@@ -0,0 +1,83 @@
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 PatchProfileRequest {
30
+ id: string;
31
+ }
32
+
33
+ export interface PatchProfileResponse {
34
+ ok: boolean;
35
+ }
36
+
37
+ export interface Profile {
38
+ id: string;
39
+ firstName?: string | undefined;
40
+ lastName?: string | undefined;
41
+ phone?: string | undefined;
42
+ email?: string | undefined;
43
+ avatar?: string | undefined;
44
+ }
45
+
46
+ export const PROFILE_V1_PACKAGE_NAME = "profile.v1";
47
+
48
+ export interface ProfileServiceClient {
49
+ getMe(request: GetMeRequest): Observable<GetMeResponse>;
50
+
51
+ createProfile(request: CreateProfileRequest): Observable<CreateProfileResponse>;
52
+
53
+ patchProfile(request: PatchProfileRequest): Observable<PatchProfileResponse>;
54
+ }
55
+
56
+ export interface ProfileServiceController {
57
+ getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
58
+
59
+ createProfile(
60
+ request: CreateProfileRequest,
61
+ ): Promise<CreateProfileResponse> | Observable<CreateProfileResponse> | CreateProfileResponse;
62
+
63
+ patchProfile(
64
+ request: PatchProfileRequest,
65
+ ): Promise<PatchProfileResponse> | Observable<PatchProfileResponse> | PatchProfileResponse;
66
+ }
67
+
68
+ export function ProfileServiceControllerMethods() {
69
+ return function (constructor: Function) {
70
+ const grpcMethods: string[] = ["getMe", "createProfile", "patchProfile"];
71
+ for (const method of grpcMethods) {
72
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
73
+ GrpcMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
74
+ }
75
+ const grpcStreamMethods: string[] = [];
76
+ for (const method of grpcStreamMethods) {
77
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
78
+ GrpcStreamMethod("ProfileService", method)(constructor.prototype[method], method, descriptor);
79
+ }
80
+ };
81
+ }
82
+
83
+ export const PROFILE_SERVICE_NAME = "ProfileService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalvisionshining/contracts",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "protocol buffers definitions and generating TypeScript types",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,43 @@
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
+ rpc PatchProfile(PatchProfileRequest) returns (PatchProfileResponse);
9
+ }
10
+
11
+ message GetMeRequest {
12
+ string id = 1;
13
+ }
14
+
15
+
16
+ message GetMeResponse {
17
+ Profile profile = 1;
18
+ }
19
+
20
+ message CreateProfileRequest {
21
+ string id = 1;
22
+ }
23
+
24
+ message CreateProfileResponse {
25
+ bool ok = 1;
26
+ }
27
+
28
+ message PatchProfileRequest {
29
+ string id = 1;
30
+ }
31
+
32
+ message PatchProfileResponse {
33
+ bool ok = 1;
34
+ }
35
+
36
+ message Profile {
37
+ string id = 1;
38
+ optional string first_name = 2;
39
+ optional string last_name = 3;
40
+ optional string phone = 4;
41
+ optional string email = 5;
42
+ optional string avatar = 6;
43
+ }