@dewtix/contracts 1.0.5 → 1.0.6

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
@@ -1,63 +1,62 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.11.5
4
- // protoc v7.34.0
4
+ // protoc v3.21.12
5
5
  // source: auth.proto
6
6
 
7
7
  /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices'
9
- import { Observable } from 'rxjs'
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
10
 
11
- export const protobufPackage = 'auth.v1'
11
+ export const protobufPackage = "auth.v1";
12
12
 
13
13
  export interface SendOtpRequest {
14
- identifier: string
15
- type: string
14
+ identifier: string;
15
+ type: string;
16
16
  }
17
17
 
18
18
  export interface SendOtpResponse {
19
- ok: boolean
19
+ ok: boolean;
20
20
  }
21
21
 
22
- export const AUTH_V1_PACKAGE_NAME = 'auth.v1'
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";
23
34
 
24
35
  export interface AuthServiceClient {
25
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>
36
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
+
38
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
- sendOtp(
30
- request: SendOtpRequest,
31
- ): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse
42
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
32
45
  }
33
46
 
34
47
  export function AuthServiceControllerMethods() {
35
48
  return function (constructor: Function) {
36
- const grpcMethods: string[] = ['sendOtp']
49
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
37
50
  for (const method of grpcMethods) {
38
- const descriptor: any = Reflect.getOwnPropertyDescriptor(
39
- constructor.prototype,
40
- method,
41
- )
42
- GrpcMethod('AuthService', method)(
43
- constructor.prototype[method],
44
- method,
45
- descriptor,
46
- )
51
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
47
53
  }
48
- const grpcStreamMethods: string[] = []
54
+ const grpcStreamMethods: string[] = [];
49
55
  for (const method of grpcStreamMethods) {
50
- const descriptor: any = Reflect.getOwnPropertyDescriptor(
51
- constructor.prototype,
52
- method,
53
- )
54
- GrpcStreamMethod('AuthService', method)(
55
- constructor.prototype[method],
56
- method,
57
- descriptor,
58
- )
56
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
57
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
59
58
  }
60
- }
59
+ };
61
60
  }
62
61
 
63
- export const AUTH_SERVICE_NAME = 'AuthService'
62
+ export const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,23 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/empty.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "google.protobuf";
10
+
11
+ /**
12
+ * A generic empty message that you can re-use to avoid defining duplicated
13
+ * empty messages in your APIs. A typical example is to use it as the request
14
+ * or the response type of an API method. For instance:
15
+ *
16
+ * service Foo {
17
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
18
+ * }
19
+ */
20
+ export interface Empty {
21
+ }
22
+
23
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dewtix/contracts",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Protobuf defs and gen ts",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -1,28 +1,31 @@
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;
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+
7
+ service AuthService {
8
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
9
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
10
+ }
11
+
12
+
13
+ message SendOtpRequest {
14
+ string identifier = 1;
15
+ string type = 2;
16
+ }
17
+
18
+ message SendOtpResponse {
19
+ bool ok = 1;
20
+ }
21
+
22
+ message VerifyOtpRequest {
23
+ string identifier = 1;
24
+ string type = 2;
25
+ string code = 3;
26
+ }
27
+
28
+ message VerifyOtpResponse {
29
+ string access_token = 1;
30
+ string refresh_token = 2;
28
31
  }
@@ -1 +0,0 @@
1
- export * from './proto';
package/dist/src/index.js DELETED
@@ -1,17 +0,0 @@
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);
@@ -1 +0,0 @@
1
- export * from './paths';
@@ -1,17 +0,0 @@
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);
@@ -1,4 +0,0 @@
1
- export declare const PROTO_PATHS: {
2
- readonly AUTH: any;
3
- readonly ACCOUNT: any;
4
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PROTO_PATHS = void 0;
4
- const path_1 = require("path");
5
- exports.PROTO_PATHS = {
6
- AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
- ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
- };