@artemscinemaservice/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/gen/auth.ts +55 -0
- package/package.json +19 -0
- package/proto/auth.proto +18 -0
package/gen/auth.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.5
|
|
4
|
+
// protoc v7.34.0
|
|
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
|
+
success: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
|
+
|
|
24
|
+
/** Auth service */
|
|
25
|
+
|
|
26
|
+
export interface AuthServiceClient {
|
|
27
|
+
/** send otp to a user by identifier */
|
|
28
|
+
|
|
29
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Auth service */
|
|
33
|
+
|
|
34
|
+
export interface AuthServiceController {
|
|
35
|
+
/** send otp to a user by 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,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@artemscinemaservice/contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"proto",
|
|
9
|
+
"gen"
|
|
10
|
+
],
|
|
11
|
+
"description": "Protobuf contracts for Cinema Service",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@nestjs/microservices": "^11.1.17",
|
|
14
|
+
"rxjs": "^7.8.2"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/proto/auth.proto
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
//Auth service
|
|
6
|
+
service AuthService {
|
|
7
|
+
//send otp to a user by 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 success = 1;
|
|
18
|
+
}
|