@taskora-uni/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.
@@ -0,0 +1,48 @@
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: 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 LoginRequest {
14
+ email: string;
15
+ password: string;
16
+ }
17
+
18
+ export interface LoginResponse {
19
+ accessToken: string;
20
+ refreshToken: string;
21
+ }
22
+
23
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
24
+
25
+ export interface AuthServiceClient {
26
+ login(request: LoginRequest): Observable<LoginResponse>;
27
+ }
28
+
29
+ export interface AuthServiceController {
30
+ login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
31
+ }
32
+
33
+ export function AuthServiceControllerMethods() {
34
+ return function (constructor: Function) {
35
+ const grpcMethods: string[] = ["login"];
36
+ for (const method of grpcMethods) {
37
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
38
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
39
+ }
40
+ const grpcStreamMethods: string[] = [];
41
+ for (const method of grpcStreamMethods) {
42
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
43
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
44
+ }
45
+ };
46
+ }
47
+
48
+ export const AUTH_SERVICE_NAME = "AuthService";
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@taskora-uni/contracts",
3
+ "version": "1.0.0",
4
+ "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "proto",
9
+ "generated"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "dependencies": {
15
+ "@nestjs/microservices": "^11.1.17",
16
+ "rxjs": "^7.8.2",
17
+ "ts-proto": "^2.11.6"
18
+ },
19
+ "scripts": {
20
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit"
21
+ }
22
+ }
@@ -0,0 +1,17 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ service AuthService {
6
+ rpc Login(LoginRequest) returns (LoginResponse);
7
+ }
8
+
9
+ message LoginRequest {
10
+ string email = 1;
11
+ string password = 2;
12
+ }
13
+
14
+ message LoginResponse {
15
+ string access_token = 1;
16
+ string refresh_token = 2;
17
+ }