@slack-clone-org/contracts 1.0.0

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/Readme.md ADDED
@@ -0,0 +1,13 @@
1
+ # @slack-clone-org/contracts
2
+
3
+ Shared gRPC Protocol Buffer contracts for Slack Clone microservices.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add @slack-clone-org/contracts
9
+ ```
10
+
11
+ ## License
12
+
13
+ MIT
@@ -0,0 +1,55 @@
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: auth.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 interface SendOtpRequest {
14
+ identifier: string;
15
+ type: string;
16
+ }
17
+
18
+ export interface SendOtpResponse {
19
+ message: boolean;
20
+ }
21
+
22
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
+
24
+ /** AuthService provides authentication-related operations. */
25
+
26
+ export interface AuthServiceClient {
27
+ /** SendOtp sends a one-time password to the provided identifier. */
28
+
29
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
30
+ }
31
+
32
+ /** AuthService provides authentication-related operations. */
33
+
34
+ export interface AuthServiceController {
35
+ /** SendOtp sends a one-time password to the provided identifier. */
36
+
37
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
38
+ }
39
+
40
+ export function AuthServiceControllerMethods() {
41
+ return function (constructor: Function) {
42
+ const grpcMethods: string[] = ["sendOtp"];
43
+ for (const method of grpcMethods) {
44
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
45
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
46
+ }
47
+ const grpcStreamMethods: string[] = [];
48
+ for (const method of grpcStreamMethods) {
49
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
50
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
51
+ }
52
+ };
53
+ }
54
+
55
+ export const AUTH_SERVICE_NAME = "AuthService";
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@slack-clone-org/contracts",
3
+ "version": "1.0.0",
4
+ "description": "Shared gRPC contracts and TypeScript definitions for Slack Clone microservices",
5
+ "keywords": [
6
+ "grpc",
7
+ "protobuf",
8
+ "microservices",
9
+ "nestjs",
10
+ "slack-clone",
11
+ "contracts",
12
+ "typescript",
13
+ "rpc"
14
+ ],
15
+ "author": {
16
+ "name": "Valeh",
17
+ "email": "amirbekovaleh@gmail.com"
18
+ },
19
+ "license": "MIT",
20
+ "scripts": {
21
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit"
22
+ },
23
+ "files": [
24
+ "proto",
25
+ "generated",
26
+ "README.md"
27
+ ],
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "registry": "https://registry.npmjs.org/"
31
+ },
32
+ "peerDependencies": {
33
+ "@nestjs/microservices": "^11.0.0",
34
+ "rxjs": "^7.0.0"
35
+ },
36
+ "dependencies": {
37
+ "@nestjs/microservices": "^11.1.11",
38
+ "rxjs": "^7.8.2"
39
+ },
40
+ "homepage": "https://github.com/slack-clone-org/contracts#readme",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/slack-clone-org/contracts.git"
44
+ },
45
+ "bugs": {
46
+ "url": "https://github.com/slack-clone-org/contracts/issues"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^22.10.7",
50
+ "nodemon": "^3.1.9",
51
+ "ts-proto": "^2.10.1",
52
+ "typescript": "^5.7.3"
53
+ },
54
+ "engines": {
55
+ "node": ">=18.0.0",
56
+ "pnpm": ">=8.0.0"
57
+ }
58
+ }
@@ -0,0 +1,18 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ // AuthService provides authentication-related operations.
6
+ service AuthService {
7
+ // SendOtp sends a one-time password to the provided identifier.
8
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
9
+ }
10
+
11
+ message SendOtpRequest {
12
+ string identifier = 1;
13
+ string type = 2;
14
+ }
15
+
16
+ message SendOtpResponse {
17
+ bool message = 1;
18
+ }