@cinema-microservices-nest/contracts 0.0.0-stage → 1.1.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 ADDED
@@ -0,0 +1,64 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.15.3
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 interface VerifyOtpRequest {
23
+ identifier: string;
24
+ type: string;
25
+ code: string;
26
+ }
27
+
28
+ export interface VerifyOtpResponse {
29
+ accessToken: string;
30
+ refreshToken: string;
31
+ }
32
+
33
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
+
35
+ export interface AuthServiceClient {
36
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
+
38
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
39
+ }
40
+
41
+ export interface AuthServiceController {
42
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
45
+ }
46
+
47
+ export function AuthServiceControllerMethods() {
48
+ return function (constructor: Function) {
49
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
50
+ for (const method of grpcMethods) {
51
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
53
+ Object.defineProperty(constructor.prototype, method, descriptor);
54
+ }
55
+ const grpcStreamMethods: string[] = [];
56
+ for (const method of grpcStreamMethods) {
57
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
58
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
59
+ Object.defineProperty(constructor.prototype, method, descriptor);
60
+ }
61
+ };
62
+ }
63
+
64
+ export const AUTH_SERVICE_NAME = "AuthService";
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "@cinema-microservices-nest/contracts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "Protobuf definitions and generated TypeScript types",
5
+ "scripts": {
6
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
+ },
8
+ "files": [
9
+ "proto",
10
+ "gen"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "devDependencies": {
16
+ "ts-proto": "^2.15.3"
17
+ },
18
+ "dependencies": {
19
+ "@nestjs/microservices": "^12.1.3",
20
+ "rxjs": "^7.8.2"
21
+ }
22
+ }
@@ -0,0 +1,28 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ service AuthService {
6
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
8
+ }
9
+
10
+ message SendOtpRequest {
11
+ string identifier = 1;
12
+ string type = 2;
13
+ }
14
+
15
+ message SendOtpResponse {
16
+ bool ok = 1;
17
+ }
18
+
19
+ message VerifyOtpRequest {
20
+ string identifier = 1;
21
+ string type = 2;
22
+ string code = 3;
23
+ }
24
+
25
+ message VerifyOtpResponse {
26
+ string access_token = 1;
27
+ string refresh_token = 2;
28
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.