@barumetric/contracts 1.0.9 → 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.
@@ -1,3 +1,4 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly ACCOUNT: string;
3
4
  };
@@ -4,4 +4,5 @@ exports.PROTO_PATHS = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
7
8
  };
@@ -0,0 +1,66 @@
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: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "account.v1";
12
+
13
+ export enum Role {
14
+ UNSPECIFIED = 0,
15
+ GUEST = 1,
16
+ USER = 2,
17
+ PREMIUM = 3,
18
+ EDITOR = 4,
19
+ SUPPORT = 5,
20
+ MODERATOR = 6,
21
+ ADMIN = 7,
22
+ SUPERADMIN = 8,
23
+ UNRECOGNIZED = -1,
24
+ }
25
+
26
+ export interface GetAccountRequest {
27
+ id: string;
28
+ }
29
+
30
+ export interface GetAccountResponse {
31
+ id: string;
32
+ phone: string;
33
+ email: string;
34
+ isPhoneVerified: boolean;
35
+ isEmailVerified: boolean;
36
+ role: Role;
37
+ }
38
+
39
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
40
+
41
+ export interface AccountServiceClient {
42
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
43
+ }
44
+
45
+ export interface AccountServiceController {
46
+ getAccount(
47
+ request: GetAccountRequest,
48
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
49
+ }
50
+
51
+ export function AccountServiceControllerMethods() {
52
+ return function (constructor: Function) {
53
+ const grpcMethods: string[] = ["getAccount"];
54
+ for (const method of grpcMethods) {
55
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
56
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
57
+ }
58
+ const grpcStreamMethods: string[] = [];
59
+ for (const method of grpcStreamMethods) {
60
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
61
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
62
+ }
63
+ };
64
+ }
65
+
66
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/gen/ts/auth.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.2
4
+ // protoc v3.21.12
5
5
  // source: auth.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.2
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
7
7
  /* eslint-disable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,32 @@
1
+ syntax = "proto3";
2
+
3
+ package account.v1;
4
+
5
+ service AccountService {
6
+ rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
+ }
8
+
9
+ message GetAccountRequest {
10
+ string id = 1;
11
+ }
12
+
13
+ message GetAccountResponse {
14
+ string id = 1;
15
+ string phone = 2;
16
+ string email = 3;
17
+ bool is_phone_verified = 4;
18
+ bool is_email_verified = 5;
19
+ Role role = 6;
20
+ }
21
+
22
+ enum Role {
23
+ UNSPECIFIED = 0;
24
+ GUEST = 1;
25
+ USER = 2;
26
+ PREMIUM = 3;
27
+ EDITOR = 4;
28
+ SUPPORT = 5;
29
+ MODERATOR = 6;
30
+ ADMIN = 7;
31
+ SUPERADMIN = 8;
32
+ }
package/proto/auth.proto CHANGED
@@ -1,79 +1,79 @@
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
- rpc Refresh (RefreshRequest) returns (RefreshResponse);
11
-
12
- rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
13
- rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
14
- rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
15
- rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
16
- }
17
-
18
- message SendOtpRequest {
19
- string identifier = 1;
20
- string type = 2;
21
- }
22
-
23
- message SendOtpResponse {
24
- bool ok = 1;
25
- }
26
-
27
- message VerifyOtpRequest {
28
- string identifier = 1;
29
- string type = 2;
30
- string code = 3;
31
- }
32
-
33
- message VerifyOtpResponse {
34
- string access_token = 1;
35
- string refresh_token = 2;
36
- }
37
-
38
- message RefreshRequest {
39
- string refresh_token = 1;
40
- }
41
-
42
- message RefreshResponse {
43
- string access_token = 1;
44
- string refresh_token = 2;
45
- }
46
-
47
- message TelegramInitResponse {
48
- string url = 1;
49
- }
50
-
51
- message TelegramVerifyRequest {
52
- map<string, string> query = 1;
53
- }
54
-
55
- message TelegramVerifyResponse {
56
- oneof result {
57
- string url = 1;
58
- string access_token = 2;
59
- string refresh_token = 3;
60
- }
61
- }
62
-
63
- message TelegramCompleteRequest {
64
- string session_id = 1;
65
- string phone = 2;
66
- }
67
-
68
- message TelegramCompleteResponse {
69
- string session_id = 1;
70
- }
71
-
72
- message TelegramConsumeRequest {
73
- string session_id = 1;
74
- }
75
-
76
- message TelegramConsumeResponse {
77
- string access_token = 1;
78
- 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
+ rpc Refresh (RefreshRequest) returns (RefreshResponse);
11
+
12
+ rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
13
+ rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
14
+ rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
15
+ rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
16
+ }
17
+
18
+ message SendOtpRequest {
19
+ string identifier = 1;
20
+ string type = 2;
21
+ }
22
+
23
+ message SendOtpResponse {
24
+ bool ok = 1;
25
+ }
26
+
27
+ message VerifyOtpRequest {
28
+ string identifier = 1;
29
+ string type = 2;
30
+ string code = 3;
31
+ }
32
+
33
+ message VerifyOtpResponse {
34
+ string access_token = 1;
35
+ string refresh_token = 2;
36
+ }
37
+
38
+ message RefreshRequest {
39
+ string refresh_token = 1;
40
+ }
41
+
42
+ message RefreshResponse {
43
+ string access_token = 1;
44
+ string refresh_token = 2;
45
+ }
46
+
47
+ message TelegramInitResponse {
48
+ string url = 1;
49
+ }
50
+
51
+ message TelegramVerifyRequest {
52
+ map<string, string> query = 1;
53
+ }
54
+
55
+ message TelegramVerifyResponse {
56
+ oneof result {
57
+ string url = 1;
58
+ string access_token = 2;
59
+ string refresh_token = 3;
60
+ }
61
+ }
62
+
63
+ message TelegramCompleteRequest {
64
+ string session_id = 1;
65
+ string phone = 2;
66
+ }
67
+
68
+ message TelegramCompleteResponse {
69
+ string session_id = 1;
70
+ }
71
+
72
+ message TelegramConsumeRequest {
73
+ string session_id = 1;
74
+ }
75
+
76
+ message TelegramConsumeResponse {
77
+ string access_token = 1;
78
+ string refresh_token = 2;
79
79
  }