@eternalvisionshining/contracts 1.0.5 → 1.0.6

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,3 +1,4 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly ACCOUNT: string;
3
4
  };
@@ -4,4 +4,5 @@ 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
+ ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
7
8
  };
package/gen/account.ts ADDED
@@ -0,0 +1,57 @@
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: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "account.v1";
12
+
13
+ export enum EnumRole {
14
+ USER = 0,
15
+ ADMIN = 1,
16
+ UNRECOGNIZED = -1,
17
+ }
18
+
19
+ export interface AccountRequest {
20
+ id: string;
21
+ }
22
+
23
+ export interface AccountResponse {
24
+ id: string;
25
+ phone: string;
26
+ email: string;
27
+ isPhoneVerified: boolean;
28
+ isEmailVerified: boolean;
29
+ role: EnumRole;
30
+ }
31
+
32
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
+
34
+ export interface AccountServiceClient {
35
+ getAccount(request: AccountRequest): Observable<AccountResponse>;
36
+ }
37
+
38
+ export interface AccountServiceController {
39
+ getAccount(request: AccountRequest): Promise<AccountResponse> | Observable<AccountResponse> | AccountResponse;
40
+ }
41
+
42
+ export function AccountServiceControllerMethods() {
43
+ return function (constructor: Function) {
44
+ const grpcMethods: string[] = ["getAccount"];
45
+ for (const method of grpcMethods) {
46
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
47
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
48
+ }
49
+ const grpcStreamMethods: string[] = [];
50
+ for (const method of grpcStreamMethods) {
51
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
53
+ }
54
+ };
55
+ }
56
+
57
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalvisionshining/contracts",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "protocol buffers definitions and generating TypeScript types",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,25 @@
1
+ syntax = "proto3";
2
+
3
+ package account.v1;
4
+
5
+ service AccountService {
6
+ rpc GetAccount (AccountRequest) returns (AccountResponse);
7
+ }
8
+
9
+ message AccountRequest {
10
+ string id = 1;
11
+ }
12
+
13
+ message AccountResponse {
14
+ string id = 1;
15
+ string phone = 2;
16
+ string email = 3;
17
+ bool is_phone_verified = 4;
18
+ bool is_email_verified = 5;
19
+ EnumRole role = 6;
20
+ }
21
+
22
+ enum EnumRole {
23
+ USER = 0;
24
+ ADMIN = 1;
25
+ }