@aepstore-dev/contracts 1.34.0 → 1.35.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.
- package/gen/auth.ts +66 -0
- package/gen/mail.ts +31 -1
- package/package.json +1 -1
- package/proto/auth.proto +39 -0
- package/proto/mail.proto +12 -0
package/gen/auth.ts
CHANGED
|
@@ -133,6 +133,38 @@ export interface LogoutResponse {
|
|
|
133
133
|
removed: number;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
export interface RestoreLoginRequest {
|
|
137
|
+
/** email or username */
|
|
138
|
+
credentials: string;
|
|
139
|
+
password: string;
|
|
140
|
+
userAgent: string;
|
|
141
|
+
ip: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface ListLoginHistoryRequest {
|
|
145
|
+
userId: string;
|
|
146
|
+
page: number;
|
|
147
|
+
limit: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface LoginEventRow {
|
|
151
|
+
id: string;
|
|
152
|
+
/** LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE */
|
|
153
|
+
type: string;
|
|
154
|
+
success: boolean;
|
|
155
|
+
reason: string;
|
|
156
|
+
ip: string;
|
|
157
|
+
userAgent: string;
|
|
158
|
+
createdAt: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface ListLoginHistoryResponse {
|
|
162
|
+
items: LoginEventRow[];
|
|
163
|
+
total: number;
|
|
164
|
+
page: number;
|
|
165
|
+
limit: number;
|
|
166
|
+
}
|
|
167
|
+
|
|
136
168
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
137
169
|
|
|
138
170
|
/**
|
|
@@ -171,6 +203,21 @@ export interface AuthServiceClient {
|
|
|
171
203
|
logoutCurrent(request: LogoutCurrentRequest): Observable<LogoutResponse>;
|
|
172
204
|
|
|
173
205
|
logoutAll(request: LogoutAllRequest): Observable<LogoutResponse>;
|
|
206
|
+
|
|
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
|
+
|
|
213
|
+
restoreLogin(request: RestoreLoginRequest): Observable<AuthResult>;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Login history. Read-only audit feed for the settings page; rows come
|
|
217
|
+
* from LoginEvent. Internal alternative: tasks-service GC.
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
listLoginHistory(request: ListLoginHistoryRequest): Observable<ListLoginHistoryResponse>;
|
|
174
221
|
}
|
|
175
222
|
|
|
176
223
|
/**
|
|
@@ -211,6 +258,23 @@ export interface AuthServiceController {
|
|
|
211
258
|
logoutCurrent(request: LogoutCurrentRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
212
259
|
|
|
213
260
|
logoutAll(request: LogoutAllRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Self-service restore. Verifies credentials + password against a
|
|
264
|
+
* soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
|
|
265
|
+
* fresh tokens — the one auth path that DOES read deletedAt accounts.
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
restoreLogin(request: RestoreLoginRequest): Promise<AuthResult> | Observable<AuthResult> | AuthResult;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Login history. Read-only audit feed for the settings page; rows come
|
|
272
|
+
* from LoginEvent. Internal alternative: tasks-service GC.
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
listLoginHistory(
|
|
276
|
+
request: ListLoginHistoryRequest,
|
|
277
|
+
): Promise<ListLoginHistoryResponse> | Observable<ListLoginHistoryResponse> | ListLoginHistoryResponse;
|
|
214
278
|
}
|
|
215
279
|
|
|
216
280
|
export function AuthServiceControllerMethods() {
|
|
@@ -227,6 +291,8 @@ export function AuthServiceControllerMethods() {
|
|
|
227
291
|
"cleanupExpiredTotpSetups",
|
|
228
292
|
"logoutCurrent",
|
|
229
293
|
"logoutAll",
|
|
294
|
+
"restoreLogin",
|
|
295
|
+
"listLoginHistory",
|
|
230
296
|
];
|
|
231
297
|
for (const method of grpcMethods) {
|
|
232
298
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/gen/mail.ts
CHANGED
|
@@ -39,6 +39,16 @@ export interface SendRegistrationConfirmRequest {
|
|
|
39
39
|
username: string;
|
|
40
40
|
}
|
|
41
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
|
+
|
|
42
52
|
export const MAIL_V1_PACKAGE_NAME = "mail.v1";
|
|
43
53
|
|
|
44
54
|
/**
|
|
@@ -55,6 +65,13 @@ export interface MailServiceClient {
|
|
|
55
65
|
sendPasswordReset(request: SendPasswordResetRequest): Observable<MailAck>;
|
|
56
66
|
|
|
57
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>;
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
/**
|
|
@@ -71,11 +88,24 @@ export interface MailServiceController {
|
|
|
71
88
|
sendPasswordReset(request: SendPasswordResetRequest): Promise<MailAck> | Observable<MailAck> | MailAck;
|
|
72
89
|
|
|
73
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;
|
|
74
98
|
}
|
|
75
99
|
|
|
76
100
|
export function MailServiceControllerMethods() {
|
|
77
101
|
return function (constructor: Function) {
|
|
78
|
-
const grpcMethods: string[] = [
|
|
102
|
+
const grpcMethods: string[] = [
|
|
103
|
+
"sendReg",
|
|
104
|
+
"send2Fa",
|
|
105
|
+
"sendPasswordReset",
|
|
106
|
+
"sendRegistrationConfirm",
|
|
107
|
+
"sendDataExportReady",
|
|
108
|
+
];
|
|
79
109
|
for (const method of grpcMethods) {
|
|
80
110
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
81
111
|
GrpcMethod("MailService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -23,6 +23,15 @@ service AuthService {
|
|
|
23
23
|
// HMAC matches; LogoutAll wipes every row for the user.
|
|
24
24
|
rpc LogoutCurrent(LogoutCurrentRequest) returns (LogoutResponse);
|
|
25
25
|
rpc LogoutAll(LogoutAllRequest) returns (LogoutResponse);
|
|
26
|
+
|
|
27
|
+
// Self-service restore. Verifies credentials + password against a
|
|
28
|
+
// soft-deleted user, clears deletedAt/scheduledForHardDelete, and issues
|
|
29
|
+
// fresh tokens — the one auth path that DOES read deletedAt accounts.
|
|
30
|
+
rpc RestoreLogin(RestoreLoginRequest) returns (AuthResult);
|
|
31
|
+
|
|
32
|
+
// Login history. Read-only audit feed for the settings page; rows come
|
|
33
|
+
// from LoginEvent. Internal alternative: tasks-service GC.
|
|
34
|
+
rpc ListLoginHistory(ListLoginHistoryRequest) returns (ListLoginHistoryResponse);
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
enum TwoFactorType {
|
|
@@ -142,3 +151,33 @@ message LogoutResponse {
|
|
|
142
151
|
bool ok = 1;
|
|
143
152
|
int32 removed = 2; // number of refresh-token rows deleted
|
|
144
153
|
}
|
|
154
|
+
|
|
155
|
+
message RestoreLoginRequest {
|
|
156
|
+
string credentials = 1; // email or username
|
|
157
|
+
string password = 2;
|
|
158
|
+
string user_agent = 3;
|
|
159
|
+
string ip = 4;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
message ListLoginHistoryRequest {
|
|
163
|
+
string user_id = 1;
|
|
164
|
+
int32 page = 2;
|
|
165
|
+
int32 limit = 3;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
message LoginEventRow {
|
|
169
|
+
string id = 1;
|
|
170
|
+
string type = 2; // LOGIN | LOGOUT | REFRESH | TWO_FA_FAIL | PASSWORD_FAIL | BLOCKED | RESTORE
|
|
171
|
+
bool success = 3;
|
|
172
|
+
string reason = 4;
|
|
173
|
+
string ip = 5;
|
|
174
|
+
string user_agent = 6;
|
|
175
|
+
string created_at = 7;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
message ListLoginHistoryResponse {
|
|
179
|
+
repeated LoginEventRow items = 1;
|
|
180
|
+
int32 total = 2;
|
|
181
|
+
int32 page = 3;
|
|
182
|
+
int32 limit = 4;
|
|
183
|
+
}
|
package/proto/mail.proto
CHANGED
|
@@ -10,6 +10,10 @@ service MailService {
|
|
|
10
10
|
rpc Send2fa(Send2faRequest) returns (MailAck);
|
|
11
11
|
rpc SendPasswordReset(SendPasswordResetRequest) returns (MailAck);
|
|
12
12
|
rpc SendRegistrationConfirm(SendRegistrationConfirmRequest) returns (MailAck);
|
|
13
|
+
|
|
14
|
+
// GDPR data-export delivery — tasks-service fires after the JSON dump
|
|
15
|
+
// lands in S3; mail-service sends the signed URL with a sensible TTL note.
|
|
16
|
+
rpc SendDataExportReady(SendDataExportReadyRequest) returns (MailAck);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
message MailAck {
|
|
@@ -40,3 +44,11 @@ message SendRegistrationConfirmRequest {
|
|
|
40
44
|
string code = 2;
|
|
41
45
|
string username = 3;
|
|
42
46
|
}
|
|
47
|
+
|
|
48
|
+
message SendDataExportReadyRequest {
|
|
49
|
+
string email = 1;
|
|
50
|
+
string username = 2;
|
|
51
|
+
string file_url = 3; // signed S3 URL
|
|
52
|
+
int32 url_ttl_hours = 4; // for the message body
|
|
53
|
+
int32 file_size = 5;
|
|
54
|
+
}
|