@aepstore-dev/contracts 1.34.0 → 1.36.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/gen/payments.ts +64 -4
- package/package.json +1 -1
- package/proto/auth.proto +39 -0
- package/proto/mail.proto +12 -0
- package/proto/payments.proto +42 -4
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/gen/payments.ts
CHANGED
|
@@ -109,25 +109,66 @@ export interface WalletResponse {
|
|
|
109
109
|
|
|
110
110
|
export interface ListTransactionsRequest {
|
|
111
111
|
userId: string;
|
|
112
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Legacy low-level filter (one of LedgerTxType). Kept for backward
|
|
114
|
+
* compatibility — admin tooling still uses it directly.
|
|
115
|
+
*/
|
|
113
116
|
type: string;
|
|
114
117
|
page: number;
|
|
115
118
|
limit: number;
|
|
119
|
+
/**
|
|
120
|
+
* ↓ added for the wallet statement page (Round 3)
|
|
121
|
+
* UI-semantic filter mapped onto displayKind:
|
|
122
|
+
* ALL | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
|
|
123
|
+
*/
|
|
124
|
+
flow: string;
|
|
125
|
+
/**
|
|
126
|
+
* Period selection. `month` is the convenience form (YYYY-MM) used by the
|
|
127
|
+
* month dropdown; from/to override it for an arbitrary range.
|
|
128
|
+
*/
|
|
129
|
+
month: string;
|
|
130
|
+
from: string;
|
|
131
|
+
to: string;
|
|
132
|
+
/**
|
|
133
|
+
* Filter wallet to purchases/refunds of a specific Product category. Has
|
|
134
|
+
* no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
|
|
135
|
+
* product).
|
|
136
|
+
*/
|
|
137
|
+
productCategoryId: string;
|
|
138
|
+
/** sort_by ∈ { date | amount | type }. Default: date. */
|
|
139
|
+
sortBy: string;
|
|
140
|
+
/** order ∈ { asc | desc }. Default: desc. */
|
|
141
|
+
order: string;
|
|
116
142
|
}
|
|
117
143
|
|
|
118
144
|
export interface StatementEntry {
|
|
119
|
-
/** ledger entry id */
|
|
120
145
|
id: string;
|
|
121
146
|
txId: string;
|
|
122
|
-
/** tx type */
|
|
147
|
+
/** raw tx type (TOPUP|PURCHASE|...) */
|
|
123
148
|
type: string;
|
|
124
|
-
/** which of the user's accounts */
|
|
125
149
|
accountKind: string;
|
|
126
150
|
/** DEBIT | CREDIT */
|
|
127
151
|
direction: string;
|
|
128
152
|
amount: string;
|
|
129
153
|
description: string;
|
|
130
154
|
createdAt: string;
|
|
155
|
+
/**
|
|
156
|
+
* ↓ added for the wallet statement page (Round 3)
|
|
157
|
+
* UI-friendly classification computed server-side:
|
|
158
|
+
* TOPUP | PURCHASE | REFUND | PREMIUM | WITHDRAWAL | SALE_CLEAR | ADJUSTMENT
|
|
159
|
+
* PREMIUM is split out of PURCHASE/REFUND so the UI can show
|
|
160
|
+
* "Продление Premium" / refund-of-premium in their own filter bucket.
|
|
161
|
+
*/
|
|
162
|
+
displayKind: string;
|
|
163
|
+
/** running USER_SPENDING-style balance, Decimal-as-string */
|
|
164
|
+
balanceAfter: string;
|
|
165
|
+
/** empty for non-product entries */
|
|
166
|
+
productId: string;
|
|
167
|
+
productName: string;
|
|
168
|
+
/** "Assets" | "Project File" | "Templates" */
|
|
169
|
+
productCategory: string;
|
|
170
|
+
/** optional thumbnail URL for richer rows */
|
|
171
|
+
productPreview: string;
|
|
131
172
|
}
|
|
132
173
|
|
|
133
174
|
export interface TransactionsListResponse {
|
|
@@ -137,6 +178,18 @@ export interface TransactionsListResponse {
|
|
|
137
178
|
limit: number;
|
|
138
179
|
}
|
|
139
180
|
|
|
181
|
+
export interface GetTransactionMonthsRequest {
|
|
182
|
+
userId: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface GetTransactionMonthsResponse {
|
|
186
|
+
/**
|
|
187
|
+
* Newest first. "YYYY-MM" strings; the dropdown renders them
|
|
188
|
+
* localized client-side.
|
|
189
|
+
*/
|
|
190
|
+
months: string[];
|
|
191
|
+
}
|
|
192
|
+
|
|
140
193
|
/**
|
|
141
194
|
* ---------------------------------------------------------------------------
|
|
142
195
|
* Withdrawals
|
|
@@ -522,6 +575,8 @@ export interface PaymentsServiceClient {
|
|
|
522
575
|
|
|
523
576
|
listTransactions(request: ListTransactionsRequest): Observable<TransactionsListResponse>;
|
|
524
577
|
|
|
578
|
+
getTransactionMonths(request: GetTransactionMonthsRequest): Observable<GetTransactionMonthsResponse>;
|
|
579
|
+
|
|
525
580
|
/** ----- withdrawals ----- */
|
|
526
581
|
|
|
527
582
|
requestWithdrawal(request: RequestWithdrawalRequest): Observable<Withdrawal>;
|
|
@@ -616,6 +671,10 @@ export interface PaymentsServiceController {
|
|
|
616
671
|
request: ListTransactionsRequest,
|
|
617
672
|
): Promise<TransactionsListResponse> | Observable<TransactionsListResponse> | TransactionsListResponse;
|
|
618
673
|
|
|
674
|
+
getTransactionMonths(
|
|
675
|
+
request: GetTransactionMonthsRequest,
|
|
676
|
+
): Promise<GetTransactionMonthsResponse> | Observable<GetTransactionMonthsResponse> | GetTransactionMonthsResponse;
|
|
677
|
+
|
|
619
678
|
/** ----- withdrawals ----- */
|
|
620
679
|
|
|
621
680
|
requestWithdrawal(request: RequestWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
@@ -715,6 +774,7 @@ export function PaymentsServiceControllerMethods() {
|
|
|
715
774
|
"refundPurchase",
|
|
716
775
|
"getWallet",
|
|
717
776
|
"listTransactions",
|
|
777
|
+
"getTransactionMonths",
|
|
718
778
|
"requestWithdrawal",
|
|
719
779
|
"listWithdrawals",
|
|
720
780
|
"processWithdrawal",
|
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
|
+
}
|
package/proto/payments.proto
CHANGED
|
@@ -16,6 +16,7 @@ service PaymentsService {
|
|
|
16
16
|
// ----- wallet -----
|
|
17
17
|
rpc GetWallet(GetWalletRequest) returns (WalletResponse);
|
|
18
18
|
rpc ListTransactions(ListTransactionsRequest) returns (TransactionsListResponse);
|
|
19
|
+
rpc GetTransactionMonths(GetTransactionMonthsRequest) returns (GetTransactionMonthsResponse);
|
|
19
20
|
|
|
20
21
|
// ----- withdrawals -----
|
|
21
22
|
rpc RequestWithdrawal(RequestWithdrawalRequest) returns (Withdrawal);
|
|
@@ -116,22 +117,59 @@ message WalletResponse {
|
|
|
116
117
|
|
|
117
118
|
message ListTransactionsRequest {
|
|
118
119
|
string user_id = 1;
|
|
119
|
-
|
|
120
|
+
// Legacy low-level filter (one of LedgerTxType). Kept for backward
|
|
121
|
+
// compatibility — admin tooling still uses it directly.
|
|
122
|
+
string type = 2;
|
|
120
123
|
int32 page = 3;
|
|
121
124
|
int32 limit = 4;
|
|
125
|
+
// ↓ added for the wallet statement page (Round 3)
|
|
126
|
+
// UI-semantic filter mapped onto displayKind:
|
|
127
|
+
// ALL | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
|
|
128
|
+
string flow = 5;
|
|
129
|
+
// Period selection. `month` is the convenience form (YYYY-MM) used by the
|
|
130
|
+
// month dropdown; from/to override it for an arbitrary range.
|
|
131
|
+
string month = 6;
|
|
132
|
+
string from = 7;
|
|
133
|
+
string to = 8;
|
|
134
|
+
// Filter wallet to purchases/refunds of a specific Product category. Has
|
|
135
|
+
// no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
|
|
136
|
+
// product).
|
|
137
|
+
string product_category_id = 9;
|
|
138
|
+
// sort_by ∈ { date | amount | type }. Default: date.
|
|
139
|
+
string sort_by = 10;
|
|
140
|
+
// order ∈ { asc | desc }. Default: desc.
|
|
141
|
+
string order = 11;
|
|
122
142
|
}
|
|
123
143
|
message StatementEntry {
|
|
124
|
-
string id = 1;
|
|
144
|
+
string id = 1;
|
|
125
145
|
string tx_id = 2;
|
|
126
|
-
string type = 3; // tx type
|
|
127
|
-
string account_kind = 4;
|
|
146
|
+
string type = 3; // raw tx type (TOPUP|PURCHASE|...)
|
|
147
|
+
string account_kind = 4;
|
|
128
148
|
string direction = 5; // DEBIT | CREDIT
|
|
129
149
|
string amount = 6;
|
|
130
150
|
string description = 7;
|
|
131
151
|
string created_at = 8;
|
|
152
|
+
// ↓ added for the wallet statement page (Round 3)
|
|
153
|
+
// UI-friendly classification computed server-side:
|
|
154
|
+
// TOPUP | PURCHASE | REFUND | PREMIUM | WITHDRAWAL | SALE_CLEAR | ADJUSTMENT
|
|
155
|
+
// PREMIUM is split out of PURCHASE/REFUND so the UI can show
|
|
156
|
+
// "Продление Premium" / refund-of-premium in their own filter bucket.
|
|
157
|
+
string display_kind = 9;
|
|
158
|
+
string balance_after = 10; // running USER_SPENDING-style balance, Decimal-as-string
|
|
159
|
+
string product_id = 11; // empty for non-product entries
|
|
160
|
+
string product_name = 12;
|
|
161
|
+
string product_category = 13; // "Assets" | "Project File" | "Templates"
|
|
162
|
+
string product_preview = 14; // optional thumbnail URL for richer rows
|
|
132
163
|
}
|
|
133
164
|
message TransactionsListResponse { repeated StatementEntry items = 1; int32 total = 2; int32 page = 3; int32 limit = 4; }
|
|
134
165
|
|
|
166
|
+
message GetTransactionMonthsRequest { string user_id = 1; }
|
|
167
|
+
message GetTransactionMonthsResponse {
|
|
168
|
+
// Newest first. "YYYY-MM" strings; the dropdown renders them
|
|
169
|
+
// localized client-side.
|
|
170
|
+
repeated string months = 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
135
173
|
// ---------------------------------------------------------------------------
|
|
136
174
|
// Withdrawals
|
|
137
175
|
// ---------------------------------------------------------------------------
|