@ilyadulyuk-teacinema/contacts 1.0.0 → 1.0.2

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.
@@ -0,0 +1 @@
1
+ export * from "./proto";
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./proto"), exports);
@@ -0,0 +1 @@
1
+ export * from "./paths";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./paths"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const PROTO_PATHS: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATHS = void 0;
4
+ const node_path_1 = require("node:path");
5
+ exports.PROTO_PATHS = {
6
+ AUTH: (0, node_path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ };
package/gen/auth.ts CHANGED
@@ -19,19 +19,34 @@ export interface SendOtpResponse {
19
19
  ok: boolean;
20
20
  }
21
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
+
22
33
  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/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@ilyadulyuk-teacinema/contacts",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Protobuf defenitions and geneated TypeScript types.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
5
7
  "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
6
9
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
10
  },
8
11
  "files": [
9
12
  "proto",
10
- "gen"
13
+ "gen",
14
+ "dist"
11
15
  ],
12
16
  "author": "Ilya Dulyuk",
13
17
  "publishConfig": {
@@ -17,5 +21,9 @@
17
21
  "@nestjs/microservices": "^11.1.11",
18
22
  "rxjs": "^7.8.2",
19
23
  "ts-proto": "^2.10.1"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^25.0.3",
27
+ "typescript": "^5.9.3"
20
28
  }
21
29
  }
package/proto/auth.proto CHANGED
@@ -4,6 +4,7 @@ package auth.v1;
4
4
 
5
5
  service AuthService {
6
6
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
7
8
  }
8
9
 
9
10
  message SendOtpRequest {
@@ -13,4 +14,15 @@ message SendOtpRequest {
13
14
 
14
15
  message SendOtpResponse {
15
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;
16
28
  }