@krontickets/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.
@@ -0,0 +1,63 @@
1
+ import { Observable } from "rxjs";
2
+ export declare enum Role {
3
+ USER = 0,
4
+ ADMIN = 1,
5
+ UNRECOGNIZED = -1
6
+ }
7
+ export interface GetAccountRequest {
8
+ id: string;
9
+ }
10
+ export interface GetAccountResponse {
11
+ id: string;
12
+ phone: string;
13
+ email: string;
14
+ isPhoneVerified: boolean;
15
+ isEmailVerified: boolean;
16
+ role: Role;
17
+ }
18
+ export interface InitEmailChangeRequest {
19
+ email: string;
20
+ userId: string;
21
+ }
22
+ export interface InitEmailChangeResponse {
23
+ ok: boolean;
24
+ }
25
+ export interface ConfirmEmailChangeRequest {
26
+ email: string;
27
+ code: string;
28
+ userId: string;
29
+ }
30
+ export interface ConfirmEmailChangeResponse {
31
+ ok: boolean;
32
+ }
33
+ export interface InitPhoneChangeRequest {
34
+ phone: string;
35
+ userId: string;
36
+ }
37
+ export interface InitPhoneChangeResponse {
38
+ ok: boolean;
39
+ }
40
+ export interface ConfirmPhoneChangeRequest {
41
+ phone: string;
42
+ code: string;
43
+ userId: string;
44
+ }
45
+ export interface ConfirmPhoneChangeResponse {
46
+ ok: boolean;
47
+ }
48
+ export interface AccountServiceClient {
49
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
50
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
51
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
52
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
53
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
54
+ }
55
+ export interface AccountServiceController {
56
+ getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
57
+ initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
58
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
59
+ initPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
60
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
61
+ }
62
+ export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
63
+ export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.1
5
+ // protoc v3.19.6
6
+ // source: account.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ACCOUNT_SERVICE_NAME = exports.Role = void 0;
9
+ exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ var Role;
13
+ (function (Role) {
14
+ Role[Role["USER"] = 0] = "USER";
15
+ Role[Role["ADMIN"] = 1] = "ADMIN";
16
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
17
+ })(Role || (exports.Role = Role = {}));
18
+ function AccountServiceControllerMethods() {
19
+ return function (constructor) {
20
+ const grpcMethods = [
21
+ "getAccount",
22
+ "initEmailChange",
23
+ "confirmEmailChange",
24
+ "initPhoneChange",
25
+ "confirmPhoneChange",
26
+ ];
27
+ for (const method of grpcMethods) {
28
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
29
+ (0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
30
+ }
31
+ const grpcStreamMethods = [];
32
+ for (const method of grpcStreamMethods) {
33
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
34
+ (0, microservices_1.GrpcStreamMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
35
+ }
36
+ };
37
+ }
38
+ exports.ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,36 @@
1
+ import { Observable } from "rxjs";
2
+ export interface SendOtpRequest {
3
+ identifier: string;
4
+ type: string;
5
+ }
6
+ export interface SendOtpResponse {
7
+ ok: boolean;
8
+ }
9
+ export interface VerifyOtpRequest {
10
+ identifier: string;
11
+ type: string;
12
+ code: string;
13
+ }
14
+ export interface VerifyOtpResponse {
15
+ accessToken: string;
16
+ refreshToken: string;
17
+ }
18
+ export interface RefreshRequest {
19
+ refreshToken: string;
20
+ }
21
+ export interface RefreshResponse {
22
+ accessToken: string;
23
+ refreshToken: string;
24
+ }
25
+ export interface AuthServiceClient {
26
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
27
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
28
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
29
+ }
30
+ export interface AuthServiceController {
31
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
32
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
33
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
34
+ }
35
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
36
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.1
5
+ // protoc v3.19.6
6
+ // source: auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AUTH_SERVICE_NAME = void 0;
9
+ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ function AuthServiceControllerMethods() {
13
+ return function (constructor) {
14
+ const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
15
+ for (const method of grpcMethods) {
16
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
17
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
18
+ }
19
+ const grpcStreamMethods = [];
20
+ for (const method of grpcStreamMethods) {
21
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
22
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
23
+ }
24
+ };
25
+ }
26
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,3 @@
1
+ export * from './proto';
2
+ export * from '../gen/account';
3
+ export * from '../gen/auth';
@@ -0,0 +1,19 @@
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);
18
+ __exportStar(require("../gen/account"), exports);
19
+ __exportStar(require("../gen/auth"), 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_PATH: {
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_PATH = void 0;
4
+ const path_1 = require("path");
5
+ exports.PROTO_PATH = {
6
+ AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
+ ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krontickets/contracts",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Protobuf defenitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -16,7 +16,9 @@
16
16
  ],
17
17
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
18
18
  "dependencies": {
19
- "@nestjs/microservices": "^11.1.11",
19
+ "@nestjs/common": "^11.1.12",
20
+ "@nestjs/core": "^11.1.12",
21
+ "@nestjs/microservices": "^11.1.12",
20
22
  "rxjs": "^7.8.2",
21
23
  "ts-proto": "^2.10.1"
22
24
  },