@readytomog/contracts 1.5.4 → 1.5.6

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