@readytomog/contracts 1.5.10 → 1.5.12

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.
Files changed (47) hide show
  1. package/dist/gen/auth.d.ts +75 -0
  2. package/dist/gen/auth.js +36 -0
  3. package/dist/gen/chat.d.ts +61 -0
  4. package/dist/gen/chat.js +26 -0
  5. package/{gen/google/protobuf/empty.ts → dist/gen/google/protobuf/empty.d.ts} +0 -12
  6. package/dist/gen/google/protobuf/empty.js +7 -0
  7. package/dist/gen/payment.d.ts +71 -0
  8. package/dist/gen/payment.js +33 -0
  9. package/dist/gen/user.d.ts +32 -0
  10. package/dist/gen/user.js +35 -0
  11. package/dist/index.d.ts +7 -0
  12. package/dist/{src/index.js → index.js} +4 -0
  13. package/package.json +2 -2
  14. package/dist/src/index.d.ts +0 -3
  15. package/gen/auth.ts +0 -152
  16. package/gen/chat.ts +0 -113
  17. package/gen/google/protobuf/timestamp.ts +0 -119
  18. package/gen/payment.ts +0 -138
  19. package/gen/user.ts +0 -66
  20. /package/dist/{src/event → event}/auth/create-user.interface.d.ts +0 -0
  21. /package/dist/{src/event → event}/auth/create-user.interface.js +0 -0
  22. /package/dist/{src/event → event}/auth/index.d.ts +0 -0
  23. /package/dist/{src/event → event}/auth/index.js +0 -0
  24. /package/dist/{src/event → event}/auth/send-email-otp.interface.d.ts +0 -0
  25. /package/dist/{src/event → event}/auth/send-email-otp.interface.js +0 -0
  26. /package/dist/{src/event → event}/auth/send-sms-otp.interface.d.ts +0 -0
  27. /package/dist/{src/event → event}/auth/send-sms-otp.interface.js +0 -0
  28. /package/dist/{src/event → event}/auth/update-user.interface.d.ts +0 -0
  29. /package/dist/{src/event → event}/auth/update-user.interface.js +0 -0
  30. /package/dist/{src/event → event}/chat/create-message.interface.d.ts +0 -0
  31. /package/dist/{src/event → event}/chat/create-message.interface.js +0 -0
  32. /package/dist/{src/event → event}/chat/index.d.ts +0 -0
  33. /package/dist/{src/event → event}/chat/index.js +0 -0
  34. /package/dist/{src/event → event}/chat/send-message.interface.d.ts +0 -0
  35. /package/dist/{src/event → event}/chat/send-message.interface.js +0 -0
  36. /package/dist/{src/event → event}/events-constants.d.ts +0 -0
  37. /package/dist/{src/event → event}/events-constants.js +0 -0
  38. /package/dist/{src/event → event}/index.d.ts +0 -0
  39. /package/dist/{src/event → event}/index.js +0 -0
  40. /package/dist/{src/proto → proto}/index.d.ts +0 -0
  41. /package/dist/{src/proto → proto}/index.js +0 -0
  42. /package/dist/{src/proto → proto}/paths.d.ts +0 -0
  43. /package/dist/{src/proto → proto}/paths.js +0 -0
  44. /package/dist/{src/types → types}/index.d.ts +0 -0
  45. /package/dist/{src/types → types}/index.js +0 -0
  46. /package/dist/{src/types → types}/user.d.ts +0 -0
  47. /package/dist/{src/types → types}/user.js +0 -0
