@aepstore-dev/contracts 1.40.0 → 1.42.0

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 (43) hide show
  1. package/dist/gen/activity.d.ts +170 -0
  2. package/dist/gen/activity.js +62 -0
  3. package/dist/gen/auth.d.ts +220 -0
  4. package/dist/gen/auth.js +49 -0
  5. package/dist/gen/mail.d.ts +70 -0
  6. package/dist/gen/mail.js +34 -0
  7. package/dist/gen/payments.d.ts +603 -0
  8. package/dist/gen/payments.js +57 -0
  9. package/dist/gen/products.d.ts +401 -0
  10. package/dist/gen/products.js +80 -0
  11. package/dist/gen/support.d.ts +139 -0
  12. package/dist/gen/support.js +38 -0
  13. package/dist/gen/taxonomy.d.ts +109 -0
  14. package/dist/gen/taxonomy.js +36 -0
  15. package/dist/gen/upload.d.ts +193 -0
  16. package/dist/gen/upload.js +54 -0
  17. package/dist/gen/users.d.ts +639 -0
  18. package/dist/gen/users.js +84 -0
  19. package/package.json +44 -35
  20. package/proto/activity.proto +200 -200
  21. package/proto/auth.proto +189 -183
  22. package/proto/mail.proto +54 -54
  23. package/proto/payments.proto +407 -407
  24. package/proto/products.proto +402 -402
  25. package/proto/support.proto +118 -118
  26. package/proto/taxonomy.proto +105 -105
  27. package/proto/upload.proto +171 -171
  28. package/proto/users.proto +660 -660
  29. package/gen/activity.ts +0 -270
  30. package/gen/auth.ts +0 -309
  31. package/gen/mail.ts +0 -121
  32. package/gen/payments.ts +0 -828
  33. package/gen/products.ts +0 -579
  34. package/gen/support.ts +0 -220
  35. package/gen/taxonomy.ts +0 -185
  36. package/gen/upload.ts +0 -287
  37. package/gen/users.ts +0 -929
  38. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  39. /package/dist/{index.js → src/index.js} +0 -0
  40. /package/dist/{proto → src/proto}/index.d.ts +0 -0
  41. /package/dist/{proto → src/proto}/index.js +0 -0
  42. /package/dist/{proto → src/proto}/paths.d.ts +0 -0
  43. /package/dist/{proto → src/proto}/paths.js +0 -0
