@slack-clone-org/contracts 1.1.3 → 1.1.5

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.
@@ -2,4 +2,5 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly TELEGRAM: string;
5
+ readonly USER: string;
5
6
  };
@@ -6,4 +6,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
8
  TELEGRAM: (0, path_1.join)(__dirname, "../../proto/telegram.proto"),
9
+ USER: (0, path_1.join)(__dirname, "../../proto/user.proto"),
9
10
  };
@@ -0,0 +1,98 @@
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: user.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "user.v1";
12
+
13
+ export interface GetMeRequest {
14
+ id: string;
15
+ }
16
+
17
+ export interface GetMeResponse {
18
+ user: User | undefined;
19
+ }
20
+
21
+ export interface CreateUserRequest {
22
+ id: string;
23
+ }
24
+
25
+ export interface CreateUserResponse {
26
+ ok: string;
27
+ }
28
+
29
+ /**
30
+ * User represents a user profile.
31
+ * NOTE: Additional fields (bio, status, timezone, locale, etc.) will be added later.
32
+ */
33
+ export interface User {
34
+ id: string;
35
+ name?: string | undefined;
36
+ phone?: string | undefined;
37
+ email?: string | undefined;
38
+ avatar?: string | undefined;
39
+ }
40
+
41
+ export const USER_V1_PACKAGE_NAME = "user.v1";
42
+
43
+ /**
44
+ * UserService provides user profile-related operations.
45
+ * NOTE: This is a minimal implementation. Full profile fields and additional
46
+ * RPCs (GetUser, GetUsers, SearchUsers, UpdateUser) will be added in a future iteration.
47
+ */
48
+
49
+ export interface UserServiceClient {
50
+ /** GetMe retrieves the profile of the currently authenticated user. */
51
+
52
+ getMe(request: GetMeRequest): Observable<GetMeResponse>;
53
+
54
+ /**
55
+ * CreateUser creates a new user profile after successful authentication.
56
+ * Called internally when a new account is registered.
57
+ */
58
+
59
+ createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
60
+ }
61
+
62
+ /**
63
+ * UserService provides user profile-related operations.
64
+ * NOTE: This is a minimal implementation. Full profile fields and additional
65
+ * RPCs (GetUser, GetUsers, SearchUsers, UpdateUser) will be added in a future iteration.
66
+ */
67
+
68
+ export interface UserServiceController {
69
+ /** GetMe retrieves the profile of the currently authenticated user. */
70
+
71
+ getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
72
+
73
+ /**
74
+ * CreateUser creates a new user profile after successful authentication.
75
+ * Called internally when a new account is registered.
76
+ */
77
+
78
+ createUser(
79
+ request: CreateUserRequest,
80
+ ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
81
+ }
82
+
83
+ export function UserServiceControllerMethods() {
84
+ return function (constructor: Function) {
85
+ const grpcMethods: string[] = ["getMe", "createUser"];
86
+ for (const method of grpcMethods) {
87
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
88
+ GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
89
+ }
90
+ const grpcStreamMethods: string[] = [];
91
+ for (const method of grpcStreamMethods) {
92
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
93
+ GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
94
+ }
95
+ };
96
+ }
97
+
98
+ export const USER_SERVICE_NAME = "UserService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slack-clone-org/contracts",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
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,40 @@
1
+ syntax = "proto3";
2
+
3
+ package user.v1;
4
+
5
+ // UserService provides user profile-related operations.
6
+ // NOTE: This is a minimal implementation. Full profile fields and additional
7
+ // RPCs (GetUser, GetUsers, SearchUsers, UpdateUser) will be added in a future iteration.
8
+ service UserService {
9
+ // GetMe retrieves the profile of the currently authenticated user.
10
+ rpc GetMe (GetMeRequest) returns (GetMeResponse);
11
+ // CreateUser creates a new user profile after successful authentication.
12
+ // Called internally when a new account is registered.
13
+ rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
14
+ }
15
+
16
+ message GetMeRequest {
17
+ string id = 1;
18
+ }
19
+
20
+ message GetMeResponse {
21
+ User user = 1;
22
+ }
23
+
24
+ message CreateUserRequest {
25
+ string id = 1;
26
+ }
27
+
28
+ message CreateUserResponse {
29
+ string ok = 1;
30
+ }
31
+
32
+ // User represents a user profile.
33
+ // NOTE: Additional fields (bio, status, timezone, locale, etc.) will be added later.
34
+ message User {
35
+ string id = 1;
36
+ optional string name = 2;
37
+ optional string phone = 3;
38
+ optional string email = 4;
39
+ optional string avatar = 5;
40
+ }