@seatwave/contracts 1.0.2 → 1.0.4

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,4 @@
1
+ export declare const PROTO_PATHS: {
2
+ readonly AUTH: string;
3
+ readonly ACCOUNT: string;
4
+ };
@@ -0,0 +1,8 @@
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
+ };
package/gen/account.ts ADDED
@@ -0,0 +1,79 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
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
+ /** Role represents the authorization level of the account. */
14
+ export enum Role {
15
+ /** USER - Default user role with standard permissions. */
16
+ USER = 0,
17
+ /** ADMIN - Administrator role with elevated permissions. */
18
+ ADMIN = 1,
19
+ UNRECOGNIZED = -1,
20
+ }
21
+
22
+ /** Request message for retrieving an account. */
23
+ export interface GetAccountRequest {
24
+ /** Unique account identifier (UUID). */
25
+ id: string;
26
+ }
27
+
28
+ /** Response message containing account details. */
29
+ export interface GetAccountResponse {
30
+ /** Unique account identifier. */
31
+ id: string;
32
+ /** Phone number associated with the account (E.164 format). */
33
+ phone: string;
34
+ /** Email address associated with the account. */
35
+ email: string;
36
+ /** Indicates whether the phone number has been verified. */
37
+ isPhoneVerified: boolean;
38
+ /** Indicates whether the email address has been verified. */
39
+ isEmailVerified: boolean;
40
+ /** Role assigned to the account. */
41
+ role: Role;
42
+ }
43
+
44
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
45
+
46
+ /** AccountService handles account retrieval operations. */
47
+
48
+ export interface AccountServiceClient {
49
+ /** GetAccount returns account information by unique identifier. */
50
+
51
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
52
+ }
53
+
54
+ /** AccountService handles account retrieval operations. */
55
+
56
+ export interface AccountServiceController {
57
+ /** GetAccount returns account information by unique identifier. */
58
+
59
+ getAccount(
60
+ request: GetAccountRequest,
61
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
62
+ }
63
+
64
+ export function AccountServiceControllerMethods() {
65
+ return function (constructor: Function) {
66
+ const grpcMethods: string[] = ["getAccount"];
67
+ for (const method of grpcMethods) {
68
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
69
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
70
+ }
71
+ const grpcStreamMethods: string[] = [];
72
+ for (const method of grpcStreamMethods) {
73
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
74
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
75
+ }
76
+ };
77
+ }
78
+
79
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seatwave/contracts",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  "build": "tsc -p tsconfig.build.json"
10
10
  },
11
11
  "files": [
12
+ "dist",
12
13
  "proto",
13
14
  "gen"
14
15
  ],
@@ -0,0 +1,45 @@
1
+ syntax = "proto3";
2
+
3
+ package account.v1;
4
+
5
+ // AccountService handles account retrieval operations.
6
+ service AccountService {
7
+ // GetAccount returns account information by unique identifier.
8
+ rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
9
+ }
10
+
11
+ // Request message for retrieving an account.
12
+ message GetAccountRequest {
13
+ // Unique account identifier (UUID).
14
+ string id = 1;
15
+ }
16
+
17
+ // Response message containing account details.
18
+ message GetAccountResponse {
19
+ // Unique account identifier.
20
+ string id = 1;
21
+
22
+ // Phone number associated with the account (E.164 format).
23
+ string phone = 2;
24
+
25
+ // Email address associated with the account.
26
+ string email = 3;
27
+
28
+ // Indicates whether the phone number has been verified.
29
+ bool is_phone_verified = 4;
30
+
31
+ // Indicates whether the email address has been verified.
32
+ bool is_email_verified = 5;
33
+
34
+ // Role assigned to the account.
35
+ Role role = 6;
36
+ }
37
+
38
+ // Role represents the authorization level of the account.
39
+ enum Role {
40
+ // Default user role with standard permissions.
41
+ USER = 0;
42
+
43
+ // Administrator role with elevated permissions.
44
+ ADMIN = 1;
45
+ }