@@ -0,0 +1,170 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "activity.v1";
3
+ /**
4
+ * Member names match the DB enum string values exactly (enums: String on the
5
+ * wire), so DB values pass straight through with no mapping. UNSPECIFIED=0
6
+ * represents "no value / not provided" (e.g. an optional list filter).
7
+ */
8
+ export declare enum ReportType {
9
+ REPORT_TYPE_UNSPECIFIED = 0,
10
+ PRODUCT = 1,
11
+ PROFILE = 2,
12
+ REVIEW = 3,
13
+ UNRECOGNIZED = -1
14
+ }
15
+ export declare enum ReportStatus {
16
+ REPORT_STATUS_UNSPECIFIED = 0,
17
+ PENDING = 1,
18
+ IN_PROGRESS = 2,
19
+ RESOLVED = 3,
20
+ DISMISSED = 4,
21
+ UNRECOGNIZED = -1
22
+ }
23
+ export interface Report {
24
+ id: string;
25
+ type: ReportType;
26
+ objectId: string;
27
+ userId: string;
28
+ productId: string;
29
+ categories: ReportCategory[];
30
+ message: string;
31
+ status: ReportStatus;
32
+ createdAt: string;
33
+ updatedAt: string;
34
+ }
35
+ export interface ReportResponse {
36
+ report: Report | undefined;
37
+ }
38
+ export interface CreateReportRequest {
39
+ userId: string;
40
+ type: ReportType;
41
+ objectId: string;
42
+ /** names */
43
+ categories: string[];
44
+ message: string;
45
+ }
46
+ export interface ListReportsRequest {
47
+ type: ReportType;
48
+ status: ReportStatus;
49
+ userId: string;
50
+ objectId: string;
51
+ page: number;
52
+ limit: number;
53
+ }
54
+ export interface ReportsListResponse {
55
+ items: Report[];
56
+ total: number;
57
+ page: number;
58
+ limit: number;
59
+ }
60
+ export interface ReportIdRequest {
61
+ id: string;
62
+ }
63
+ export interface ModerateReportRequest {
64
+ id: string;
65
+ /** 'accept' | 'reject' */
66
+ action: string;
67
+ }
68
+ export interface ReportCategory {
69
+ id: string;
70
+ name: string;
71
+ type: ReportType;
72
+ icon: string;
73
+ description: string;
74
+ }
75
+ export interface ReportCategoryResponse {
76
+ category: ReportCategory | undefined;
77
+ }
78
+ export interface CreateReportCategoryRequest {
79
+ name: string;
80
+ type: ReportType;
81
+ icon: string;
82
+ description: string;
83
+ }
84
+ export interface UpdateReportCategoryRequest {
85
+ id: string;
86
+ name: string;
87
+ icon: string;
88
+ description: string;
89
+ }
90
+ export interface ListReportCategoriesRequest {
91
+ type: ReportType;
92
+ }
93
+ export interface ReportCategoriesListResponse {
94
+ items: ReportCategory[];
95
+ }
96
+ export interface ReportCategoryIdRequest {
97
+ id: string;
98
+ }
99
+ export interface ReviewUser {
100
+ id: string;
101
+ username: string;
102
+ avatarUrl: string;
103
+ }
104
+ export interface Review {
105
+ id: string;
106
+ rating: number;
107
+ text: string;
108
+ productId: string;
109
+ createdAt: string;
110
+ updatedAt: string;
111
+ user: ReviewUser | undefined;
112
+ }
113
+ export interface ReviewResponse {
114
+ review: Review | undefined;
115
+ }
116
+ export interface CreateReviewRequest {
117
+ userId: string;
118
+ productId: string;
119
+ rating: number;
120
+ text: string;
121
+ }
122
+ export interface GetProductReviewsRequest {
123
+ productId: string;
124
+ page: number;
125
+ limit: number;
126
+ }
127
+ export interface ReviewsListResponse {
128
+ items: Review[];
129
+ total: number;
130
+ page: number;
131
+ limit: number;
132
+ }
133
+ export interface Ok {
134
+ ok: boolean;
135
+ }
136
+ export declare const ACTIVITY_V1_PACKAGE_NAME = "activity.v1";
137
+ export interface ActivityServiceClient {
138
+ /** Reports */
139
+ reportCreate(request: CreateReportRequest): Observable<ReportResponse>;
140
+ reportList(request: ListReportsRequest): Observable<ReportsListResponse>;
141
+ reportGet(request: ReportIdRequest): Observable<ReportResponse>;
142
+ reportModerate(request: ModerateReportRequest): Observable<ReportResponse>;
143
+ /** Report categories */
144
+ reportCategoryCreate(request: CreateReportCategoryRequest): Observable<ReportCategoryResponse>;
145
+ reportCategoryList(request: ListReportCategoriesRequest): Observable<ReportCategoriesListResponse>;
146
+ reportCategoryGet(request: ReportCategoryIdRequest): Observable<ReportCategoryResponse>;
147
+ reportCategoryUpdate(request: UpdateReportCategoryRequest): Observable<ReportCategoryResponse>;
148
+ reportCategoryDelete(request: ReportCategoryIdRequest): Observable<Ok>;
149
+ /** Reviews */
150
+ reviewCreate(request: CreateReviewRequest): Observable<ReviewResponse>;
151
+ getProductReviews(request: GetProductReviewsRequest): Observable<ReviewsListResponse>;
152
+ }
153
+ export interface ActivityServiceController {
154
+ /** Reports */
155
+ reportCreate(request: CreateReportRequest): Promise<ReportResponse> | Observable<ReportResponse> | ReportResponse;
156
+ reportList(request: ListReportsRequest): Promise<ReportsListResponse> | Observable<ReportsListResponse> | ReportsListResponse;
157
+ reportGet(request: ReportIdRequest): Promise<ReportResponse> | Observable<ReportResponse> | ReportResponse;
158
+ reportModerate(request: ModerateReportRequest): Promise<ReportResponse> | Observable<ReportResponse> | ReportResponse;
159
+ /** Report categories */
160
+ reportCategoryCreate(request: CreateReportCategoryRequest): Promise<ReportCategoryResponse> | Observable<ReportCategoryResponse> | ReportCategoryResponse;
161
+ reportCategoryList(request: ListReportCategoriesRequest): Promise<ReportCategoriesListResponse> | Observable<ReportCategoriesListResponse> | ReportCategoriesListResponse;
162
+ reportCategoryGet(request: ReportCategoryIdRequest): Promise<ReportCategoryResponse> | Observable<ReportCategoryResponse> | ReportCategoryResponse;
163
+ reportCategoryUpdate(request: UpdateReportCategoryRequest): Promise<ReportCategoryResponse> | Observable<ReportCategoryResponse> | ReportCategoryResponse;
164
+ reportCategoryDelete(request: ReportCategoryIdRequest): Promise<Ok> | Observable<Ok> | Ok;
165
+ /** Reviews */
166
+ reviewCreate(request: CreateReviewRequest): Promise<ReviewResponse> | Observable<ReviewResponse> | ReviewResponse;
167
+ getProductReviews(request: GetProductReviewsRequest): Promise<ReviewsListResponse> | Observable<ReviewsListResponse> | ReviewsListResponse;
168
+ }
169
+ export declare function ActivityServiceControllerMethods(): (constructor: Function) => void;
170
+ export declare const ACTIVITY_SERVICE_NAME = "ActivityService";
@@ -0,0 +1,62 @@
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 v7.35.0
6
+ // source: activity.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ACTIVITY_SERVICE_NAME = exports.ACTIVITY_V1_PACKAGE_NAME = exports.ReportStatus = exports.ReportType = exports.protobufPackage = void 0;
9
+ exports.ActivityServiceControllerMethods = ActivityServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "activity.v1";
13
+ /**
14
+ * Member names match the DB enum string values exactly (enums: String on the
15
+ * wire), so DB values pass straight through with no mapping. UNSPECIFIED=0
16
+ * represents "no value / not provided" (e.g. an optional list filter).
17
+ */
18
+ var ReportType;
19
+ (function (ReportType) {
20
+ ReportType[ReportType["REPORT_TYPE_UNSPECIFIED"] = 0] = "REPORT_TYPE_UNSPECIFIED";
21
+ ReportType[ReportType["PRODUCT"] = 1] = "PRODUCT";
22
+ ReportType[ReportType["PROFILE"] = 2] = "PROFILE";
23
+ ReportType[ReportType["REVIEW"] = 3] = "REVIEW";
24
+ ReportType[ReportType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
25
+ })(ReportType || (exports.ReportType = ReportType = {}));
26
+ var ReportStatus;
27
+ (function (ReportStatus) {
28
+ ReportStatus[ReportStatus["REPORT_STATUS_UNSPECIFIED"] = 0] = "REPORT_STATUS_UNSPECIFIED";
29
+ ReportStatus[ReportStatus["PENDING"] = 1] = "PENDING";
30
+ ReportStatus[ReportStatus["IN_PROGRESS"] = 2] = "IN_PROGRESS";
31
+ ReportStatus[ReportStatus["RESOLVED"] = 3] = "RESOLVED";
32
+ ReportStatus[ReportStatus["DISMISSED"] = 4] = "DISMISSED";
33
+ ReportStatus[ReportStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
34
+ })(ReportStatus || (exports.ReportStatus = ReportStatus = {}));
35
+ exports.ACTIVITY_V1_PACKAGE_NAME = "activity.v1";
36
+ function ActivityServiceControllerMethods() {
37
+ return function (constructor) {
38
+ const grpcMethods = [
39
+ "reportCreate",
40
+ "reportList",
41
+ "reportGet",
42
+ "reportModerate",
43
+ "reportCategoryCreate",
44
+ "reportCategoryList",
45
+ "reportCategoryGet",
46
+ "reportCategoryUpdate",
47
+ "reportCategoryDelete",
48
+ "reviewCreate",
49
+ "getProductReviews",
50
+ ];
51
+ for (const method of grpcMethods) {
52
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
53
+ (0, microservices_1.GrpcMethod)("ActivityService", method)(constructor.prototype[method], method, descriptor);
54
+ }
55
+ const grpcStreamMethods = [];
56
+ for (const method of grpcStreamMethods) {
57
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
58
+ (0, microservices_1.GrpcStreamMethod)("ActivityService", method)(constructor.prototype[method], method, descriptor);
59
+ }
60
+ };
61
+ }
62
+ exports.ACTIVITY_SERVICE_NAME = "ActivityService";
@@ -0,0 +1,220 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "auth.v1";
3
+ export declare enum TwoFactorType {
4
+ NONE = 0,
5
+ APP = 1,
6
+ EMAIL = 2,
7
+ UNRECOGNIZED = -1
8
+ }
9
+ /** Login by username OR email (one of the two must be set). */
10
+ export interface LoginRequest {
11
+ password: string;
12
+ /** username OR email — resolved by the service */
13
+ credentials: string;
14
+ /**
15
+ * Gateway-supplied audit context. LoginEvent rows for LOGIN /
16
+ * PASSWORD_FAIL get the same ip/user-agent that REFRESH and RESTORE
17
+ * already carry; the gRPC layer has no transport-level access to
18
+ * either, so the gateway extracts them from the HTTP request.
19
+ */
20
+ userAgent: string;
21
+ ip: string;
22
+ }
23
+ export interface RegisterRequest {
24
+ email: string;
25
+ username: string;
26
+ password: string;
27
+ /** optional, attached by gateway from req */
28
+ ip: string;
29
+ }
30
+ /** type ∈ { twofa, reset, totp_generate, totp_activate, confirm } (legacy strings) */
31
+ export interface CreateCodeRequest {
32
+ email: string;
33
+ type: string;
34
+ }
35
+ /**
36
+ * type ∈ { twofa, twofa_deactivate, reset, totp, totp_deactivate, backup, confirm }
37
+ * new_password is only used by the 'reset' flow.
38
+ */
39
+ export interface VerifyCodeRequest {
40
+ email: string;
41
+ code: string;
42
+ type: string;
43
+ /** optional */
44
+ newPassword: string;
45
+ }
46
+ export interface CheckTokenRequest {
47
+ token: string;
48
+ }
49
+ export interface RefreshTokenRequest {
50
+ refreshToken: string;
51
+ /** optional */
52
+ userAgent: string;
53
+ /** optional */
54
+ ip: string;
55
+ }
56
+ export interface Get2faStatusRequest {
57
+ username: string;
58
+ }
59
+ export interface GetProfileRequest {
60
+ userId: string;
61
+ }
62
+ export interface AuthUser {
63
+ id: string;
64
+ username: string;
65
+ email: string;
66
+ avatarUrl: string;
67
+ bannerUrl: string;
68
+ roles: string[];
69
+ /** primary role (roles[0]) */
70
+ role: string;
71
+ isVerified: boolean;
72
+ twoFactorType: TwoFactorType;
73
+ twoFactorEnabled: boolean;
74
+ /** Decimal as string (D7) */
75
+ balance: string;
76
+ }
77
+ /**
78
+ * Unified result for login/register/createCode/verifyCode/refresh. Which fields
79
+ * are populated depends on the flow:
80
+ * - fully authenticated → access_token + refresh_token + expires_in + user
81
+ * - 2FA required / pending confirm → message + requires_2fa + two_factor_type + user (no tokens)
82
+ * - totp_generate → secret + otpauth + qr (+ user)
83
+ * - totp_activate → backup_codes (+ tokens/user)
84
+ */
85
+ export interface AuthResult {
86
+ accessToken: string;
87
+ refreshToken: string;
88
+ expiresIn: number;
89
+ user: AuthUser | undefined;
90
+ message: string;
91
+ requires2fa: boolean;
92
+ twoFactorType: TwoFactorType;
93
+ /** TOTP setup extras */
94
+ secret: string;
95
+ otpauth: string;
96
+ /** data URL (PNG) */
97
+ qr: string;
98
+ backupCodes: string[];
99
+ }
100
+ export interface TwoFactorStatusResponse {
101
+ twoFactorType: TwoFactorType;
102
+ has2fa: boolean;
103
+ isVerified: boolean;
104
+ }
105
+ export interface Empty {
106
+ }
107
+ export interface LogoutCurrentRequest {
108
+ refreshToken: string;
109
+ }
110
+ export interface LogoutAllRequest {
111
+ userId: string;
112
+ }
113
+ export interface LogoutResponse {
114
+ ok: boolean;
115
+ /** number of refresh-token rows deleted */
116
+ removed: number;
117
+ }
118
+ export interface RestoreLoginRequest {
119
+ /** email or username */
120
+ credentials: string;
121
+ password: string;
122
+ userAgent: string;
123
+ ip: string;
124
+ }
125
+ export interface ListLoginHistoryRequest {
126
+ userId: string;
127
+ page: number;
128
+ limit: number;
129
+ }
130
+ export interface LoginEventRow {
131
+ id: string;
132
+ /** LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE */
133
+ type: string;
134
+ success: boolean;
135
+ reason: string;
136
+ ip: string;
137
+ userAgent: string;
138
+ createdAt: string;
139
+ }
140
+ export interface ListLoginHistoryResponse {
141
+ items: LoginEventRow[];
142
+ total: number;
143
+ page: number;
144
+ limit: number;
145
+ }
146
+ export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
147
+ /**
148
+ * Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
149
+ * Tokens are HMAC primitives from @aepstore-dev/passport:
150
+ * - access token: short TTL, carries userId; the gateway validates it
151
+ * locally via PassportAuthGuard (no round-trip here).
152
+ * - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
153
+ * revocation). Refresh verifies the HMAC AND that the row still exists.
154
+ */
155
+ export interface AuthServiceClient {
156
+ login(request: LoginRequest): Observable<AuthResult>;
157
+ register(request: RegisterRequest): Observable<AuthResult>;
158
+ createCode(request: CreateCodeRequest): Observable<AuthResult>;
159
+ verifyCode(request: VerifyCodeRequest): Observable<AuthResult>;
160
+ checkToken(request: CheckTokenRequest): Observable<AuthUser>;
161
+ refreshToken(request: RefreshTokenRequest): Observable<AuthResult>;
162
+ get2FaStatus(request: Get2faStatusRequest): Observable<TwoFactorStatusResponse>;
163
+ getProfile(request: GetProfileRequest): Observable<AuthUser>;
164
+ cleanupExpiredTotpSetups(request: Empty): Observable<Empty>;
165
+ /**
166
+ * Logout — kill refresh tokens. LogoutCurrent kills only the one whose
167
+ * HMAC matches; LogoutAll wipes every row for the user.
168
+ */
169
+ logoutCurrent(request: LogoutCurrentRequest): Observable<LogoutResponse>;
170
+ logoutAll(request: LogoutAllRequest): Observable<LogoutResponse>;
171
+ /**
172
+ * Self-service restore. Verifies credentials + password against a
173
+ * soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
174
+ * fresh tokens — the one auth path that DOES read deletedAt accounts.
175
+ */
176
+ restoreLogin(request: RestoreLoginRequest): Observable<AuthResult>;
177
+ /**
178
+ * Login history. Read-only audit feed for the settings page; rows come
179
+ * from LoginEvent. Internal alternative: tasks-service GC.
180
+ */
181
+ listLoginHistory(request: ListLoginHistoryRequest): Observable<ListLoginHistoryResponse>;
182
+ }
183
+ /**
184
+ * Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
185
+ * Tokens are HMAC primitives from @aepstore-dev/passport:
186
+ * - access token: short TTL, carries userId; the gateway validates it
187
+ * locally via PassportAuthGuard (no round-trip here).
188
+ * - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
189
+ * revocation). Refresh verifies the HMAC AND that the row still exists.
190
+ */
191
+ export interface AuthServiceController {
192
+ login(request: LoginRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
193
+ register(request: RegisterRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
194
+ createCode(request: CreateCodeRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
195
+ verifyCode(request: VerifyCodeRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
196
+ checkToken(request: CheckTokenRequest): Promise<AuthUser> | Observable<AuthUser> | AuthUser;
197
+ refreshToken(request: RefreshTokenRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
198
+ get2FaStatus(request: Get2faStatusRequest): Promise<TwoFactorStatusResponse> | Observable<TwoFactorStatusResponse> | TwoFactorStatusResponse;
199
+ getProfile(request: GetProfileRequest): Promise<AuthUser> | Observable<AuthUser> | AuthUser;
200
+ cleanupExpiredTotpSetups(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
201
+ /**
202
+ * Logout — kill refresh tokens. LogoutCurrent kills only the one whose
203
+ * HMAC matches; LogoutAll wipes every row for the user.
204
+ */
205
+ logoutCurrent(request: LogoutCurrentRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
206
+ logoutAll(request: LogoutAllRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
207
+ /**
208
+ * Self-service restore. Verifies credentials + password against a
209
+ * soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
210
+ * fresh tokens — the one auth path that DOES read deletedAt accounts.
211
+ */
212
+ restoreLogin(request: RestoreLoginRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
213
+ /**
214
+ * Login history. Read-only audit feed for the settings page; rows come
215
+ * from LoginEvent. Internal alternative: tasks-service GC.
216
+ */
217
+ listLoginHistory(request: ListLoginHistoryRequest): Promise<ListLoginHistoryResponse> | Observable<ListLoginHistoryResponse> | ListLoginHistoryResponse;
218
+ }
219
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
220
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,49 @@
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 v7.35.0
6
+ // source: auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.TwoFactorType = exports.protobufPackage = void 0;
9
+ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "auth.v1";
13
+ var TwoFactorType;
14
+ (function (TwoFactorType) {
15
+ TwoFactorType[TwoFactorType["NONE"] = 0] = "NONE";
16
+ TwoFactorType[TwoFactorType["APP"] = 1] = "APP";
17
+ TwoFactorType[TwoFactorType["EMAIL"] = 2] = "EMAIL";
18
+ TwoFactorType[TwoFactorType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
19
+ })(TwoFactorType || (exports.TwoFactorType = TwoFactorType = {}));
20
+ exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
21
+ function AuthServiceControllerMethods() {
22
+ return function (constructor) {
23
+ const grpcMethods = [
24
+ "login",
25
+ "register",
26
+ "createCode",
27
+ "verifyCode",
28
+ "checkToken",
29
+ "refreshToken",
30
+ "get2FaStatus",
31
+ "getProfile",
32
+ "cleanupExpiredTotpSetups",
33
+ "logoutCurrent",
34
+ "logoutAll",
35
+ "restoreLogin",
36
+ "listLoginHistory",
37
+ ];
38
+ for (const method of grpcMethods) {
39
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
40
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
41
+ }
42
+ const grpcStreamMethods = [];
43
+ for (const method of grpcStreamMethods) {
44
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
45
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
46
+ }
47
+ };
48
+ }
49
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,70 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "mail.v1";
3
+ export interface MailAck {
4
+ queued: boolean;
5
+ }
6
+ export interface SendRegRequest {
7
+ userId: string;
8
+ email: string;
9
+ username: string;
10
+ fullName: string;
11
+ }
12
+ export interface Send2faRequest {
13
+ email: string;
14
+ code: string;
15
+ username: string;
16
+ }
17
+ export interface SendPasswordResetRequest {
18
+ email: string;
19
+ code: string;
20
+ username: string;
21
+ }
22
+ export interface SendRegistrationConfirmRequest {
23
+ email: string;
24
+ code: string;
25
+ username: string;
26
+ }
27
+ export interface SendDataExportReadyRequest {
28
+ email: string;
29
+ username: string;
30
+ /** signed S3 URL */
31
+ fileUrl: string;
32
+ /** for the message body */
33
+ urlTtlHours: number;
34
+ fileSize: number;
35
+ }
36
+ export declare const MAIL_V1_PACKAGE_NAME = "mail.v1";
37
+ /**
38
+ * Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
39
+ * stack each becomes a unary RPC that returns an Ack. Callers ignore the
40
+ * response if they don't care about delivery.
41
+ */
42
+ export interface MailServiceClient {
43
+ sendReg(request: SendRegRequest): Observable<MailAck>;
44
+ send2Fa(request: Send2faRequest): Observable<MailAck>;
45
+ sendPasswordReset(request: SendPasswordResetRequest): Observable<MailAck>;
46
+ sendRegistrationConfirm(request: SendRegistrationConfirmRequest): Observable<MailAck>;
47
+ /**
48
+ * GDPR data-export delivery — tasks-service fires after the JSON dump
49
+ * lands in S3; mail-service sends the signed URL with a sensible TTL note.
50
+ */
51
+ sendDataExportReady(request: SendDataExportReadyRequest): Observable<MailAck>;
52
+ }
53
+ /**
54
+ * Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
55
+ * stack each becomes a unary RPC that returns an Ack. Callers ignore the
56
+ * response if they don't care about delivery.
57
+ */
58
+ export interface MailServiceController {
59
+ sendReg(request: SendRegRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
60
+ send2Fa(request: Send2faRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
61
+ sendPasswordReset(request: SendPasswordResetRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
62
+ sendRegistrationConfirm(request: SendRegistrationConfirmRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
63
+ /**
64
+ * GDPR data-export delivery — tasks-service fires after the JSON dump
65
+ * lands in S3; mail-service sends the signed URL with a sensible TTL note.
66
+ */
67
+ sendDataExportReady(request: SendDataExportReadyRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
68
+ }
69
+ export declare function MailServiceControllerMethods(): (constructor: Function) => void;
70
+ export declare const MAIL_SERVICE_NAME = "MailService";
@@ -0,0 +1,34 @@
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 v7.35.0
6
+ // source: mail.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.MAIL_SERVICE_NAME = exports.MAIL_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.MailServiceControllerMethods = MailServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "mail.v1";
13
+ exports.MAIL_V1_PACKAGE_NAME = "mail.v1";
14
+ function MailServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "sendReg",
18
+ "send2Fa",
19
+ "sendPasswordReset",
20
+ "sendRegistrationConfirm",
21
+ "sendDataExportReady",
22
+ ];
23
+ for (const method of grpcMethods) {
24
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
25
+ (0, microservices_1.GrpcMethod)("MailService", method)(constructor.prototype[method], method, descriptor);
26
+ }
27
+ const grpcStreamMethods = [];
28
+ for (const method of grpcStreamMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcStreamMethod)("MailService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ };
33
+ }
34
+ exports.MAIL_SERVICE_NAME = "MailService";