@bogdancinema/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 +47 -0
- package/package.json +28 -0
- package/proto/auth.proto +17 -0
package/gen/auth.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
ok: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
|
+
|
|
24
|
+
export interface AuthNameClient {
|
|
25
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface AuthNameController {
|
|
29
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function AuthNameControllerMethods() {
|
|
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("AuthName", 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("AuthName", method)(constructor.prototype[method], method, descriptor);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const AUTH_NAME_SERVICE_NAME = "AuthName";
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bogdancinema/contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Protobuf definitions and generated Typescript types",
|
|
5
|
+
"packageManager": "yarn@4.10.3",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Bogdan Umaniuk",
|
|
8
|
+
"email": "umaniukbogdan@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"generate": "PATH=\"$(yarn bin):$PATH\" protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"proto",
|
|
19
|
+
"gen"
|
|
20
|
+
],
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"ts-proto": "^2.4.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@nestjs/microservices": "^11.1.11",
|
|
26
|
+
"rxjs": "^7.8.2"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/proto/auth.proto
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
service AuthName {
|
|
6
|
+
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message SendOtpRequest {
|
|
10
|
+
string identifier = 1;
|
|
11
|
+
string type = 2;
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message SendOtpResponse {
|
|
16
|
+
bool ok = 1;
|
|
17
|
+
}
|