@@ -0,0 +1,75 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ export interface LoginRequest {
4
+ email: string;
5
+ password: string;
6
+ }
7
+ export interface LoginResponse {
8
+ accessToken: string;
9
+ refreshToken: string;
10
+ }
11
+ export interface RegistrationRequest {
12
+ email: string;
13
+ name: string;
14
+ surname: string;
15
+ password: string;
16
+ }
17
+ export interface RegistrationResponse {
18
+ message: string;
19
+ }
20
+ export interface LogoutResponse {
21
+ ok: boolean;
22
+ }
23
+ export interface RefreshAuthResponse {
24
+ accessToken: string;
25
+ refreshToken: string;
26
+ }
27
+ export interface GenerateSecretResponse {
28
+ qrCode: string;
29
+ }
30
+ export interface VerifyTokenRequest {
31
+ token: string;
32
+ }
33
+ export interface VerifyTokenResponse {
34
+ verify: boolean;
35
+ }
36
+ export interface DisableTwoFactorResponse {
37
+ disable: boolean;
38
+ }
39
+ export interface SendOtpRequest {
40
+ identifier: string;
41
+ }
42
+ export interface SendOtpRespose {
43
+ ok: boolean;
44
+ }
45
+ export interface VerifyOtpRequest {
46
+ identifier: string;
47
+ otp: number;
48
+ }
49
+ export interface VerifyOtpResponse {
50
+ verify: boolean;
51
+ }
52
+ export interface AuthServiceClient {
53
+ login(request: LoginRequest): Observable<LoginResponse>;
54
+ registration(request: RegistrationRequest): Observable<RegistrationResponse>;
55
+ logout(request: Empty): Observable<LogoutResponse>;
56
+ refreshAuth(request: Empty): Observable<RefreshAuthResponse>;
57
+ generateSecret(request: Empty): Observable<GenerateSecretResponse>;
58
+ verifyToken(request: VerifyTokenRequest): Observable<VerifyTokenResponse>;
59
+ disableTwoFactor(request: Empty): Observable<DisableTwoFactorResponse>;
60
+ sendOtp(request: SendOtpRequest): Observable<SendOtpRespose>;
61
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
62
+ }
63
+ export interface AuthServiceController {
64
+ login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
65
+ registration(request: RegistrationRequest): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
66
+ logout(request: Empty): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
67
+ refreshAuth(request: Empty): Promise<RefreshAuthResponse> | Observable<RefreshAuthResponse> | RefreshAuthResponse;
68
+ generateSecret(request: Empty): Promise<GenerateSecretResponse> | Observable<GenerateSecretResponse> | GenerateSecretResponse;
69
+ verifyToken(request: VerifyTokenRequest): Promise<VerifyTokenResponse> | Observable<VerifyTokenResponse> | VerifyTokenResponse;
70
+ disableTwoFactor(request: Empty): Promise<DisableTwoFactorResponse> | Observable<DisableTwoFactorResponse> | DisableTwoFactorResponse;
71
+ sendOtp(request: SendOtpRequest): Promise<SendOtpRespose> | Observable<SendOtpRespose> | SendOtpRespose;
72
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
73
+ }
74
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
75
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc v7.35.1
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 = [
15
+ "login",
16
+ "registration",
17
+ "logout",
18
+ "refreshAuth",
19
+ "generateSecret",
20
+ "verifyToken",
21
+ "disableTwoFactor",
22
+ "sendOtp",
23
+ "verifyOtp",
24
+ ];
25
+ for (const method of grpcMethods) {
26
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
27
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
28
+ }
29
+ const grpcStreamMethods = [];
30
+ for (const method of grpcStreamMethods) {
31
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
32
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
33
+ }
34
+ };
35
+ }
36
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,61 @@
1
+ import { Observable } from "rxjs";
2
+ export interface CreateChatRequest {
3
+ participant: string;
4
+ }
5
+ export interface CreateChatResponse {
6
+ id: string;
7
+ users: User[];
8
+ }
9
+ export interface DeleteChatRequest {
10
+ chatId: string;
11
+ }
12
+ export interface DeleteChatResponse {
13
+ message: string;
14
+ }
15
+ export interface Message {
16
+ message: string;
17
+ senderId: string;
18
+ id: string;
19
+ createdAt: string;
20
+ updatedAt: string;
21
+ chatId: string;
22
+ }
23
+ export interface User {
24
+ id: string;
25
+ name: string;
26
+ surname: string;
27
+ avatar: string;
28
+ }
29
+ export interface Chat {
30
+ id: string;
31
+ users: User[];
32
+ lastMessage: string;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ }
36
+ export interface GetMessagesRequest {
37
+ chatId: string;
38
+ }
39
+ export interface GetMessagesResponse {
40
+ messages: Message[];
41
+ }
42
+ export interface GetChatsRequest {
43
+ userId: string;
44
+ }
45
+ export interface GetChatsResponse {
46
+ chats: Chat[];
47
+ }
48
+ export interface ChatServiceClient {
49
+ createChat(request: CreateChatRequest): Observable<CreateChatResponse>;
50
+ deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
51
+ getMessages(request: GetMessagesRequest): Observable<GetMessagesResponse>;
52
+ getChats(request: GetChatsRequest): Observable<GetChatsResponse>;
53
+ }
54
+ export interface ChatServiceController {
55
+ createChat(request: CreateChatRequest): Promise<CreateChatResponse> | Observable<CreateChatResponse> | CreateChatResponse;
56
+ deleteChat(request: DeleteChatRequest): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
57
+ getMessages(request: GetMessagesRequest): Promise<GetMessagesResponse> | Observable<GetMessagesResponse> | GetMessagesResponse;
58
+ getChats(request: GetChatsRequest): Promise<GetChatsResponse> | Observable<GetChatsResponse> | GetChatsResponse;
59
+ }
60
+ export declare function ChatServiceControllerMethods(): (constructor: Function) => void;
61
+ export declare const CHAT_SERVICE_NAME = "ChatService";
@@ -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.11.8
5
+ // protoc v7.35.1
6
+ // source: chat.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CHAT_SERVICE_NAME = void 0;
9
+ exports.ChatServiceControllerMethods = ChatServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ function ChatServiceControllerMethods() {
13
+ return function (constructor) {
14
+ const grpcMethods = ["createChat", "deleteChat", "getMessages", "getChats"];
15
+ for (const method of grpcMethods) {
16
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
17
+ (0, microservices_1.GrpcMethod)("ChatService", 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)("ChatService", method)(constructor.prototype[method], method, descriptor);
23
+ }
24
+ };
25
+ }
26
+ exports.CHAT_SERVICE_NAME = "ChatService";
@@ -1,13 +1,3 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v3.21.12
5
- // source: google/protobuf/empty.proto
6
-
7
- /* eslint-disable */
8
-
9
- export const protobufPackage = "google.protobuf";
10
-
11
1
  /**
12
2
  * A generic empty message that you can re-use to avoid defining duplicated
13
3
  * empty messages in your APIs. A typical example is to use it as the request
@@ -19,5 +9,3 @@ export const protobufPackage = "google.protobuf";
19
9
  */
