@sync-chat/contracts 1.1.1 → 1.1.3
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/generated/auth/auth.ts +13 -4
- package/package.json +6 -2
- package/proto/auth/auth.proto +10 -3
- package/generated/auth.ts +0 -47
package/generated/auth/auth.ts
CHANGED
|
@@ -17,23 +17,32 @@ export interface RegisterRequest {
|
|
|
17
17
|
userDesc: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface AuthResponse {
|
|
21
21
|
message: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export interface LoginRequest {
|
|
25
|
+
email: string;
|
|
26
|
+
password: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
25
30
|
|
|
26
31
|
export interface AuthServiceClient {
|
|
27
|
-
register(request: RegisterRequest): Observable<
|
|
32
|
+
register(request: RegisterRequest): Observable<AuthResponse>;
|
|
33
|
+
|
|
34
|
+
login(request: LoginRequest): Observable<AuthResponse>;
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
export interface AuthServiceController {
|
|
31
|
-
register(request: RegisterRequest): Promise<
|
|
38
|
+
register(request: RegisterRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
|
|
39
|
+
|
|
40
|
+
login(request: LoginRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
export function AuthServiceControllerMethods() {
|
|
35
44
|
return function (constructor: Function) {
|
|
36
|
-
const grpcMethods: string[] = ["register"];
|
|
45
|
+
const grpcMethods: string[] = ["register", "login"];
|
|
37
46
|
for (const method of grpcMethods) {
|
|
38
47
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
39
48
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sync-chat/contracts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Protobuf definitions and generated TypeScript types",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"generate": "
|
|
6
|
+
"generate": "node ./src/generate-proto.mjs"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"proto",
|
|
@@ -18,5 +18,9 @@
|
|
|
18
18
|
"@nestjs/microservices": "^11.1.21",
|
|
19
19
|
"rxjs": "^7.8.2",
|
|
20
20
|
"ts-proto": "^2.11.8"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^25.9.1",
|
|
24
|
+
"glob": "^13.0.6"
|
|
21
25
|
}
|
|
22
26
|
}
|
package/proto/auth/auth.proto
CHANGED
|
@@ -2,7 +2,9 @@ syntax = "proto3";
|
|
|
2
2
|
package auth.v1;
|
|
3
3
|
|
|
4
4
|
service AuthService {
|
|
5
|
-
rpc Register(RegisterRequest) returns (
|
|
5
|
+
rpc Register(RegisterRequest) returns (AuthResponse);
|
|
6
|
+
|
|
7
|
+
rpc Login(LoginRequest) returns (AuthResponse);
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
message RegisterRequest {
|
|
@@ -12,6 +14,11 @@ message RegisterRequest {
|
|
|
12
14
|
string userDesc = 4;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
message
|
|
17
|
+
message AuthResponse {
|
|
16
18
|
string message = 1;
|
|
17
|
-
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message LoginRequest {
|
|
22
|
+
string email = 1;
|
|
23
|
+
string password = 2;
|
|
24
|
+
}
|
package/generated/auth.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.8
|
|
4
|
-
// protoc v7.34.1
|
|
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
|
-
ok: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
|
-
|
|
24
|
-
export interface AuthServiceClient {
|
|
25
|
-
sendOtp(request: SendOTPRequest): Observable<SendOTPResponse>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface AuthServiceController {
|
|
29
|
-
sendOtp(request: SendOTPRequest): Promise<SendOTPResponse> | Observable<SendOTPResponse> | SendOTPResponse;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function AuthServiceControllerMethods() {
|
|
33
|
-
return function (constructor: Function) {
|
|
34
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
35
|
-
for (const method of grpcMethods) {
|
|
36
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
37
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
38
|
-
}
|
|
39
|
-
const grpcStreamMethods: string[] = [];
|
|
40
|
-
for (const method of grpcStreamMethods) {
|
|
41
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
42
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|