@aepstore-dev/contracts 1.41.0 → 1.42.1

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.
package/gen/auth.ts DELETED
@@ -1,317 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.10.1
4
- // protoc v7.35.0
5
- // source: auth.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "auth.v1";
12
-
13
- export enum TwoFactorType {
14
- NONE = 0,
15
- APP = 1,
16
- EMAIL = 2,
17
- UNRECOGNIZED = -1,
18
- }
19
-
20
- /** Login by username OR email (one of the two must be set). */
21
- export interface LoginRequest {
22
- password: string;
23
- /** username OR email — resolved by the service */
24
- credentials: string;
25
- /**
26
- * Gateway-supplied audit context. LoginEvent rows for LOGIN /
27
- * PASSWORD_FAIL get the same ip/user-agent that REFRESH and RESTORE
28
- * already carry; the gRPC layer has no transport-level access to
29
- * either, so the gateway extracts them from the HTTP request.
30
- */
31
- userAgent: string;
32
- ip: string;
33
- }
34
-
35
- export interface RegisterRequest {
36
- email: string;
37
- username: string;
38
- password: string;
39
- /** optional, attached by gateway from req */
40
- ip: string;
41
- }
42
-
43
- /** type ∈ { twofa, reset, totp_generate, totp_activate, confirm } (legacy strings) */
44
- export interface CreateCodeRequest {
45
- email: string;
46
- type: string;
47
- }
48
-
49
- /**
50
- * type ∈ { twofa, twofa_deactivate, reset, totp, totp_deactivate, backup, confirm }
51
- * new_password is only used by the 'reset' flow.
52
- */
53
- export interface VerifyCodeRequest {
54
- email: string;
55
- code: string;
56
- type: string;
57
- /** optional */
58
- newPassword: string;
59
- }
60
-
61
- export interface CheckTokenRequest {
62
- token: string;
63
- }
64
-
65
- export interface RefreshTokenRequest {
66
- refreshToken: string;
67
- /** optional */
68
- userAgent: string;
69
- /** optional */
70
- ip: string;
71
- }
72
-
73
- export interface Get2faStatusRequest {
74
- username: string;
75
- }
76
-
77
- export interface GetProfileRequest {
78
- userId: string;
79
- }
80
-
81
- export interface AuthUser {
82
- id: string;
83
- username: string;
84
- email: string;
85
- avatarUrl: string;
86
- bannerUrl: string;
87
- roles: string[];
88
- /** primary role (roles[0]) */
89
- role: string;
90
- isVerified: boolean;
91
- twoFactorType: TwoFactorType;
92
- twoFactorEnabled: boolean;
93
- /** Decimal as string (D7) */
94
- balance: string;
95
- }
96
-
97
- /**
98
- * Unified result for login/register/createCode/verifyCode/refresh. Which fields
99
- * are populated depends on the flow:
100
- * - fully authenticated → access_token + refresh_token + expires_in + user
101
- * - 2FA required / pending confirm → message + requires_2fa + two_factor_type + user (no tokens)
102
- * - totp_generate → secret + otpauth + qr (+ user)
103
- * - totp_activate → backup_codes (+ tokens/user)
104
- */
105
- export interface AuthResult {
106
- accessToken: string;
107
- refreshToken: string;
108
- expiresIn: number;
109
- user: AuthUser | undefined;
110
- message: string;
111
- requires2fa: boolean;
112
- twoFactorType: TwoFactorType;
113
- /** TOTP setup extras */
114
- secret: string;
115
- otpauth: string;
116
- /** data URL (PNG) */
117
- qr: string;
118
- backupCodes: string[];
119
- }
120
-
121
- export interface TwoFactorStatusResponse {
122
- twoFactorType: TwoFactorType;
123
- has2fa: boolean;
124
- isVerified: boolean;
125
- }
126
-
127
- export interface Empty {
128
- }
129
-
130
- export interface LogoutCurrentRequest {
131
- refreshToken: string;
132
- }
133
-
134
- export interface LogoutAllRequest {
135
- userId: string;
136
- }
137
-
138
- export interface LogoutResponse {
139
- ok: boolean;
140
- /** number of refresh-token rows deleted */
141
- removed: number;
142
- }
143
-
144
- export interface RestoreLoginRequest {
145
- /** email or username */
146
- credentials: string;
147
- password: string;
148
- userAgent: string;
149
- ip: string;
150
- }
151
-
152
- export interface ListLoginHistoryRequest {
153
- userId: string;
154
- page: number;
155
- limit: number;
156
- }
157
-
158
- export interface LoginEventRow {
159
- id: string;
160
- /** LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE */
161
- type: string;
162
- success: boolean;
163
- reason: string;
164
- ip: string;
165
- userAgent: string;
166
- createdAt: string;
167
- }
168
-
169
- export interface ListLoginHistoryResponse {
170
- items: LoginEventRow[];
171
- total: number;
172
- page: number;
173
- limit: number;
174
- }
175
-
176
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
177
-
178
- /**
179
- * Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
180
- * Tokens are HMAC primitives from @aepstore-dev/passport:
181
- * - access token: short TTL, carries userId; the gateway validates it
182
- * locally via PassportAuthGuard (no round-trip here).
183
- * - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
184
- * revocation). Refresh verifies the HMAC AND that the row still exists.
185
- */
186
-
187
- export interface AuthServiceClient {
188
- login(request: LoginRequest): Observable<AuthResult>;
189
-
190
- register(request: RegisterRequest): Observable<AuthResult>;
191
-
192
- createCode(request: CreateCodeRequest): Observable<AuthResult>;
193
-
194
- verifyCode(request: VerifyCodeRequest): Observable<AuthResult>;
195
-
196
- checkToken(request: CheckTokenRequest): Observable<AuthUser>;
197
-
198
- refreshToken(request: RefreshTokenRequest): Observable<AuthResult>;
199
-
200
- get2FaStatus(request: Get2faStatusRequest): Observable<TwoFactorStatusResponse>;
201
-
202
- getProfile(request: GetProfileRequest): Observable<AuthUser>;
203
-
204
- cleanupExpiredTotpSetups(request: Empty): Observable<Empty>;
205
-
206
- /**
207
- * Logout — kill refresh tokens. LogoutCurrent kills only the one whose
208
- * HMAC matches; LogoutAll wipes every row for the user.
209
- */
210
-
211
- logoutCurrent(request: LogoutCurrentRequest): Observable<LogoutResponse>;
212
-
213
- logoutAll(request: LogoutAllRequest): Observable<LogoutResponse>;
214
-
215
- /**
216
- * Self-service restore. Verifies credentials + password against a
217
- * soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
218
- * fresh tokens — the one auth path that DOES read deletedAt accounts.
219
- */
220
-
221
- restoreLogin(request: RestoreLoginRequest): Observable<AuthResult>;
222
-
223
- /**
224
- * Login history. Read-only audit feed for the settings page; rows come
225
- * from LoginEvent. Internal alternative: tasks-service GC.
226
- */
227
-
228
- listLoginHistory(request: ListLoginHistoryRequest): Observable<ListLoginHistoryResponse>;
229
- }
230
-
231
- /**
232
- * Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
233
- * Tokens are HMAC primitives from @aepstore-dev/passport:
234
- * - access token: short TTL, carries userId; the gateway validates it
235
- * locally via PassportAuthGuard (no round-trip here).
236
- * - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
237
- * revocation). Refresh verifies the HMAC AND that the row still exists.
238
- */
239
-
240
- export interface AuthServiceController {
241
- login(request: LoginRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
242
-
243
- register(request: RegisterRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
244
-
245
- createCode(request: CreateCodeRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
246
-
247
- verifyCode(request: VerifyCodeRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
248
-
249
- checkToken(request: CheckTokenRequest): Promise<AuthUser> | Observable<AuthUser> | AuthUser;
250
-
251
- refreshToken(request: RefreshTokenRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
252
-
253
- get2FaStatus(
254
- request: Get2faStatusRequest,
255
- ): Promise<TwoFactorStatusResponse> | Observable<TwoFactorStatusResponse> | TwoFactorStatusResponse;
256
-
257
- getProfile(request: GetProfileRequest): Promise<AuthUser> | Observable<AuthUser> | AuthUser;
258
-
259
- cleanupExpiredTotpSetups(request: Empty): Promise<Empty> | Observable<Empty> | Empty;
260
-
261
- /**
262
- * Logout — kill refresh tokens. LogoutCurrent kills only the one whose
263
- * HMAC matches; LogoutAll wipes every row for the user.
264
- */
265
-
266
- logoutCurrent(request: LogoutCurrentRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
267
-
268
- logoutAll(request: LogoutAllRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
269
-
270
- /**
271
- * Self-service restore. Verifies credentials + password against a
272
- * soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
273
- * fresh tokens — the one auth path that DOES read deletedAt accounts.
274
- */
275
-
276
- restoreLogin(request: RestoreLoginRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
277
-
278
- /**
279
- * Login history. Read-only audit feed for the settings page; rows come
280
- * from LoginEvent. Internal alternative: tasks-service GC.
281
- */
282
-
283
- listLoginHistory(
284
- request: ListLoginHistoryRequest,
285
- ): Promise<ListLoginHistoryResponse> | Observable<ListLoginHistoryResponse> | ListLoginHistoryResponse;
286
- }
287
-
288
- export function AuthServiceControllerMethods() {
289
- return function (constructor: Function) {
290
- const grpcMethods: string[] = [
291
- "login",
292
- "register",
293
- "createCode",
294
- "verifyCode",
295
- "checkToken",
296
- "refreshToken",
297
- "get2FaStatus",
298
- "getProfile",
299
- "cleanupExpiredTotpSetups",
300
- "logoutCurrent",
301
- "logoutAll",
302
- "restoreLogin",
303
- "listLoginHistory",
304
- ];
305
- for (const method of grpcMethods) {
306
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
307
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
308
- }
309
- const grpcStreamMethods: string[] = [];
310
- for (const method of grpcStreamMethods) {
311
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
312
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
313
- }
314
- };
315
- }
316
-
317
- export const AUTH_SERVICE_NAME = "AuthService";
package/gen/mail.ts DELETED
@@ -1,121 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.10.1
4
- // protoc v7.35.0
5
- // source: mail.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "mail.v1";
12
-
13
- export interface MailAck {
14
- queued: boolean;
15
- }
16
-
17
- export interface SendRegRequest {
18
- userId: string;
19
- email: string;
20
- username: string;
21
- fullName: string;
22
- }
23
-
24
- export interface Send2faRequest {
25
- email: string;
26
- code: string;
27
- username: string;
28
- }
29
-
30
- export interface SendPasswordResetRequest {
31
- email: string;
32
- code: string;
33
- username: string;
34
- }
35
-
36
- export interface SendRegistrationConfirmRequest {
37
- email: string;
38
- code: string;
39
- username: string;
40
- }
41
-
42
- export interface SendDataExportReadyRequest {
43
- email: string;
44
- username: string;
45
- /** signed S3 URL */
46
- fileUrl: string;
47
- /** for the message body */
48
- urlTtlHours: number;
49
- fileSize: number;
50
- }
51
-
52
- export const MAIL_V1_PACKAGE_NAME = "mail.v1";
53
-
54
- /**
55
- * Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
56
- * stack each becomes a unary RPC that returns an Ack. Callers ignore the
57
- * response if they don't care about delivery.
58
- */
59
-
60
- export interface MailServiceClient {
61
- sendReg(request: SendRegRequest): Observable<MailAck>;
62
-
63
- send2Fa(request: Send2faRequest): Observable<MailAck>;
64
-
65
- sendPasswordReset(request: SendPasswordResetRequest): Observable<MailAck>;
66
-
67
- sendRegistrationConfirm(request: SendRegistrationConfirmRequest): Observable<MailAck>;
68
-
69
- /**
70
- * GDPR data-export delivery — tasks-service fires after the JSON dump
71
- * lands in S3; mail-service sends the signed URL with a sensible TTL note.
72
- */
73
-
74
- sendDataExportReady(request: SendDataExportReadyRequest): Observable<MailAck>;
75
- }
76
-
77
- /**
78
- * Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
79
- * stack each becomes a unary RPC that returns an Ack. Callers ignore the
80
- * response if they don't care about delivery.
81
- */
82
-
83
- export interface MailServiceController {
84
- sendReg(request: SendRegRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
85
-
86
- send2Fa(request: Send2faRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
87
-
88
- sendPasswordReset(request: SendPasswordResetRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
89
-
90
- sendRegistrationConfirm(request: SendRegistrationConfirmRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
91
-
92
- /**
93
- * GDPR data-export delivery — tasks-service fires after the JSON dump
94
- * lands in S3; mail-service sends the signed URL with a sensible TTL note.
95
- */
96
-
97
- sendDataExportReady(request: SendDataExportReadyRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
98
- }
99
-
100
- export function MailServiceControllerMethods() {
101
- return function (constructor: Function) {
102
- const grpcMethods: string[] = [
103
- "sendReg",
104
- "send2Fa",
105
- "sendPasswordReset",
106
- "sendRegistrationConfirm",
107
- "sendDataExportReady",
108
- ];
109
- for (const method of grpcMethods) {
110
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
111
- GrpcMethod("MailService", method)(constructor.prototype[method], method, descriptor);
112
- }
113
- const grpcStreamMethods: string[] = [];
114
- for (const method of grpcStreamMethods) {
115
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
116
- GrpcStreamMethod("MailService", method)(constructor.prototype[method], method, descriptor);
117
- }
118
- };
119
- }
120
-
121
- export const MAIL_SERVICE_NAME = "MailService";