@cas-cinema/contracts 1.0.9 → 1.0.10

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
  };
package/gen/account.ts ADDED
@@ -0,0 +1,70 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.0
4
+ // protoc v6.33.4
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";
12
+
13
+ /** Роли пользователей */
14
+ export enum Role {
15
+ USER = 0,
16
+ ADMIN = 1,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ /** Запрос на отправку аккаунта по id пользователя */
21
+ export interface GetAccountRequest {
22
+ id: string;
23
+ }
24
+
25
+ /** Ответ на запрос отправки аккаунта */
26
+ export interface GetAccountResponse {
27
+ id: string;
28
+ phone: string;
29
+ email: string;
30
+ isPhoneVerified: string;
31
+ isEmailVerified: string;
32
+ role: Role;
33
+ }
34
+
35
+ export const ACCOUNT_PACKAGE_NAME = "account";
36
+
37
+ /** Сервис аккаунтов пользователей */
38
+
39
+ export interface AccountServiceClient {
40
+ /** Отправка аккаунта пользователя */
41
+
42
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
43
+ }
44
+
45
+ /** Сервис аккаунтов пользователей */
46
+
47
+ export interface AccountServiceController {
48
+ /** Отправка аккаунта пользователя */
49
+
50
+ getAccount(
51
+ request: GetAccountRequest,
52
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
53
+ }
54
+
55
+ export function AccountServiceControllerMethods() {
56
+ return function (constructor: Function) {
57
+ const grpcMethods: string[] = ["getAccount"];
58
+ for (const method of grpcMethods) {
59
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
60
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
61
+ }
62
+ const grpcStreamMethods: string[] = [];
63
+ for (const method of grpcStreamMethods) {
64
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
65
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
66
+ }
67
+ };
68
+ }
69
+
70
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cas-cinema/contracts",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Protobuf definition and generated TS types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,30 @@
1
+ syntax = "proto3";
2
+
3
+ package account;
4
+
5
+ // Сервис аккаунтов пользователей
6
+ service AccountService {
7
+ // Отправка аккаунта пользователя
8
+ rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+ }
10
+
11
+ // Запрос на отправку аккаунта по id пользователя
12
+ message GetAccountRequest {
13
+ string id = 1;
14
+ }
15
+
16
+ // Ответ на запрос отправки аккаунта
17
+ message GetAccountResponse {
18
+ string id = 1;
19
+ string phone = 2;
20
+ string email = 3;
21
+ string is_phone_verified = 4;
22
+ string is_email_verified = 5;
23
+ Role role = 6;
24
+ }
25
+
26
+ // Роли пользователей
27
+ enum Role {
28
+ USER = 0;
29
+ ADMIN = 1;
30
+ }