@mondocinema/contracts 1.0.4 → 1.0.5

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,4 +1,5 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly ACCOUNTS: string;
3
4
  };
4
5
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/proto/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;CAEd,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/proto/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;CAGd,CAAC"}
@@ -4,5 +4,6 @@ exports.PROTO_PATHS = void 0;
4
4
  const node_path_1 = require("node:path");
5
5
  exports.PROTO_PATHS = {
6
6
  AUTH: (0, node_path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ ACCOUNTS: (0, node_path_1.join)(__dirname, "../../proto/accounts.proto"),
7
8
  };
8
9
  //# sourceMappingURL=paths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/proto/paths.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AAEpB,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,IAAA,gBAAI,EAAC,SAAS,EAAE,wBAAwB,CAAC;CACvC,CAAC"}
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/proto/paths.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AAEpB,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,IAAA,gBAAI,EAAC,SAAS,EAAE,wBAAwB,CAAC;IAC/C,QAAQ,EAAE,IAAA,gBAAI,EAAC,SAAS,EAAE,4BAA4B,CAAC;CAC/C,CAAC"}
@@ -0,0 +1,59 @@
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: accounts.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "accounts.v1";
12
+
13
+ export enum Role {
14
+ USER = 0,
15
+ ADMIN = 1,
16
+ UNRECOGNIZED = -1,
17
+ }
18
+
19
+ export interface GetAccountRequest {
20
+ id: string;
21
+ }
22
+
23
+ export interface GetAccountResponse {
24
+ id: string;
25
+ phone: string;
26
+ email: string;
27
+ isPhoneVerified: boolean;
28
+ isEmailVerified: boolean;
29
+ role: Role;
30
+ }
31
+
32
+ export const ACCOUNTS_V1_PACKAGE_NAME = "accounts.v1";
33
+
34
+ export interface AccountsServiceClient {
35
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
36
+ }
37
+
38
+ export interface AccountsServiceController {
39
+ getAccount(
40
+ request: GetAccountRequest,
41
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
42
+ }
43
+
44
+ export function AccountsServiceControllerMethods() {
45
+ return function (constructor: Function) {
46
+ const grpcMethods: string[] = ["getAccount"];
47
+ for (const method of grpcMethods) {
48
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
+ GrpcMethod("AccountsService", method)(constructor.prototype[method], method, descriptor);
50
+ }
51
+ const grpcStreamMethods: string[] = [];
52
+ for (const method of grpcStreamMethods) {
53
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
+ GrpcStreamMethod("AccountsService", method)(constructor.prototype[method], method, descriptor);
55
+ }
56
+ };
57
+ }
58
+
59
+ export const ACCOUNTS_SERVICE_NAME = "AccountsService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondocinema/contracts",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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,25 @@
1
+ syntax = "proto3";
2
+
3
+ package accounts.v1;
4
+
5
+ service AccountsService {
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
+ USER = 0;
24
+ ADMIN = 1;
25
+ }