@aepstore-dev/contracts 1.42.1 → 1.44.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/dist/{src/proto → proto}/paths.js +1 -3
- package/gen/activity.ts +270 -0
- package/gen/auth.ts +317 -0
- package/gen/mail.ts +121 -0
- package/gen/payments.ts +828 -0
- package/gen/products.ts +579 -0
- package/{dist/gen → gen}/support.d.ts +28 -0
- package/{dist/gen → gen}/support.js +1 -0
- package/gen/support.ts +252 -0
- package/gen/taxonomy.ts +185 -0
- package/gen/upload.ts +287 -0
- package/gen/users.ts +929 -0
- package/package.json +6 -15
- package/proto/support.proto +18 -1
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/proto → proto}/index.d.ts +0 -0
- /package/dist/{src/proto → proto}/index.js +0 -0
- /package/dist/{src/proto → proto}/paths.d.ts +0 -0
- /package/{dist/gen → gen}/activity.d.ts +0 -0
- /package/{dist/gen → gen}/activity.js +0 -0
- /package/{dist/gen → gen}/auth.d.ts +0 -0
- /package/{dist/gen → gen}/auth.js +0 -0
- /package/{dist/gen → gen}/mail.d.ts +0 -0
- /package/{dist/gen → gen}/mail.js +0 -0
- /package/{dist/gen → gen}/payments.d.ts +0 -0
- /package/{dist/gen → gen}/payments.js +0 -0
- /package/{dist/gen → gen}/products.d.ts +0 -0
- /package/{dist/gen → gen}/products.js +0 -0
- /package/{dist/gen → gen}/taxonomy.d.ts +0 -0
- /package/{dist/gen → gen}/taxonomy.js +0 -0
- /package/{dist/gen → gen}/upload.d.ts +0 -0
- /package/{dist/gen → gen}/upload.js +0 -0
- /package/{dist/gen → gen}/users.d.ts +0 -0
- /package/{dist/gen → gen}/users.js +0 -0
package/gen/users.ts
ADDED
|
@@ -0,0 +1,929 @@
|
|
|
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.1
|
|
5
|
+
// source: users.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "users.v1";
|
|
12
|
+
|
|
13
|
+
export enum UserFieldsType {
|
|
14
|
+
USER_FIELDS_TYPE_UNSPECIFIED = 0,
|
|
15
|
+
USER_FIELDS_TYPE_VIDEOS = 1,
|
|
16
|
+
USER_FIELDS_TYPE_PRODUCTS = 2,
|
|
17
|
+
USER_FIELDS_TYPE_SUBSCRIPTIONS = 3,
|
|
18
|
+
USER_FIELDS_TYPE_SUBSCRIBERS = 4,
|
|
19
|
+
UNRECOGNIZED = -1,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Periods mirror PremiumPeriod enum in schema.prisma. */
|
|
23
|
+
export enum PremiumPeriod {
|
|
24
|
+
PREMIUM_PERIOD_UNSPECIFIED = 0,
|
|
25
|
+
PREMIUM_PERIOD_MONTH_1 = 1,
|
|
26
|
+
PREMIUM_PERIOD_MONTH_3 = 2,
|
|
27
|
+
PREMIUM_PERIOD_MONTH_6 = 3,
|
|
28
|
+
PREMIUM_PERIOD_MONTH_12 = 4,
|
|
29
|
+
UNRECOGNIZED = -1,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface Ok {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface User {
|
|
37
|
+
id: string;
|
|
38
|
+
email: string;
|
|
39
|
+
username: string;
|
|
40
|
+
avatarUrl: string;
|
|
41
|
+
roles: string[];
|
|
42
|
+
/** primary role for backwards compat */
|
|
43
|
+
role: string;
|
|
44
|
+
/** ISO 8601 */
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
isBanned: boolean;
|
|
48
|
+
/** ISO 8601, empty = permanent/none */
|
|
49
|
+
bannedUntil: string;
|
|
50
|
+
banReason: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface BanUserRequest {
|
|
54
|
+
adminId: string;
|
|
55
|
+
userId: string;
|
|
56
|
+
reason: string;
|
|
57
|
+
/** ISO 8601; empty = permanent ban */
|
|
58
|
+
until: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface UnbanUserRequest {
|
|
62
|
+
adminId: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface Country {
|
|
67
|
+
id: string;
|
|
68
|
+
code: string;
|
|
69
|
+
name: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface SocialMedia {
|
|
73
|
+
id: string;
|
|
74
|
+
platform: string;
|
|
75
|
+
url: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CreateSocialMedia {
|
|
79
|
+
platform: string;
|
|
80
|
+
url: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ProductUser {
|
|
84
|
+
id: string;
|
|
85
|
+
username: string;
|
|
86
|
+
avatarUrl: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Category {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface Product {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
/** Decimal as string (D7) */
|
|
99
|
+
price: string;
|
|
100
|
+
createdAt: string;
|
|
101
|
+
updatedAt: string;
|
|
102
|
+
/** profile-card preview fields */
|
|
103
|
+
preview: string;
|
|
104
|
+
/** Decimal as string */
|
|
105
|
+
finalPrice: string;
|
|
106
|
+
/** number as string */
|
|
107
|
+
averageRating: string;
|
|
108
|
+
status: string;
|
|
109
|
+
/**
|
|
110
|
+
* Author of the product (same person as the profile owner, but echoed per
|
|
111
|
+
* product so cards can render the author independently).
|
|
112
|
+
*/
|
|
113
|
+
user: ProductUser | undefined;
|
|
114
|
+
categories: Category[];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface Video {
|
|
118
|
+
id: string;
|
|
119
|
+
title: string;
|
|
120
|
+
description: string;
|
|
121
|
+
url: string;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ActiveDevice {
|
|
127
|
+
id: string;
|
|
128
|
+
userAgent: string;
|
|
129
|
+
ip: string;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
lastUsedAt: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface ProfileStats {
|
|
135
|
+
subscribersCount: number;
|
|
136
|
+
subscriptionsCount: number;
|
|
137
|
+
productsCount: number;
|
|
138
|
+
videosCount: number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Compact public user card for subscriber/subscription lists — no email/ban data. */
|
|
142
|
+
export interface ProfileUser {
|
|
143
|
+
id: string;
|
|
144
|
+
username: string;
|
|
145
|
+
avatarUrl: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface GetPublicProfileRequest {
|
|
149
|
+
username: string;
|
|
150
|
+
/** optional — present when caller is authenticated */
|
|
151
|
+
viewerUserId: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface PublicProfileResponse {
|
|
155
|
+
id: string;
|
|
156
|
+
username: string;
|
|
157
|
+
fullName: string;
|
|
158
|
+
/** Decimal as string */
|
|
159
|
+
rating: string;
|
|
160
|
+
aboutMe: string;
|
|
161
|
+
socialMedia: SocialMedia[];
|
|
162
|
+
stats: ProfileStats | undefined;
|
|
163
|
+
videos: Video[];
|
|
164
|
+
products: Product[];
|
|
165
|
+
country: Country | undefined;
|
|
166
|
+
avatarUrl: string;
|
|
167
|
+
bannerUrl: string;
|
|
168
|
+
role: string;
|
|
169
|
+
createdAt: string;
|
|
170
|
+
hideSubscriptions: boolean;
|
|
171
|
+
/** Either populated lists or empty depending on hide_subscriptions */
|
|
172
|
+
subscriptions: ProfileUser[];
|
|
173
|
+
subscribers: ProfileUser[];
|
|
174
|
+
isOwner: boolean;
|
|
175
|
+
/** viewer is subscribed to this profile (false when anonymous / self) */
|
|
176
|
+
isSubscribed: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Premium fields — populated only when the profile owner has an active
|
|
179
|
+
* PremiumSubscription. Non-premium viewers and non-premium profiles see
|
|
180
|
+
* empty strings / false.
|
|
181
|
+
*/
|
|
182
|
+
isPremium: boolean;
|
|
183
|
+
profileColor: string;
|
|
184
|
+
avatarBorder: AvatarBorder | undefined;
|
|
185
|
+
animatedAvatarUrl: string;
|
|
186
|
+
animatedBannerUrl: string;
|
|
187
|
+
/** ISO 8601, empty when not premium */
|
|
188
|
+
premiumExpiresAt: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface UpdateProfileRequest {
|
|
192
|
+
userId: string;
|
|
193
|
+
fullName: string;
|
|
194
|
+
aboutMe: string;
|
|
195
|
+
newsletterSubscription: boolean;
|
|
196
|
+
hideSubscriptions: boolean;
|
|
197
|
+
avatarUrl: string;
|
|
198
|
+
bannerUrl: string;
|
|
199
|
+
countryId: string;
|
|
200
|
+
timezone: string;
|
|
201
|
+
socialMedia: CreateSocialMedia[];
|
|
202
|
+
/**
|
|
203
|
+
* Premium-only fields — rejected with FAILED_PRECONDITION when the caller
|
|
204
|
+
* has no active premium. Empty string clears the value.
|
|
205
|
+
*/
|
|
206
|
+
profileColor: string;
|
|
207
|
+
avatarBorderId: string;
|
|
208
|
+
animatedAvatarUrl: string;
|
|
209
|
+
animatedBannerUrl: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface UpdateUserRequest {
|
|
213
|
+
userId: string;
|
|
214
|
+
username: string;
|
|
215
|
+
email: string;
|
|
216
|
+
/** confirmation code when changing email/username */
|
|
217
|
+
code: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface UserResponse {
|
|
221
|
+
user: User | undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface UpdateUserRoleRequest {
|
|
225
|
+
adminId: string;
|
|
226
|
+
userId: string;
|
|
227
|
+
role: string;
|
|
228
|
+
/** "grant" (default) | "revoke" */
|
|
229
|
+
action: string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface GetUsersRequest {
|
|
233
|
+
page: string;
|
|
234
|
+
limit: string;
|
|
235
|
+
search: string;
|
|
236
|
+
roleName: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface GetUsersResponse {
|
|
240
|
+
items: User[];
|
|
241
|
+
total: number;
|
|
242
|
+
page: number;
|
|
243
|
+
limit: number;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface GetActiveDevicesRequest {
|
|
247
|
+
userId: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface GetActiveDevicesResponse {
|
|
251
|
+
devices: ActiveDevice[];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface ManageDevicesRequest {
|
|
255
|
+
userId: string;
|
|
256
|
+
deviceIdsToRemove: string[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface ManageDevicesResponse {
|
|
260
|
+
ok: boolean;
|
|
261
|
+
removedCount: number;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface GetUserFieldsRequest {
|
|
265
|
+
username: string;
|
|
266
|
+
type: UserFieldsType;
|
|
267
|
+
page: number;
|
|
268
|
+
limit: number;
|
|
269
|
+
/** optional */
|
|
270
|
+
viewerUserId: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface GetUserFieldsResponse {
|
|
274
|
+
videos: Video[];
|
|
275
|
+
products: Product[];
|
|
276
|
+
subscriptions: ProfileUser[];
|
|
277
|
+
subscribers: ProfileUser[];
|
|
278
|
+
total: number;
|
|
279
|
+
page: number;
|
|
280
|
+
limit: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface SubscriptionRequest {
|
|
284
|
+
/** the authenticated user performing the action */
|
|
285
|
+
subscriberId: string;
|
|
286
|
+
/** the user being (un)subscribed to/from */
|
|
287
|
+
targetId: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface SubscriptionResponse {
|
|
291
|
+
/** state after the call */
|
|
292
|
+
subscribed: boolean;
|
|
293
|
+
/** target's subscriber count after the call */
|
|
294
|
+
subscribersCount: number;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface GetMyPremiumRequest {
|
|
298
|
+
userId: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface PremiumStateResponse {
|
|
302
|
+
isActive: boolean;
|
|
303
|
+
/** ACTIVE | EXPIRED | CANCELED | empty (never purchased) */
|
|
304
|
+
status: string;
|
|
305
|
+
currentPeriod: PremiumPeriod;
|
|
306
|
+
/** ISO 8601, empty when never purchased */
|
|
307
|
+
startedAt: string;
|
|
308
|
+
/** ISO 8601 */
|
|
309
|
+
expiresAt: string;
|
|
310
|
+
autoRenew: boolean;
|
|
311
|
+
hasSavedPaymentMethod: boolean;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface SetPremiumAutoRenewRequest {
|
|
315
|
+
userId: string;
|
|
316
|
+
enabled: boolean;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Internal — payments-service hands us the period that was just paid for, plus
|
|
321
|
+
* the YooKassa payment_method id (empty for balance/non-recurring purchases).
|
|
322
|
+
*/
|
|
323
|
+
export interface ActivatePremiumRequest {
|
|
324
|
+
userId: string;
|
|
325
|
+
period: PremiumPeriod;
|
|
326
|
+
/** empty for BALANCE / one-shot */
|
|
327
|
+
paymentMethodId: string;
|
|
328
|
+
/** false = first purchase; true = cron-driven renewal */
|
|
329
|
+
isRenewal: boolean;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface IsPremiumActiveRequest {
|
|
333
|
+
userId: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface IsPremiumActiveResponse {
|
|
337
|
+
isActive: boolean;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface AvatarBorder {
|
|
341
|
+
id: string;
|
|
342
|
+
code: string;
|
|
343
|
+
name: string;
|
|
344
|
+
description: string;
|
|
345
|
+
imageUrl: string;
|
|
346
|
+
isAnimated: boolean;
|
|
347
|
+
source: string;
|
|
348
|
+
sortOrder: number;
|
|
349
|
+
isActive: boolean;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export interface ListAvatarBordersRequest {
|
|
353
|
+
/** admin-only — gateway gates by role */
|
|
354
|
+
includeInactive: boolean;
|
|
355
|
+
/** optional filter */
|
|
356
|
+
source: string;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface ListAvatarBordersResponse {
|
|
360
|
+
items: AvatarBorder[];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface UpsertAvatarBorderRequest {
|
|
364
|
+
/** empty = create */
|
|
365
|
+
id: string;
|
|
366
|
+
/** required when creating */
|
|
367
|
+
code: string;
|
|
368
|
+
name: string;
|
|
369
|
+
description: string;
|
|
370
|
+
imageUrl: string;
|
|
371
|
+
isAnimated: boolean;
|
|
372
|
+
source: string;
|
|
373
|
+
sortOrder: number;
|
|
374
|
+
isActive: boolean;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface DeleteAvatarBorderRequest {
|
|
378
|
+
id: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export interface DeleteAvatarBorderResponse {
|
|
382
|
+
ok: boolean;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface UpdatePrivacyRequest {
|
|
386
|
+
userId: string;
|
|
387
|
+
hideEmail: boolean;
|
|
388
|
+
hideBalance: boolean;
|
|
389
|
+
hideOnline: boolean;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface UpdateEmailPrefsRequest {
|
|
393
|
+
userId: string;
|
|
394
|
+
emailOnSales: boolean;
|
|
395
|
+
emailOnReviews: boolean;
|
|
396
|
+
emailOnNews: boolean;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export interface UpdateEmailPrefsResponse {
|
|
400
|
+
emailOnSales: boolean;
|
|
401
|
+
emailOnReviews: boolean;
|
|
402
|
+
emailOnNews: boolean;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface UpdateLocaleRequest {
|
|
406
|
+
userId: string;
|
|
407
|
+
/** "ru" | "en" | ... */
|
|
408
|
+
locale: string;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface UpdateLocaleResponse {
|
|
412
|
+
locale: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface SoftDeleteAccountRequest {
|
|
416
|
+
userId: string;
|
|
417
|
+
/** optional, for support/audit */
|
|
418
|
+
reason: string;
|
|
419
|
+
/** 0 → use server default (30) */
|
|
420
|
+
cooldownDays: number;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export interface SoftDeleteAccountResponse {
|
|
424
|
+
/** ISO 8601 */
|
|
425
|
+
deletedAt: string;
|
|
426
|
+
scheduledForHardDelete: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface RestoreAccountRequest {
|
|
430
|
+
userId: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface HardDeletePendingRequest {
|
|
434
|
+
/** 0 → default 100 */
|
|
435
|
+
maxBatch: number;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface HardDeletePendingResponse {
|
|
439
|
+
deleted: number;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface ChangePasswordRequest {
|
|
443
|
+
userId: string;
|
|
444
|
+
currentPassword: string;
|
|
445
|
+
newPassword: string;
|
|
446
|
+
/** Optional: revoke all other sessions on success. */
|
|
447
|
+
revokeOtherSessions: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export interface BlockUserRequest {
|
|
451
|
+
blockerId: string;
|
|
452
|
+
blockedId: string;
|
|
453
|
+
/** optional */
|
|
454
|
+
reason: string;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface BlockUserResponse {
|
|
458
|
+
blocked: boolean;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface BlockedUserRow {
|
|
462
|
+
id: string;
|
|
463
|
+
username: string;
|
|
464
|
+
avatarUrl: string;
|
|
465
|
+
blockedAt: string;
|
|
466
|
+
reason: string;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface ListBlockedUsersRequest {
|
|
470
|
+
blockerId: string;
|
|
471
|
+
page: number;
|
|
472
|
+
limit: number;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export interface ListBlockedUsersResponse {
|
|
476
|
+
items: BlockedUserRow[];
|
|
477
|
+
total: number;
|
|
478
|
+
page: number;
|
|
479
|
+
limit: number;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export interface IsBlockedRequest {
|
|
483
|
+
blockerId: string;
|
|
484
|
+
blockedId: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export interface IsBlockedResponse {
|
|
488
|
+
isBlocked: boolean;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export interface DataExportRequestRow {
|
|
492
|
+
id: string;
|
|
493
|
+
userId: string;
|
|
494
|
+
/** PENDING | PROCESSING | READY | FAILED */
|
|
495
|
+
status: string;
|
|
496
|
+
fileUrl: string;
|
|
497
|
+
fileSize: number;
|
|
498
|
+
error: string;
|
|
499
|
+
createdAt: string;
|
|
500
|
+
completedAt: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export interface RequestDataExportRequest {
|
|
504
|
+
userId: string;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export interface ListDataExportsRequest {
|
|
508
|
+
userId: string;
|
|
509
|
+
page: number;
|
|
510
|
+
limit: number;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export interface ListDataExportsResponse {
|
|
514
|
+
items: DataExportRequestRow[];
|
|
515
|
+
total: number;
|
|
516
|
+
page: number;
|
|
517
|
+
limit: number;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface PickPendingDataExportRequest {
|
|
521
|
+
/** tasks-service polls; returns one PENDING row marked PROCESSING, or empty. */
|
|
522
|
+
Placeholder: boolean;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export interface CompleteDataExportRequest {
|
|
526
|
+
id: string;
|
|
527
|
+
fileUrl: string;
|
|
528
|
+
fileSize: number;
|
|
529
|
+
/** if set, marks FAILED instead of READY */
|
|
530
|
+
error: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export interface CollectUserExportDataRequest {
|
|
534
|
+
userId: string;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface CollectUserExportDataResponse {
|
|
538
|
+
/**
|
|
539
|
+
* Opaque JSON-as-string of user-owned data. tasks-service writes it to
|
|
540
|
+
* S3 verbatim. Keeps the schema-specific marshaling private to users-service.
|
|
541
|
+
*/
|
|
542
|
+
payloadJson: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface GetAccountSettingsRequest {
|
|
546
|
+
userId: string;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export interface AccountSettingsResponse {
|
|
550
|
+
/** Identity */
|
|
551
|
+
id: string;
|
|
552
|
+
username: string;
|
|
553
|
+
email: string;
|
|
554
|
+
fullName: string;
|
|
555
|
+
aboutMe: string;
|
|
556
|
+
avatarUrl: string;
|
|
557
|
+
bannerUrl: string;
|
|
558
|
+
locale: string;
|
|
559
|
+
timezone: string;
|
|
560
|
+
countryId: string;
|
|
561
|
+
createdAt: string;
|
|
562
|
+
/** 2FA */
|
|
563
|
+
twoFactorType: string;
|
|
564
|
+
twoFactorEnabled: boolean;
|
|
565
|
+
backupCodesRemaining: number;
|
|
566
|
+
/** Privacy */
|
|
567
|
+
hideEmail: boolean;
|
|
568
|
+
hideBalance: boolean;
|
|
569
|
+
hideOnline: boolean;
|
|
570
|
+
hideSubscriptions: boolean;
|
|
571
|
+
/** Email prefs */
|
|
572
|
+
emailOnSales: boolean;
|
|
573
|
+
emailOnReviews: boolean;
|
|
574
|
+
emailOnNews: boolean;
|
|
575
|
+
/** Payout defaults */
|
|
576
|
+
payoutMethod: string;
|
|
577
|
+
payoutDetails: string;
|
|
578
|
+
/** Premium snapshot */
|
|
579
|
+
premiumIsActive: boolean;
|
|
580
|
+
premiumStatus: string;
|
|
581
|
+
premiumExpiresAt: string;
|
|
582
|
+
premiumAutoRenew: boolean;
|
|
583
|
+
/** Soft-delete state */
|
|
584
|
+
deletedAt: string;
|
|
585
|
+
scheduledForHardDelete: string;
|
|
586
|
+
socialMedia: SocialMedia[];
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
590
|
+
|
|
591
|
+
export interface UsersServiceClient {
|
|
592
|
+
getPublicProfile(request: GetPublicProfileRequest): Observable<PublicProfileResponse>;
|
|
593
|
+
|
|
594
|
+
updateProfile(request: UpdateProfileRequest): Observable<PublicProfileResponse>;
|
|
595
|
+
|
|
596
|
+
updateUser(request: UpdateUserRequest): Observable<UserResponse>;
|
|
597
|
+
|
|
598
|
+
updateUserRole(request: UpdateUserRoleRequest): Observable<UserResponse>;
|
|
599
|
+
|
|
600
|
+
getUsers(request: GetUsersRequest): Observable<GetUsersResponse>;
|
|
601
|
+
|
|
602
|
+
getActiveDevices(request: GetActiveDevicesRequest): Observable<GetActiveDevicesResponse>;
|
|
603
|
+
|
|
604
|
+
manageDevices(request: ManageDevicesRequest): Observable<ManageDevicesResponse>;
|
|
605
|
+
|
|
606
|
+
getUserFields(request: GetUserFieldsRequest): Observable<GetUserFieldsResponse>;
|
|
607
|
+
|
|
608
|
+
createSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
|
|
609
|
+
|
|
610
|
+
deleteSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
|
|
611
|
+
|
|
612
|
+
banUser(request: BanUserRequest): Observable<UserResponse>;
|
|
613
|
+
|
|
614
|
+
unbanUser(request: UnbanUserRequest): Observable<UserResponse>;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Premium (paid). State lives in users-service; payments-service handles
|
|
618
|
+
* money and calls ActivatePremium (internal) on completion.
|
|
619
|
+
*/
|
|
620
|
+
|
|
621
|
+
getMyPremium(request: GetMyPremiumRequest): Observable<PremiumStateResponse>;
|
|
622
|
+
|
|
623
|
+
setPremiumAutoRenew(request: SetPremiumAutoRenewRequest): Observable<PremiumStateResponse>;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Internal — InternalServiceGuard. Called by payments-service after a
|
|
627
|
+
* successful premium payment (balance or YooKassa webhook).
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
activatePremium(request: ActivatePremiumRequest): Observable<PremiumStateResponse>;
|
|
631
|
+
|
|
632
|
+
/** Internal — fast lookup for the commission engine in payments-service. */
|
|
633
|
+
|
|
634
|
+
isPremiumActive(request: IsPremiumActiveRequest): Observable<IsPremiumActiveResponse>;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Avatar borders (catalog + admin CRUD). Catalog read is public; mutations
|
|
638
|
+
* are admin only (gateway enforces with RolesGuard).
|
|
639
|
+
*/
|
|
640
|
+
|
|
641
|
+
listAvatarBorders(request: ListAvatarBordersRequest): Observable<ListAvatarBordersResponse>;
|
|
642
|
+
|
|
643
|
+
upsertAvatarBorder(request: UpsertAvatarBorderRequest): Observable<AvatarBorder>;
|
|
644
|
+
|
|
645
|
+
deleteAvatarBorder(request: DeleteAvatarBorderRequest): Observable<DeleteAvatarBorderResponse>;
|
|
646
|
+
|
|
647
|
+
/** Account settings — bundled write surface for the UI. */
|
|
648
|
+
|
|
649
|
+
updatePrivacy(request: UpdatePrivacyRequest): Observable<PublicProfileResponse>;
|
|
650
|
+
|
|
651
|
+
updateEmailPrefs(request: UpdateEmailPrefsRequest): Observable<UpdateEmailPrefsResponse>;
|
|
652
|
+
|
|
653
|
+
updateLocale(request: UpdateLocaleRequest): Observable<UpdateLocaleResponse>;
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Soft-delete + restore. Internal AuthService also queries the soft-delete
|
|
657
|
+
* state on login (rejects if deletedAt set).
|
|
658
|
+
*/
|
|
659
|
+
|
|
660
|
+
softDeleteAccount(request: SoftDeleteAccountRequest): Observable<SoftDeleteAccountResponse>;
|
|
661
|
+
|
|
662
|
+
restoreAccount(request: RestoreAccountRequest): Observable<UserResponse>;
|
|
663
|
+
|
|
664
|
+
/** tasks-service cron */
|
|
665
|
+
|
|
666
|
+
hardDeletePending(request: HardDeletePendingRequest): Observable<HardDeletePendingResponse>;
|
|
667
|
+
|
|
668
|
+
/** Blocks */
|
|
669
|
+
|
|
670
|
+
blockUser(request: BlockUserRequest): Observable<BlockUserResponse>;
|
|
671
|
+
|
|
672
|
+
unblockUser(request: BlockUserRequest): Observable<BlockUserResponse>;
|
|
673
|
+
|
|
674
|
+
listBlockedUsers(request: ListBlockedUsersRequest): Observable<ListBlockedUsersResponse>;
|
|
675
|
+
|
|
676
|
+
/** internal lookup */
|
|
677
|
+
|
|
678
|
+
isBlocked(request: IsBlockedRequest): Observable<IsBlockedResponse>;
|
|
679
|
+
|
|
680
|
+
/** Data export */
|
|
681
|
+
|
|
682
|
+
requestDataExport(request: RequestDataExportRequest): Observable<DataExportRequestRow>;
|
|
683
|
+
|
|
684
|
+
listDataExports(request: ListDataExportsRequest): Observable<ListDataExportsResponse>;
|
|
685
|
+
|
|
686
|
+
/** tasks-service */
|
|
687
|
+
|
|
688
|
+
pickPendingDataExport(request: PickPendingDataExportRequest): Observable<DataExportRequestRow>;
|
|
689
|
+
|
|
690
|
+
/** tasks-service */
|
|
691
|
+
|
|
692
|
+
completeDataExport(request: CompleteDataExportRequest): Observable<DataExportRequestRow>;
|
|
693
|
+
|
|
694
|
+
/** tasks-service */
|
|
695
|
+
|
|
696
|
+
collectUserExportData(request: CollectUserExportDataRequest): Observable<CollectUserExportDataResponse>;
|
|
697
|
+
|
|
698
|
+
/** Unified read for the settings page */
|
|
699
|
+
|
|
700
|
+
getAccountSettings(request: GetAccountSettingsRequest): Observable<AccountSettingsResponse>;
|
|
701
|
+
|
|
702
|
+
/** Password — separate from generic createCode/verifyCode reset flow. */
|
|
703
|
+
|
|
704
|
+
changePassword(request: ChangePasswordRequest): Observable<Ok>;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
export interface UsersServiceController {
|
|
708
|
+
getPublicProfile(
|
|
709
|
+
request: GetPublicProfileRequest,
|
|
710
|
+
): Promise<PublicProfileResponse> | Observable<PublicProfileResponse> | PublicProfileResponse;
|
|
711
|
+
|
|
712
|
+
updateProfile(
|
|
713
|
+
request: UpdateProfileRequest,
|
|
714
|
+
): Promise<PublicProfileResponse> | Observable<PublicProfileResponse> | PublicProfileResponse;
|
|
715
|
+
|
|
716
|
+
updateUser(request: UpdateUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
717
|
+
|
|
718
|
+
updateUserRole(request: UpdateUserRoleRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
719
|
+
|
|
720
|
+
getUsers(request: GetUsersRequest): Promise<GetUsersResponse> | Observable<GetUsersResponse> | GetUsersResponse;
|
|
721
|
+
|
|
722
|
+
getActiveDevices(
|
|
723
|
+
request: GetActiveDevicesRequest,
|
|
724
|
+
): Promise<GetActiveDevicesResponse> | Observable<GetActiveDevicesResponse> | GetActiveDevicesResponse;
|
|
725
|
+
|
|
726
|
+
manageDevices(
|
|
727
|
+
request: ManageDevicesRequest,
|
|
728
|
+
): Promise<ManageDevicesResponse> | Observable<ManageDevicesResponse> | ManageDevicesResponse;
|
|
729
|
+
|
|
730
|
+
getUserFields(
|
|
731
|
+
request: GetUserFieldsRequest,
|
|
732
|
+
): Promise<GetUserFieldsResponse> | Observable<GetUserFieldsResponse> | GetUserFieldsResponse;
|
|
733
|
+
|
|
734
|
+
createSubscription(
|
|
735
|
+
request: SubscriptionRequest,
|
|
736
|
+
): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
|
|
737
|
+
|
|
738
|
+
deleteSubscription(
|
|
739
|
+
request: SubscriptionRequest,
|
|
740
|
+
): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
|
|
741
|
+
|
|
742
|
+
banUser(request: BanUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
743
|
+
|
|
744
|
+
unbanUser(request: UnbanUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Premium (paid). State lives in users-service; payments-service handles
|
|
748
|
+
* money and calls ActivatePremium (internal) on completion.
|
|
749
|
+
*/
|
|
750
|
+
|
|
751
|
+
getMyPremium(
|
|
752
|
+
request: GetMyPremiumRequest,
|
|
753
|
+
): Promise<PremiumStateResponse> | Observable<PremiumStateResponse> | PremiumStateResponse;
|
|
754
|
+
|
|
755
|
+
setPremiumAutoRenew(
|
|
756
|
+
request: SetPremiumAutoRenewRequest,
|
|
757
|
+
): Promise<PremiumStateResponse> | Observable<PremiumStateResponse> | PremiumStateResponse;
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Internal — InternalServiceGuard. Called by payments-service after a
|
|
761
|
+
* successful premium payment (balance or YooKassa webhook).
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
activatePremium(
|
|
765
|
+
request: ActivatePremiumRequest,
|
|
766
|
+
): Promise<PremiumStateResponse> | Observable<PremiumStateResponse> | PremiumStateResponse;
|
|
767
|
+
|
|
768
|
+
/** Internal — fast lookup for the commission engine in payments-service. */
|
|
769
|
+
|
|
770
|
+
isPremiumActive(
|
|
771
|
+
request: IsPremiumActiveRequest,
|
|
772
|
+
): Promise<IsPremiumActiveResponse> | Observable<IsPremiumActiveResponse> | IsPremiumActiveResponse;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Avatar borders (catalog + admin CRUD). Catalog read is public; mutations
|
|
776
|
+
* are admin only (gateway enforces with RolesGuard).
|
|
777
|
+
*/
|
|
778
|
+
|
|
779
|
+
listAvatarBorders(
|
|
780
|
+
request: ListAvatarBordersRequest,
|
|
781
|
+
): Promise<ListAvatarBordersResponse> | Observable<ListAvatarBordersResponse> | ListAvatarBordersResponse;
|
|
782
|
+
|
|
783
|
+
upsertAvatarBorder(
|
|
784
|
+
request: UpsertAvatarBorderRequest,
|
|
785
|
+
): Promise<AvatarBorder> | Observable<AvatarBorder> | AvatarBorder;
|
|
786
|
+
|
|
787
|
+
deleteAvatarBorder(
|
|
788
|
+
request: DeleteAvatarBorderRequest,
|
|
789
|
+
): Promise<DeleteAvatarBorderResponse> | Observable<DeleteAvatarBorderResponse> | DeleteAvatarBorderResponse;
|
|
790
|
+
|
|
791
|
+
/** Account settings — bundled write surface for the UI. */
|
|
792
|
+
|
|
793
|
+
updatePrivacy(
|
|
794
|
+
request: UpdatePrivacyRequest,
|
|
795
|
+
): Promise<PublicProfileResponse> | Observable<PublicProfileResponse> | PublicProfileResponse;
|
|
796
|
+
|
|
797
|
+
updateEmailPrefs(
|
|
798
|
+
request: UpdateEmailPrefsRequest,
|
|
799
|
+
): Promise<UpdateEmailPrefsResponse> | Observable<UpdateEmailPrefsResponse> | UpdateEmailPrefsResponse;
|
|
800
|
+
|
|
801
|
+
updateLocale(
|
|
802
|
+
request: UpdateLocaleRequest,
|
|
803
|
+
): Promise<UpdateLocaleResponse> | Observable<UpdateLocaleResponse> | UpdateLocaleResponse;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Soft-delete + restore. Internal AuthService also queries the soft-delete
|
|
807
|
+
* state on login (rejects if deletedAt set).
|
|
808
|
+
*/
|
|
809
|
+
|
|
810
|
+
softDeleteAccount(
|
|
811
|
+
request: SoftDeleteAccountRequest,
|
|
812
|
+
): Promise<SoftDeleteAccountResponse> | Observable<SoftDeleteAccountResponse> | SoftDeleteAccountResponse;
|
|
813
|
+
|
|
814
|
+
restoreAccount(request: RestoreAccountRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
815
|
+
|
|
816
|
+
/** tasks-service cron */
|
|
817
|
+
|
|
818
|
+
hardDeletePending(
|
|
819
|
+
request: HardDeletePendingRequest,
|
|
820
|
+
): Promise<HardDeletePendingResponse> | Observable<HardDeletePendingResponse> | HardDeletePendingResponse;
|
|
821
|
+
|
|
822
|
+
/** Blocks */
|
|
823
|
+
|
|
824
|
+
blockUser(request: BlockUserRequest): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
|
|
825
|
+
|
|
826
|
+
unblockUser(
|
|
827
|
+
request: BlockUserRequest,
|
|
828
|
+
): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
|
|
829
|
+
|
|
830
|
+
listBlockedUsers(
|
|
831
|
+
request: ListBlockedUsersRequest,
|
|
832
|
+
): Promise<ListBlockedUsersResponse> | Observable<ListBlockedUsersResponse> | ListBlockedUsersResponse;
|
|
833
|
+
|
|
834
|
+
/** internal lookup */
|
|
835
|
+
|
|
836
|
+
isBlocked(request: IsBlockedRequest): Promise<IsBlockedResponse> | Observable<IsBlockedResponse> | IsBlockedResponse;
|
|
837
|
+
|
|
838
|
+
/** Data export */
|
|
839
|
+
|
|
840
|
+
requestDataExport(
|
|
841
|
+
request: RequestDataExportRequest,
|
|
842
|
+
): Promise<DataExportRequestRow> | Observable<DataExportRequestRow> | DataExportRequestRow;
|
|
843
|
+
|
|
844
|
+
listDataExports(
|
|
845
|
+
request: ListDataExportsRequest,
|
|
846
|
+
): Promise<ListDataExportsResponse> | Observable<ListDataExportsResponse> | ListDataExportsResponse;
|
|
847
|
+
|
|
848
|
+
/** tasks-service */
|
|
849
|
+
|
|
850
|
+
pickPendingDataExport(
|
|
851
|
+
request: PickPendingDataExportRequest,
|
|
852
|
+
): Promise<DataExportRequestRow> | Observable<DataExportRequestRow> | DataExportRequestRow;
|
|
853
|
+
|
|
854
|
+
/** tasks-service */
|
|
855
|
+
|
|
856
|
+
completeDataExport(
|
|
857
|
+
request: CompleteDataExportRequest,
|
|
858
|
+
): Promise<DataExportRequestRow> | Observable<DataExportRequestRow> | DataExportRequestRow;
|
|
859
|
+
|
|
860
|
+
/** tasks-service */
|
|
861
|
+
|
|
862
|
+
collectUserExportData(
|
|
863
|
+
request: CollectUserExportDataRequest,
|
|
864
|
+
): Promise<CollectUserExportDataResponse> | Observable<CollectUserExportDataResponse> | CollectUserExportDataResponse;
|
|
865
|
+
|
|
866
|
+
/** Unified read for the settings page */
|
|
867
|
+
|
|
868
|
+
getAccountSettings(
|
|
869
|
+
request: GetAccountSettingsRequest,
|
|
870
|
+
): Promise<AccountSettingsResponse> | Observable<AccountSettingsResponse> | AccountSettingsResponse;
|
|
871
|
+
|
|
872
|
+
/** Password — separate from generic createCode/verifyCode reset flow. */
|
|
873
|
+
|
|
874
|
+
changePassword(request: ChangePasswordRequest): Promise<Ok> | Observable<Ok> | Ok;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
export function UsersServiceControllerMethods() {
|
|
878
|
+
return function (constructor: Function) {
|
|
879
|
+
const grpcMethods: string[] = [
|
|
880
|
+
"getPublicProfile",
|
|
881
|
+
"updateProfile",
|
|
882
|
+
"updateUser",
|
|
883
|
+
"updateUserRole",
|
|
884
|
+
"getUsers",
|
|
885
|
+
"getActiveDevices",
|
|
886
|
+
"manageDevices",
|
|
887
|
+
"getUserFields",
|
|
888
|
+
"createSubscription",
|
|
889
|
+
"deleteSubscription",
|
|
890
|
+
"banUser",
|
|
891
|
+
"unbanUser",
|
|
892
|
+
"getMyPremium",
|
|
893
|
+
"setPremiumAutoRenew",
|
|
894
|
+
"activatePremium",
|
|
895
|
+
"isPremiumActive",
|
|
896
|
+
"listAvatarBorders",
|
|
897
|
+
"upsertAvatarBorder",
|
|
898
|
+
"deleteAvatarBorder",
|
|
899
|
+
"updatePrivacy",
|
|
900
|
+
"updateEmailPrefs",
|
|
901
|
+
"updateLocale",
|
|
902
|
+
"softDeleteAccount",
|
|
903
|
+
"restoreAccount",
|
|
904
|
+
"hardDeletePending",
|
|
905
|
+
"blockUser",
|
|
906
|
+
"unblockUser",
|
|
907
|
+
"listBlockedUsers",
|
|
908
|
+
"isBlocked",
|
|
909
|
+
"requestDataExport",
|
|
910
|
+
"listDataExports",
|
|
911
|
+
"pickPendingDataExport",
|
|
912
|
+
"completeDataExport",
|
|
913
|
+
"collectUserExportData",
|
|
914
|
+
"getAccountSettings",
|
|
915
|
+
"changePassword",
|
|
916
|
+
];
|
|
917
|
+
for (const method of grpcMethods) {
|
|
918
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
919
|
+
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
920
|
+
}
|
|
921
|
+
const grpcStreamMethods: string[] = [];
|
|
922
|
+
for (const method of grpcStreamMethods) {
|
|
923
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
924
|
+
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
export const USERS_SERVICE_NAME = "UsersService";
|