@factcaf-org/contracts 1.0.1 → 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 CHANGED
@@ -10,6 +10,17 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth.v1";
12
12
 
13
+ export interface VerifyOtpRequest {
14
+ identifier: string;
15
+ type: string;
16
+ code: string;
17
+ }
18
+
19
+ export interface VerifyOtpResponse {
20
+ accessToken: string;
21
+ refreshToken: string;
22
+ }
23
+
13
24
  export interface SendOtpRequest {
14
25
  identifier: string;
15
26
  type: string;
@@ -23,15 +34,19 @@ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
34
 
24
35
  export interface AuthServiceClient {
25
36
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
+
38
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
42
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
30
45
  }
31
46
 
32
47
  export function AuthServiceControllerMethods() {
33
48
  return function (constructor: Function) {
34
- const grpcMethods: string[] = ["sendOtp"];
49
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
35
50
  for (const method of grpcMethods) {
36
51
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
52
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/gen/test.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.11.2
4
+ // protoc v3.21.12
5
+ // source: test.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "test.v1";
12
+
13
+ export interface Test1Request {
14
+ field1: string;
15
+ field2: string;
16
+ }
17
+
18
+ export interface Test1Response {
19
+ field1: string;
20
+ field2: string;
21
+ }
22
+
23
+ export interface Test2Request {
24
+ field1: string;
25
+ field2: string;
26
+ field3: string;
27
+ }
28
+
29
+ export interface Test2Response {
30
+ field1: string;
31
+ field2: string;
32
+ field3: string;
33
+ }
34
+
35
+ export const TEST_V1_PACKAGE_NAME = "test.v1";
36
+
37
+ export interface TestServiceClient {
38
+ test1(request: Test1Request): Observable<Test1Response>;
39
+
40
+ test2(request: Test2Request): Observable<Test2Response>;
41
+ }
42
+
43
+ export interface TestServiceController {
44
+ test1(request: Test1Request): Promise<Test1Response> | Observable<Test1Response> | Test1Response;
45
+
46
+ test2(request: Test2Request): Promise<Test2Response> | Observable<Test2Response> | Test2Response;
47
+ }
48
+
49
+ export function TestServiceControllerMethods() {
50
+ return function (constructor: Function) {
51
+ const grpcMethods: string[] = ["test1", "test2"];
52
+ for (const method of grpcMethods) {
53
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
+ GrpcMethod("TestService", method)(constructor.prototype[method], method, descriptor);
55
+ }
56
+ const grpcStreamMethods: string[] = [];
57
+ for (const method of grpcStreamMethods) {
58
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
59
+ GrpcStreamMethod("TestService", method)(constructor.prototype[method], method, descriptor);
60
+ }
61
+ };
62
+ }
63
+
64
+ export const TEST_SERVICE_NAME = "TestService";
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "@factcaf-org/contracts",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Contracts",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
8
10
  "repository": {
9
11
  "url": "https://github.com/FatCafOrg/contracts",
10
12
  "type": "git"
11
13
  },
12
14
  "scripts": {
13
- "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
15
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
16
+ "build": "tsc -p tsconfig.build.json"
14
17
  },
15
18
  "files": [
16
19
  "proto",
@@ -18,9 +21,11 @@
18
21
  ],
19
22
  "dependencies": {
20
23
  "@nestjs/microservices": "^11.1.14",
24
+ "@types/node": "^25.3.0",
21
25
  "rxjs": "^7.8.2"
22
26
  },
23
27
  "devDependencies": {
24
- "ts-proto": "^2.11.2"
28
+ "ts-proto": "^2.11.2",
29
+ "typescript": "^5.9.3"
25
30
  }
26
31
  }
package/proto/auth.proto CHANGED
@@ -4,6 +4,18 @@ package auth.v1;
4
4
 
5
5
  service AuthService {
6
6
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
+ rpc verifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
8
+ }
9
+
10
+ message VerifyOtpRequest {
11
+ string identifier = 1;
12
+ string type = 2;
13
+ string code = 3;
14
+ }
15
+
16
+ message VerifyOtpResponse {
17
+ string access_token = 1;
18
+ string refresh_token = 2;
7
19
  }
8
20
 
9
21
  message SendOtpRequest {
@@ -0,0 +1,30 @@
1
+ syntax = "proto3";
2
+
3
+ package test.v1;
4
+
5
+ service TestService {
6
+ rpc Test1 (Test1Request) returns (Test1Response);
7
+ rpc Test2 (Test2Request) returns (Test2Response);
8
+ }
9
+
10
+ message Test1Request {
11
+ string field1 = 1;
12
+ string field2 = 2;
13
+ }
14
+
15
+ message Test1Response {
16
+ string field1 = 1;
17
+ string field2 = 2;
18
+ }
19
+
20
+ message Test2Request {
21
+ string field1 = 1;
22
+ string field2 = 2;
23
+ string field3 = 3;
24
+ }
25
+
26
+ message Test2Response {
27
+ string field1 = 1;
28
+ string field2 = 2;
29
+ string field3 = 3;
30
+ }