@slack-clone-org/contracts 1.0.6 → 1.0.7

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
  };
@@ -0,0 +1,67 @@
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: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "auth.v1";
12
+
13
+ export enum GlobalRole {
14
+ USER = 0,
15
+ ADMIN = 1,
16
+ UNRECOGNIZED = -1,
17
+ }
18
+
19
+ export interface GetAccountRequest {
20
+ accountId: string;
21
+ }
22
+
23
+ export interface GetAccountResponse {
24
+ accountId: string;
25
+ phoneNumber: string;
26
+ email: string;
27
+ isPhoneVerified: string;
28
+ isEmailVerified: string;
29
+ role: string;
30
+ }
31
+
32
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
33
+
34
+ /** AccountService provides account-related operations. */
35
+
36
+ export interface AccountServiceClient {
37
+ /** GetAccount retrieves account details by account ID. */
38
+
39
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
40
+ }
41
+
42
+ /** AccountService provides account-related operations. */
43
+
44
+ export interface AccountServiceController {
45
+ /** GetAccount retrieves account details by account ID. */
46
+
47
+ getAccount(
48
+ request: GetAccountRequest,
49
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
50
+ }
51
+
52
+ export function AccountServiceControllerMethods() {
53
+ return function (constructor: Function) {
54
+ const grpcMethods: string[] = ["getAccount"];
55
+ for (const method of grpcMethods) {
56
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
57
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
58
+ }
59
+ const grpcStreamMethods: string[] = [];
60
+ for (const method of grpcStreamMethods) {
61
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
62
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
63
+ }
64
+ };
65
+ }
66
+
67
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack-clone-org/contracts",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Shared gRPC contracts and TypeScript definitions for Slack Clone microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,27 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ // AccountService provides account-related operations.
6
+ service AccountService {
7
+ // GetAccount retrieves account details by account ID.
8
+ rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+ }
10
+
11
+ message GetAccountRequest {
12
+ string account_id = 1;
13
+ }
14
+
15
+ message GetAccountResponse {
16
+ string account_id = 1;
17
+ string phone_number = 2;
18
+ string email = 3;
19
+ string is_phone_verified = 4;
20
+ string is_email_verified = 5;
21
+ string role = 6;
22
+ }
23
+
24
+ enum GlobalRole {
25
+ USER = 0;
26
+ ADMIN = 1;
27
+ }