20
10
  export interface Empty {
21
11
  }
22
-
23
- export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc v7.35.1
6
+ // source: google/protobuf/empty.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,71 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ export interface Transaction {
4
+ id: string;
5
+ status: string;
6
+ paymentProvider: string;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ billingPeriod: string;
10
+ amount: number;
11
+ userId: string;
12
+ planId: string;
13
+ subscriptionId: string;
14
+ }
15
+ export interface GetHistoryResponse {
16
+ transactions: Transaction[];
17
+ }
18
+ export interface InitTransactionRequest {
19
+ planId: string;
20
+ billingPeriod: string;
21
+ provider: string;
22
+ }
23
+ export interface InitTransactionResponse {
24
+ cancelUrl: string;
25
+ successUrl: string;
26
+ url: string;
27
+ }
28
+ export interface UpdateAutoRenewalStatusRequest {
29
+ isAutoRenewal: boolean;
30
+ }
31
+ export interface UpdateAutoRenewalStatusResponse {
32
+ isAutoRenewal: boolean;
33
+ }
34
+ export interface Plan {
35
+ id: string;
36
+ title: string;
37
+ description: string;
38
+ monthlyPrice: number;
39
+ annualyPrice: number;
40
+ }
41
+ export interface GetPlansResponse {
42
+ plans: Plan[];
43
+ }
44
+ export interface GetPlanByIdRequest {
45
+ planId: string;
46
+ }
47
+ export interface GetPlanByIdResponse {
48
+ plan: Plan | undefined;
49
+ }
50
+ export interface RefundRequest {
51
+ }
52
+ export interface RefundResponse {
53
+ }
54
+ export interface PaymentServiceClient {
55
+ getHistory(request: Empty): Observable<GetHistoryResponse>;
56
+ initTransaction(request: InitTransactionRequest): Observable<InitTransactionResponse>;
57
+ updateAutoRenewalStatus(request: UpdateAutoRenewalStatusRequest): Observable<UpdateAutoRenewalStatusResponse>;
58
+ getPlans(request: Empty): Observable<GetPlansResponse>;
59
+ getPlanById(request: GetPlanByIdRequest): Observable<GetPlanByIdResponse>;
60
+ refund(request: RefundRequest): Observable<RefundResponse>;
61
+ }
62
+ export interface PaymentServiceController {
63
+ getHistory(request: Empty): Promise<GetHistoryResponse> | Observable<GetHistoryResponse> | GetHistoryResponse;
64
+ initTransaction(request: InitTransactionRequest): Promise<InitTransactionResponse> | Observable<InitTransactionResponse> | InitTransactionResponse;
65
+ updateAutoRenewalStatus(request: UpdateAutoRenewalStatusRequest): Promise<UpdateAutoRenewalStatusResponse> | Observable<UpdateAutoRenewalStatusResponse> | UpdateAutoRenewalStatusResponse;
66
+ getPlans(request: Empty): Promise<GetPlansResponse> | Observable<GetPlansResponse> | GetPlansResponse;
67
+ getPlanById(request: GetPlanByIdRequest): Promise<GetPlanByIdResponse> | Observable<GetPlanByIdResponse> | GetPlanByIdResponse;
68
+ refund(request: RefundRequest): Promise<RefundResponse> | Observable<RefundResponse> | RefundResponse;
69
+ }
70
+ export declare function PaymentServiceControllerMethods(): (constructor: Function) => void;
71
+ export declare const PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc v7.35.1
6
+ // source: payment.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PAYMENT_SERVICE_NAME = void 0;
9
+ exports.PaymentServiceControllerMethods = PaymentServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ function PaymentServiceControllerMethods() {
13
+ return function (constructor) {
14
+ const grpcMethods = [
15
+ "getHistory",
16
+ "initTransaction",
17
+ "updateAutoRenewalStatus",
18
+ "getPlans",
19
+ "getPlanById",
20
+ "refund",
21
+ ];
22
+ for (const method of grpcMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ const grpcStreamMethods = [];
27
+ for (const method of grpcStreamMethods) {
28
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
29
+ (0, microservices_1.GrpcStreamMethod)("PaymentService", method)(constructor.prototype[method], method, descriptor);
30
+ }
31
+ };
32
+ }
33
+ exports.PAYMENT_SERVICE_NAME = "PaymentService";
@@ -0,0 +1,32 @@
1
+ import { Observable } from "rxjs";
2
+ export declare enum Role {
3
+ unspecified = 0,
4
+ user = 1,
5
+ participant = 2,
6
+ creator = 3,
7
+ admin = 4,
8
+ UNRECOGNIZED = -1
9
+ }
10
+ export interface GetUserByIdRequst {
11
+ userId: string;
12
+ }
13
+ export interface GetUserByIdResponse {
14
+ userId: string;
15
+ name: string;
16
+ surname: string;
17
+ isOtpVerified: boolean;
18
+ isEmailVerified: boolean;
19
+ isPhoneVerified: boolean;
20
+ isTwoFactorEnabled: boolean;
21
+ phone: string;
22
+ roles: Role[];
23
+ email: string;
24
+ }
25
+ export interface UserServiceClient {
26
+ getUserById(request: GetUserByIdRequst): Observable<GetUserByIdResponse>;
27
+ }
28
+ export interface UserServiceController {
29
+ getUserById(request: GetUserByIdRequst): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
30
+ }
31
+ export declare function UserServiceControllerMethods(): (constructor: Function) => void;
32
+ export declare const USER_SERVICE_NAME = "UserService";
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc v7.35.1
6
+ // source: user.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.USER_SERVICE_NAME = exports.Role = void 0;
9
+ exports.UserServiceControllerMethods = UserServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ var Role;
13
+ (function (Role) {
14
+ Role[Role["unspecified"] = 0] = "unspecified";
15
+ Role[Role["user"] = 1] = "user";
16
+ Role[Role["participant"] = 2] = "participant";
17
+ Role[Role["creator"] = 3] = "creator";
18
+ Role[Role["admin"] = 4] = "admin";
19
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
+ })(Role || (exports.Role = Role = {}));
21
+ function UserServiceControllerMethods() {
22
+ return function (constructor) {
23
+ const grpcMethods = ["getUserById"];
24
+ for (const method of grpcMethods) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
+ (0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
27
+ }
28
+ const grpcStreamMethods = [];
29
+ for (const method of grpcStreamMethods) {
30
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
31
+ (0, microservices_1.GrpcStreamMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
32
+ }
33
+ };
34
+ }
35
+ exports.USER_SERVICE_NAME = "UserService";
@@ -0,0 +1,7 @@
1
+ export * from "./proto";
2
+ export * from "./event";
3
+ export * from "./types";
4
+ export * from "./gen/auth";
5
+ export * from "./gen/user";
6
+ export * from "./gen/chat";
7
+ export * from "./gen/payment";
@@ -17,3 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./proto"), exports);
18
18
  __exportStar(require("./event"), exports);
19
19
  __exportStar(require("./types"), exports);
20
+ __exportStar(require("./gen/auth"), exports);
21
+ __exportStar(require("./gen/user"), exports);
22
+ __exportStar(require("./gen/chat"), exports);
23
+ __exportStar(require("./gen/payment"), exports);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@readytomog/contracts",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
- "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=useDate=true,nestJs=true,package=omit",
8
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=useDate=true,nestJs=true,package=omit,exportCommonSymbols=false",
9
9
  "build": "tsc -p tsconfig.build.json"
10
10
  },
11
11
  "files": [
@@ -1,3 +0,0 @@
1
- export * from "./proto";
2
- export * from "./event";
3
- export * from "./types";
package/gen/auth.ts DELETED
@@ -1,152 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v3.21.12
5
- // source: auth.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
- import { Empty } from "./google/protobuf/empty";
11
-
12
- export const protobufPackage = "auth.v1";
13
-
14
- export interface LoginRequest {
15
- email: string;
16
- password: string;
17
- }
18
-
19
- export interface LoginResponse {
20
- accessToken: string;
21
- refreshToken: string;
22
- }
23
-
24
- export interface RegistrationRequest {
25
- email: string;
26
- name: string;
27
- surname: string;
28
- password: string;
29
- }
30
-
31
- export interface RegistrationResponse {
32
- message: string;
33
- }
34
-
35
- export interface LogoutResponse {
36
- ok: boolean;
37
- }
38
-
39
- export interface RefreshAuthResponse {
40
- accessToken: string;
41
- refreshToken: string;
42
- }
43
-
44
- export interface GenerateSecretResponse {
45
- qrCode: string;
46
- }
47
-
48
- export interface VerifyTokenRequest {
49
- token: string;
50
- }
51
-
52
- export interface VerifyTokenResponse {
53
- verify: boolean;
54
- }
55
-
56
- export interface DisableTwoFactorResponse {
57
- disable: boolean;
58
- }
59
-
60
- export interface SendOtpRequest {
61
- identifier: string;
62
- }
63
-
64
- export interface SendOtpRespose {
65
- ok: boolean;
66
- }
67
-
68
- export interface VerifyOtpRequest {
69
- identifier: string;
70
- otp: number;
71
- }
72
-
73
- export interface VerifyOtpResponse {
74
- verify: boolean;
75
- }
76
-
77
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
78
-
79
- export interface AuthServiceClient {
80
- login(request: LoginRequest): Observable<LoginResponse>;
81
-
82
- registration(request: RegistrationRequest): Observable<RegistrationResponse>;
83
-
84
- logout(request: Empty): Observable<LogoutResponse>;
85
-
86
- refreshAuth(request: Empty): Observable<RefreshAuthResponse>;
87
-
88
- generateSecret(request: Empty): Observable<GenerateSecretResponse>;
89
-
90
- verifyToken(request: VerifyTokenRequest): Observable<VerifyTokenResponse>;
91
-
92
- disableTwoFactor(request: Empty): Observable<DisableTwoFactorResponse>;
93
-
94
- sendOtp(request: SendOtpRequest): Observable<SendOtpRespose>;
95
-
96
- verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
97
- }
98
-
99
- export interface AuthServiceController {
100
- login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
101
-
102
- registration(
103
- request: RegistrationRequest,
104
- ): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
105
-
106
- logout(request: Empty): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
107
-
108
- refreshAuth(request: Empty): Promise<RefreshAuthResponse> | Observable<RefreshAuthResponse> | RefreshAuthResponse;
109
-
110
- generateSecret(
111
- request: Empty,
112
- ): Promise<GenerateSecretResponse> | Observable<GenerateSecretResponse> | GenerateSecretResponse;
113
-
114
- verifyToken(
115
- request: VerifyTokenRequest,
116
- ): Promise<VerifyTokenResponse> | Observable<VerifyTokenResponse> | VerifyTokenResponse;
117
-
118
- disableTwoFactor(
119
- request: Empty,
120
- ): Promise<DisableTwoFactorResponse> | Observable<DisableTwoFactorResponse> | DisableTwoFactorResponse;
121
-
122
- sendOtp(request: SendOtpRequest): Promise<SendOtpRespose> | Observable<SendOtpRespose> | SendOtpRespose;
123
-
124
- verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
125
- }
126
-
127
- export function AuthServiceControllerMethods() {
128
- return function (constructor: Function) {
129
- const grpcMethods: string[] = [
130
- "login",
131
- "registration",
132
- "logout",
133
- "refreshAuth",
134
- "generateSecret",
135
- "verifyToken",
136
- "disableTwoFactor",
137
- "sendOtp",
138
- "verifyOtp",
139
- ];
140
- for (const method of grpcMethods) {
141
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
142
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
143
- }
144
- const grpcStreamMethods: string[] = [];
145
- for (const method of grpcStreamMethods) {
146
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
147
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
148
- }
149
- };
150
- }
151
-
152
- export const AUTH_SERVICE_NAME = "AuthService";
package/gen/chat.ts DELETED
@@ -1,113 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v3.21.12
5
- // source: chat.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "chat.v1";
12
-
13
- export interface CreateChatRequest {
14
- participant: string;
15
- }
16
-
17
- export interface CreateChatResponse {
18
- id: string;
19
- users: User[];
20
- }
21
-
22
- export interface DeleteChatRequest {
23
- chatId: string;
24
- }
25
-
26
- export interface DeleteChatResponse {
27
- message: string;
28
- }
29
-
30
- export interface Message {
31
- message: string;
32
- senderId: string;
33
- id: string;
34
- createdAt: string;
35
- updatedAt: string;
36
- chatId: string;
37
- }
38
-
39
- export interface User {
40
- id: string;
41
- name: string;
42
- surname: string;
43
- avatar: string;
44
- }
45
-
46
- export interface Chat {
47
- id: string;
48
- users: User[];
49
- lastMessage: string;
50
- createdAt: string;
51
- updatedAt: string;
52
- }
53
-
54
- export interface GetMessagesRequest {
55
- chatId: string;
56
- }
57
-
58
- export interface GetMessagesResponse {
59
- messages: Message[];
60
- }
61
-
62
- export interface GetChatsRequest {
63
- userId: string;
64
- }
65
-
66
- export interface GetChatsResponse {
67
- chats: Chat[];
68
- }
69
-
70
- export const CHAT_V1_PACKAGE_NAME = "chat.v1";
71
-
72
- export interface ChatServiceClient {
73
- createChat(request: CreateChatRequest): Observable<CreateChatResponse>;
74
-
75
- deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
76
-
77
- getMessages(request: GetMessagesRequest): Observable<GetMessagesResponse>;
78
-
79
- getChats(request: GetChatsRequest): Observable<GetChatsResponse>;
80
- }
81
-
82
- export interface ChatServiceController {
83
- createChat(
84
- request: CreateChatRequest,
85
- ): Promise<CreateChatResponse> | Observable<CreateChatResponse> | CreateChatResponse;
86
-
87
- deleteChat(
88
- request: DeleteChatRequest,
89
- ): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
90
-
91
- getMessages(
92
- request: GetMessagesRequest,
93
- ): Promise<GetMessagesResponse> | Observable<GetMessagesResponse> | GetMessagesResponse;
94
-
95
- getChats(request: GetChatsRequest): Promise<GetChatsResponse> | Observable<GetChatsResponse> | GetChatsResponse;
96
- }
97
-
98
- export function ChatServiceControllerMethods() {
99
- return function (constructor: Function) {
100
- const grpcMethods: string[] = ["createChat", "deleteChat", "getMessages", "getChats"];
101
- for (const method of grpcMethods) {
102
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
103
- GrpcMethod("ChatService", method)(constructor.prototype[method], method, descriptor);
104
- }
105
- const grpcStreamMethods: string[] = [];
106
- for (const method of grpcStreamMethods) {
107
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
108
- GrpcStreamMethod("ChatService", method)(constructor.prototype[method], method, descriptor);
109
- }
110
- };
111
- }
112
-
113
- export const CHAT_SERVICE_NAME = "ChatService";
@@ -1,119 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v7.35.1
5
- // source: google/protobuf/timestamp.proto
6
-
7
- /* eslint-disable */
8
-
9
- export const protobufPackage = "google.protobuf";
10
-
11
- /**
12
- * A Timestamp represents a point in time independent of any time zone or local
13
- * calendar, encoded as a count of seconds and fractions of seconds at
14
- * nanosecond resolution. The count is relative to an epoch at UTC midnight on
15
- * January 1, 1970, in the proleptic Gregorian calendar which extends the
16
- * Gregorian calendar backwards to year one.
17
- *
18
- * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
19
- * second table is needed for interpretation, using a [24-hour linear
20
- * smear](https://developers.google.com/time/smear).
21
- *
22
- * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
23
- * restricting to that range, we ensure that we can convert to and from [RFC
24
- * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
25
- *
26
- * # Examples
27
- *
28
- * Example 1: Compute Timestamp from POSIX `time()`.
29
- *
30
- * Timestamp timestamp;
31
- * timestamp.set_seconds(time(NULL));
32
- * timestamp.set_nanos(0);
33
- *
34
- * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
35
- *
36
- * struct timeval tv;
37
- * gettimeofday(&tv, NULL);
38
- *
39
- * Timestamp timestamp;
40
- * timestamp.set_seconds(tv.tv_sec);
41
- * timestamp.set_nanos(tv.tv_usec * 1000);
42
- *
43
- * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
44
- *
45
- * FILETIME ft;
46
- * GetSystemTimeAsFileTime(&ft);
47
- * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
48
- *
49
- * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
50
- * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
51
- * Timestamp timestamp;
52
- * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
53
- * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
54
- *
55
- * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
56
- *
57
- * long millis = System.currentTimeMillis();
58
- *
59
- * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
60
- * .setNanos((int) ((millis % 1000) * 1000000)).build();
61
- *
62
- * Example 5: Compute Timestamp from Java `Instant.now()`.
63
- *
64
- * Instant now = Instant.now();
65
- *
66
- * Timestamp timestamp =
67
- * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
68
- * .setNanos(now.getNano()).build();
69
- *
70
- * Example 6: Compute Timestamp from current time in Python.
71
- *
72
- * timestamp = Timestamp()
73
- * timestamp.GetCurrentTime()
74
- *
75
- * # JSON Mapping
76
- *
77
- * In JSON format, the Timestamp type is encoded as a string in the
78
- * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
79
- * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
80
- * where {year} is always expressed using four digits while {month}, {day},
81
- * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
82
- * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
83
- * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
84
- * is required. A ProtoJSON serializer should always use UTC (as indicated by
85
- * "Z") when printing the Timestamp type and a ProtoJSON parser should be
86
- * able to accept both UTC and other timezones (as indicated by an offset).
87
- *
88
- * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
89
- * 01:30 UTC on January 15, 2017.
90
- *
91
- * In JavaScript, one can convert a Date object to this format using the
92
- * standard
93
- * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
94
- * method. In Python, a standard `datetime.datetime` object can be converted
95
- * to this format using
96
- * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
97
- * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
98
- * the Joda Time's [`ISODateTimeFormat.dateTime()`](
99
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
100
- * ) to obtain a formatter capable of generating timestamps in this format.
101
- */
102
- export interface Timestamp {
103
- /**
104
- * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
105
- * be between -62135596800 and 253402300799 inclusive (which corresponds to
106
- * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
107
- */
108
- seconds: number;
109
- /**
110
- * Non-negative fractions of a second at nanosecond resolution. This field is
111
- * the nanosecond portion of the duration, not an alternative to seconds.
112
- * Negative second values with fractions must still have non-negative nanos
113
- * values that count forward in time. Must be between 0 and 999,999,999
114
- * inclusive.
115
- */
116
- nanos: number;
117
- }
118
-
119
- export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
package/gen/payment.ts DELETED
@@ -1,138 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v3.21.12
5
- // source: payment.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
- import { Empty } from "./google/protobuf/empty";
11
-
12
- export const protobufPackage = "payment.v1";
13
-
14
- export interface Transaction {
15
- id: string;
16
- status: string;
17
- paymentProvider: string;
18
- createdAt: string;
19
- updatedAt: string;
20
- billingPeriod: string;
21
- amount: number;
22
- userId: string;
23
- planId: string;
24
- subscriptionId: string;
25
- }
26
-
27
- export interface GetHistoryResponse {
28
- transactions: Transaction[];
29
- }
30
-
31
- export interface InitTransactionRequest {
32
- planId: string;
33
- billingPeriod: string;
34
- provider: string;
35
- }
36
-
37
- export interface InitTransactionResponse {
38
- cancelUrl: string;
39
- successUrl: string;
40
- url: string;
41
- }
42
-
43
- export interface UpdateAutoRenewalStatusRequest {
44
- isAutoRenewal: boolean;
45
- }
46
-
47
- export interface UpdateAutoRenewalStatusResponse {
48
- isAutoRenewal: boolean;
49
- }
50
-
51
- export interface Plan {
52
- id: string;
53
- title: string;
54
- description: string;
55
- monthlyPrice: number;
56
- annualyPrice: number;
57
- }
58
-
59
- export interface GetPlansResponse {
60
- plans: Plan[];
61
- }
62
-
63
- export interface GetPlanByIdRequest {
64
- planId: string;
65
- }
66
-
67
- export interface GetPlanByIdResponse {
68
- plan: Plan | undefined;
69
- }
70
-
71
- export interface RefundRequest {
72
- }
73
-
74
- export interface RefundResponse {
75
- }
76
-
77
- export const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
78
-
79
- export interface PaymentServiceClient {
80
- getHistory(request: Empty): Observable<GetHistoryResponse>;
81
-
82
- initTransaction(request: InitTransactionRequest): Observable<InitTransactionResponse>;
83
-
84
- updateAutoRenewalStatus(request: UpdateAutoRenewalStatusRequest): Observable<UpdateAutoRenewalStatusResponse>;
85
-
86
- getPlans(request: Empty): Observable<GetPlansResponse>;
87
-
88
- getPlanById(request: GetPlanByIdRequest): Observable<GetPlanByIdResponse>;
89
-
90
- refund(request: RefundRequest): Observable<RefundResponse>;
91
- }
92
-
93
- export interface PaymentServiceController {
94
- getHistory(request: Empty): Promise<GetHistoryResponse> | Observable<GetHistoryResponse> | GetHistoryResponse;
95
-
96
- initTransaction(
97
- request: InitTransactionRequest,
98
- ): Promise<InitTransactionResponse> | Observable<InitTransactionResponse> | InitTransactionResponse;
99
-
100
- updateAutoRenewalStatus(
101
- request: UpdateAutoRenewalStatusRequest,
102
- ):
103
- | Promise<UpdateAutoRenewalStatusResponse>
104
- | Observable<UpdateAutoRenewalStatusResponse>
105
- | UpdateAutoRenewalStatusResponse;
106
-
107
- getPlans(request: Empty): Promise<GetPlansResponse> | Observable<GetPlansResponse> | GetPlansResponse;
108
-
109
- getPlanById(
110
- request: GetPlanByIdRequest,
111
- ): Promise<GetPlanByIdResponse> | Observable<GetPlanByIdResponse> | GetPlanByIdResponse;
112
-
113
- refund(request: RefundRequest): Promise<RefundResponse> | Observable<RefundResponse> | RefundResponse;
114
- }
115
-
116
- export function PaymentServiceControllerMethods() {
117
- return function (constructor: Function) {
118
- const grpcMethods: string[] = [
119
- "getHistory",
120
- "initTransaction",
121
- "updateAutoRenewalStatus",
122
- "getPlans",
123
- "getPlanById",
124
- "refund",
125
- ];
126
- for (const method of grpcMethods) {
127
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
128
- GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
129
- }
130
- const grpcStreamMethods: string[] = [];
131
- for (const method of grpcStreamMethods) {
132
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
133
- GrpcStreamMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
134
- }
135
- };
136
- }
137
-
138
- export const PAYMENT_SERVICE_NAME = "PaymentService";
package/gen/user.ts DELETED
@@ -1,66 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v3.21.12
5
- // source: user.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "user.v1";
12
-
13
- export enum Role {
14
- unspecified = 0,
15
- user = 1,
16
- participant = 2,
17
- creator = 3,
18
- admin = 4,
19
- UNRECOGNIZED = -1,
20
- }
21
-
22
- export interface GetUserByIdRequst {
23
- userId: string;
24
- }
25
-
26
- export interface GetUserByIdResponse {
27
- userId: string;
28
- name: string;
29
- surname: string;
30
- isOtpVerified: boolean;
31
- isEmailVerified: boolean;
32
- isPhoneVerified: boolean;
33
- isTwoFactorEnabled: boolean;
34
- phone: string;
35
- roles: Role[];
36
- email: string;
37
- }
38
-
39
- export const USER_V1_PACKAGE_NAME = "user.v1";
40
-
41
- export interface UserServiceClient {
42
- getUserById(request: GetUserByIdRequst): Observable<GetUserByIdResponse>;
43
- }
44
-
45
- export interface UserServiceController {
46
- getUserById(
47
- request: GetUserByIdRequst,
48
- ): Promise<GetUserByIdResponse> | Observable<GetUserByIdResponse> | GetUserByIdResponse;
49
- }
50
-
51
- export function UserServiceControllerMethods() {
52
- return function (constructor: Function) {
53
- const grpcMethods: string[] = ["getUserById"];
54
- for (const method of grpcMethods) {
55
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
56
- GrpcMethod("UserService", 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("UserService", method)(constructor.prototype[method], method, descriptor);
62
- }
63
- };
64
- }
65
-
66
- export const USER_SERVICE_NAME = "UserService";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes