@aepstore-dev/contracts 1.32.0 → 1.33.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/payments.ts +175 -0
- package/gen/users.ts +201 -0
- package/package.json +1 -1
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +126 -126
- package/proto/mail.proto +42 -42
- package/proto/payments.proto +303 -203
- package/proto/products.proto +404 -404
- package/proto/support.proto +118 -118
- package/proto/taxonomy.proto +105 -105
- package/proto/upload.proto +171 -171
- package/proto/users.proto +411 -286
package/proto/users.proto
CHANGED
|
@@ -1,286 +1,411 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package users.v1;
|
|
4
|
-
|
|
5
|
-
service UsersService {
|
|
6
|
-
rpc GetPublicProfile(GetPublicProfileRequest) returns (PublicProfileResponse);
|
|
7
|
-
rpc UpdateProfile(UpdateProfileRequest) returns (PublicProfileResponse);
|
|
8
|
-
rpc UpdateUser(UpdateUserRequest) returns (UserResponse);
|
|
9
|
-
rpc UpdateUserRole(UpdateUserRoleRequest) returns (UserResponse);
|
|
10
|
-
rpc GetUsers(GetUsersRequest) returns (GetUsersResponse);
|
|
11
|
-
rpc GetActiveDevices(GetActiveDevicesRequest) returns (GetActiveDevicesResponse);
|
|
12
|
-
rpc ManageDevices(ManageDevicesRequest) returns (ManageDevicesResponse);
|
|
13
|
-
rpc GetUserFields(GetUserFieldsRequest) returns (GetUserFieldsResponse);
|
|
14
|
-
|
|
15
|
-
rpc CreateSubscription(SubscriptionRequest) returns (SubscriptionResponse);
|
|
16
|
-
rpc DeleteSubscription(SubscriptionRequest) returns (SubscriptionResponse);
|
|
17
|
-
|
|
18
|
-
rpc BanUser(BanUserRequest) returns (UserResponse);
|
|
19
|
-
rpc UnbanUser(UnbanUserRequest) returns (UserResponse);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
string
|
|
44
|
-
string
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
string
|
|
49
|
-
string
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
string
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
string
|
|
60
|
-
string
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
string
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
string
|
|
71
|
-
string
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
string
|
|
77
|
-
string
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
message
|
|
81
|
-
string
|
|
82
|
-
string
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
string
|
|
87
|
-
|
|
88
|
-
string
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
string
|
|
100
|
-
string
|
|
101
|
-
string
|
|
102
|
-
string
|
|
103
|
-
|
|
104
|
-
string
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
message
|
|
124
|
-
string id = 1;
|
|
125
|
-
string
|
|
126
|
-
string
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
string
|
|
141
|
-
string
|
|
142
|
-
string
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
string
|
|
151
|
-
string
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
string
|
|
167
|
-
string
|
|
168
|
-
string
|
|
169
|
-
bool
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
string
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
string
|
|
199
|
-
string
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
// =================================================================
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
message
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
repeated
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package users.v1;
|
|
4
|
+
|
|
5
|
+
service UsersService {
|
|
6
|
+
rpc GetPublicProfile(GetPublicProfileRequest) returns (PublicProfileResponse);
|
|
7
|
+
rpc UpdateProfile(UpdateProfileRequest) returns (PublicProfileResponse);
|
|
8
|
+
rpc UpdateUser(UpdateUserRequest) returns (UserResponse);
|
|
9
|
+
rpc UpdateUserRole(UpdateUserRoleRequest) returns (UserResponse);
|
|
10
|
+
rpc GetUsers(GetUsersRequest) returns (GetUsersResponse);
|
|
11
|
+
rpc GetActiveDevices(GetActiveDevicesRequest) returns (GetActiveDevicesResponse);
|
|
12
|
+
rpc ManageDevices(ManageDevicesRequest) returns (ManageDevicesResponse);
|
|
13
|
+
rpc GetUserFields(GetUserFieldsRequest) returns (GetUserFieldsResponse);
|
|
14
|
+
|
|
15
|
+
rpc CreateSubscription(SubscriptionRequest) returns (SubscriptionResponse);
|
|
16
|
+
rpc DeleteSubscription(SubscriptionRequest) returns (SubscriptionResponse);
|
|
17
|
+
|
|
18
|
+
rpc BanUser(BanUserRequest) returns (UserResponse);
|
|
19
|
+
rpc UnbanUser(UnbanUserRequest) returns (UserResponse);
|
|
20
|
+
|
|
21
|
+
// Premium (paid). State lives in users-service; payments-service handles
|
|
22
|
+
// money and calls ActivatePremium (internal) on completion.
|
|
23
|
+
rpc GetMyPremium(GetMyPremiumRequest) returns (PremiumStateResponse);
|
|
24
|
+
rpc SetPremiumAutoRenew(SetPremiumAutoRenewRequest) returns (PremiumStateResponse);
|
|
25
|
+
// Internal — InternalServiceGuard. Called by payments-service after a
|
|
26
|
+
// successful premium payment (balance or YooKassa webhook).
|
|
27
|
+
rpc ActivatePremium(ActivatePremiumRequest) returns (PremiumStateResponse);
|
|
28
|
+
// Internal — fast lookup for the commission engine in payments-service.
|
|
29
|
+
rpc IsPremiumActive(IsPremiumActiveRequest) returns (IsPremiumActiveResponse);
|
|
30
|
+
|
|
31
|
+
// Avatar borders (catalog + admin CRUD). Catalog read is public; mutations
|
|
32
|
+
// are admin only (gateway enforces with RolesGuard).
|
|
33
|
+
rpc ListAvatarBorders(ListAvatarBordersRequest) returns (ListAvatarBordersResponse);
|
|
34
|
+
rpc UpsertAvatarBorder(UpsertAvatarBorderRequest) returns (AvatarBorder);
|
|
35
|
+
rpc DeleteAvatarBorder(DeleteAvatarBorderRequest) returns (DeleteAvatarBorderResponse);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// =================================================================
|
|
39
|
+
// Common types
|
|
40
|
+
// =================================================================
|
|
41
|
+
|
|
42
|
+
message User {
|
|
43
|
+
string id = 1;
|
|
44
|
+
string email = 2;
|
|
45
|
+
string username = 3;
|
|
46
|
+
string avatar_url = 4;
|
|
47
|
+
repeated string roles = 5;
|
|
48
|
+
string role = 6; // primary role for backwards compat
|
|
49
|
+
string created_at = 7; // ISO 8601
|
|
50
|
+
string updated_at = 8;
|
|
51
|
+
bool is_banned = 9;
|
|
52
|
+
string banned_until = 10; // ISO 8601, empty = permanent/none
|
|
53
|
+
string ban_reason = 11;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message BanUserRequest {
|
|
57
|
+
string admin_id = 1;
|
|
58
|
+
string user_id = 2;
|
|
59
|
+
string reason = 3;
|
|
60
|
+
string until = 4; // ISO 8601; empty = permanent ban
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message UnbanUserRequest {
|
|
64
|
+
string admin_id = 1;
|
|
65
|
+
string user_id = 2;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message Country {
|
|
69
|
+
string id = 1;
|
|
70
|
+
string code = 2;
|
|
71
|
+
string name = 3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message SocialMedia {
|
|
75
|
+
string id = 1;
|
|
76
|
+
string platform = 2;
|
|
77
|
+
string url = 3;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message CreateSocialMedia {
|
|
81
|
+
string platform = 1;
|
|
82
|
+
string url = 2;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message ProductUser {
|
|
86
|
+
string id = 1;
|
|
87
|
+
string username = 2;
|
|
88
|
+
string avatar_url = 3;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message Category {
|
|
92
|
+
string id = 1;
|
|
93
|
+
string name = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message Product {
|
|
97
|
+
string id = 1;
|
|
98
|
+
string name = 2;
|
|
99
|
+
string description = 3;
|
|
100
|
+
string price = 4; // Decimal as string (D7)
|
|
101
|
+
string created_at = 5;
|
|
102
|
+
string updated_at = 6;
|
|
103
|
+
// profile-card preview fields
|
|
104
|
+
string preview = 7;
|
|
105
|
+
string final_price = 8; // Decimal as string
|
|
106
|
+
string average_rating = 9; // number as string
|
|
107
|
+
string status = 10;
|
|
108
|
+
// Author of the product (same person as the profile owner, but echoed per
|
|
109
|
+
// product so cards can render the author independently).
|
|
110
|
+
ProductUser user = 11;
|
|
111
|
+
repeated Category categories = 12;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message Video {
|
|
115
|
+
string id = 1;
|
|
116
|
+
string title = 2;
|
|
117
|
+
string description = 3;
|
|
118
|
+
string url = 4;
|
|
119
|
+
string created_at = 5;
|
|
120
|
+
string updated_at = 6;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message ActiveDevice {
|
|
124
|
+
string id = 1;
|
|
125
|
+
string user_agent = 2;
|
|
126
|
+
string ip = 3;
|
|
127
|
+
string created_at = 4;
|
|
128
|
+
string last_used_at = 5;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message ProfileStats {
|
|
132
|
+
int32 subscribers_count = 1;
|
|
133
|
+
int32 subscriptions_count = 2;
|
|
134
|
+
int32 products_count = 3;
|
|
135
|
+
int32 videos_count = 4;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Compact public user card for subscriber/subscription lists — no email/ban data.
|
|
139
|
+
message ProfileUser {
|
|
140
|
+
string id = 1;
|
|
141
|
+
string username = 2;
|
|
142
|
+
string avatar_url = 3;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// =================================================================
|
|
146
|
+
// GetPublicProfile
|
|
147
|
+
// =================================================================
|
|
148
|
+
|
|
149
|
+
message GetPublicProfileRequest {
|
|
150
|
+
string username = 1;
|
|
151
|
+
string viewer_user_id = 2; // optional — present when caller is authenticated
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message PublicProfileResponse {
|
|
155
|
+
string id = 1;
|
|
156
|
+
string username = 2;
|
|
157
|
+
string full_name = 3;
|
|
158
|
+
string rating = 4; // Decimal as string
|
|
159
|
+
string about_me = 5;
|
|
160
|
+
repeated SocialMedia social_media = 6;
|
|
161
|
+
ProfileStats stats = 7;
|
|
162
|
+
repeated Video videos = 8;
|
|
163
|
+
repeated Product products = 9;
|
|
164
|
+
Country country = 10;
|
|
165
|
+
string avatar_url = 11;
|
|
166
|
+
string banner_url = 12;
|
|
167
|
+
string role = 13;
|
|
168
|
+
string created_at = 14;
|
|
169
|
+
bool hide_subscriptions = 15;
|
|
170
|
+
// Either populated lists or empty depending on hide_subscriptions
|
|
171
|
+
repeated ProfileUser subscriptions = 16;
|
|
172
|
+
repeated ProfileUser subscribers = 17;
|
|
173
|
+
bool is_owner = 18;
|
|
174
|
+
bool is_subscribed = 19; // viewer is subscribed to this profile (false when anonymous / self)
|
|
175
|
+
// Premium fields — populated only when the profile owner has an active
|
|
176
|
+
// PremiumSubscription. Non-premium viewers and non-premium profiles see
|
|
177
|
+
// empty strings / false.
|
|
178
|
+
bool is_premium = 20;
|
|
179
|
+
string profile_color = 21;
|
|
180
|
+
AvatarBorder avatar_border = 22;
|
|
181
|
+
string animated_avatar_url = 23;
|
|
182
|
+
string animated_banner_url = 24;
|
|
183
|
+
string premium_expires_at = 25; // ISO 8601, empty when not premium
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// =================================================================
|
|
187
|
+
// UpdateProfile
|
|
188
|
+
// =================================================================
|
|
189
|
+
|
|
190
|
+
message UpdateProfileRequest {
|
|
191
|
+
string user_id = 1;
|
|
192
|
+
string full_name = 2;
|
|
193
|
+
string about_me = 3;
|
|
194
|
+
bool newsletter_subscription = 4;
|
|
195
|
+
bool hide_subscriptions = 5;
|
|
196
|
+
string avatar_url = 6;
|
|
197
|
+
string banner_url = 7;
|
|
198
|
+
string country_id = 8;
|
|
199
|
+
string timezone = 9;
|
|
200
|
+
repeated CreateSocialMedia social_media = 10;
|
|
201
|
+
// Premium-only fields — rejected with FAILED_PRECONDITION when the caller
|
|
202
|
+
// has no active premium. Empty string clears the value.
|
|
203
|
+
string profile_color = 11;
|
|
204
|
+
string avatar_border_id = 12;
|
|
205
|
+
string animated_avatar_url = 13;
|
|
206
|
+
string animated_banner_url = 14;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// =================================================================
|
|
210
|
+
// UpdateUser
|
|
211
|
+
// =================================================================
|
|
212
|
+
|
|
213
|
+
message UpdateUserRequest {
|
|
214
|
+
string user_id = 1;
|
|
215
|
+
string username = 2;
|
|
216
|
+
string email = 3;
|
|
217
|
+
string code = 4; // confirmation code when changing email/username
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
message UserResponse {
|
|
221
|
+
User user = 1;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// =================================================================
|
|
225
|
+
// UpdateUserRole (admin)
|
|
226
|
+
// =================================================================
|
|
227
|
+
|
|
228
|
+
message UpdateUserRoleRequest {
|
|
229
|
+
string admin_id = 1;
|
|
230
|
+
string user_id = 2;
|
|
231
|
+
string role = 3;
|
|
232
|
+
string action = 4; // "grant" (default) | "revoke"
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// =================================================================
|
|
236
|
+
// GetUsers (paginated)
|
|
237
|
+
// =================================================================
|
|
238
|
+
|
|
239
|
+
message GetUsersRequest {
|
|
240
|
+
string page = 1;
|
|
241
|
+
string limit = 2;
|
|
242
|
+
string search = 3;
|
|
243
|
+
string role_name = 4;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
message GetUsersResponse {
|
|
247
|
+
repeated User items = 1;
|
|
248
|
+
int32 total = 2;
|
|
249
|
+
int32 page = 3;
|
|
250
|
+
int32 limit = 4;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// =================================================================
|
|
254
|
+
// Active devices
|
|
255
|
+
// =================================================================
|
|
256
|
+
|
|
257
|
+
message GetActiveDevicesRequest {
|
|
258
|
+
string user_id = 1;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
message GetActiveDevicesResponse {
|
|
262
|
+
repeated ActiveDevice devices = 1;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
message ManageDevicesRequest {
|
|
266
|
+
string user_id = 1;
|
|
267
|
+
repeated string device_ids_to_remove = 2;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
message ManageDevicesResponse {
|
|
271
|
+
bool ok = 1;
|
|
272
|
+
int32 removed_count = 2;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// =================================================================
|
|
276
|
+
// GetUserFields — paginated dynamic field sets
|
|
277
|
+
// =================================================================
|
|
278
|
+
|
|
279
|
+
enum UserFieldsType {
|
|
280
|
+
USER_FIELDS_TYPE_UNSPECIFIED = 0;
|
|
281
|
+
USER_FIELDS_TYPE_VIDEOS = 1;
|
|
282
|
+
USER_FIELDS_TYPE_PRODUCTS = 2;
|
|
283
|
+
USER_FIELDS_TYPE_SUBSCRIPTIONS = 3;
|
|
284
|
+
USER_FIELDS_TYPE_SUBSCRIBERS = 4;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
message GetUserFieldsRequest {
|
|
288
|
+
string username = 1;
|
|
289
|
+
UserFieldsType type = 2;
|
|
290
|
+
int32 page = 3;
|
|
291
|
+
int32 limit = 4;
|
|
292
|
+
string viewer_user_id = 5; // optional
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
message GetUserFieldsResponse {
|
|
296
|
+
repeated Video videos = 1;
|
|
297
|
+
repeated Product products = 2;
|
|
298
|
+
repeated ProfileUser subscriptions = 3;
|
|
299
|
+
repeated ProfileUser subscribers = 4;
|
|
300
|
+
int32 total = 5;
|
|
301
|
+
int32 page = 6;
|
|
302
|
+
int32 limit = 7;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// =================================================================
|
|
306
|
+
// Subscriptions
|
|
307
|
+
// =================================================================
|
|
308
|
+
|
|
309
|
+
message SubscriptionRequest {
|
|
310
|
+
string subscriber_id = 1; // the authenticated user performing the action
|
|
311
|
+
string target_id = 2; // the user being (un)subscribed to/from
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message SubscriptionResponse {
|
|
315
|
+
bool subscribed = 1; // state after the call
|
|
316
|
+
int32 subscribers_count = 2; // target's subscriber count after the call
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// =================================================================
|
|
320
|
+
// Premium
|
|
321
|
+
// =================================================================
|
|
322
|
+
|
|
323
|
+
// Periods mirror PremiumPeriod enum in schema.prisma.
|
|
324
|
+
enum PremiumPeriod {
|
|
325
|
+
PREMIUM_PERIOD_UNSPECIFIED = 0;
|
|
326
|
+
PREMIUM_PERIOD_MONTH_1 = 1;
|
|
327
|
+
PREMIUM_PERIOD_MONTH_3 = 2;
|
|
328
|
+
PREMIUM_PERIOD_MONTH_6 = 3;
|
|
329
|
+
PREMIUM_PERIOD_MONTH_12 = 4;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
message GetMyPremiumRequest {
|
|
333
|
+
string user_id = 1;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
message PremiumStateResponse {
|
|
337
|
+
bool is_active = 1;
|
|
338
|
+
string status = 2; // ACTIVE | EXPIRED | CANCELED | empty (never purchased)
|
|
339
|
+
PremiumPeriod current_period = 3;
|
|
340
|
+
string started_at = 4; // ISO 8601, empty when never purchased
|
|
341
|
+
string expires_at = 5; // ISO 8601
|
|
342
|
+
bool auto_renew = 6;
|
|
343
|
+
bool has_saved_payment_method = 7;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message SetPremiumAutoRenewRequest {
|
|
347
|
+
string user_id = 1;
|
|
348
|
+
bool enabled = 2;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Internal — payments-service hands us the period that was just paid for, plus
|
|
352
|
+
// the YooKassa payment_method id (empty for balance/non-recurring purchases).
|
|
353
|
+
message ActivatePremiumRequest {
|
|
354
|
+
string user_id = 1;
|
|
355
|
+
PremiumPeriod period = 2;
|
|
356
|
+
string payment_method_id = 3; // empty for BALANCE / one-shot
|
|
357
|
+
bool is_renewal = 4; // false = first purchase; true = cron-driven renewal
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
message IsPremiumActiveRequest {
|
|
361
|
+
string user_id = 1;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
message IsPremiumActiveResponse {
|
|
365
|
+
bool is_active = 1;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// =================================================================
|
|
369
|
+
// Avatar borders
|
|
370
|
+
// =================================================================
|
|
371
|
+
|
|
372
|
+
message AvatarBorder {
|
|
373
|
+
string id = 1;
|
|
374
|
+
string code = 2;
|
|
375
|
+
string name = 3;
|
|
376
|
+
string description = 4;
|
|
377
|
+
string image_url = 5;
|
|
378
|
+
bool is_animated = 6;
|
|
379
|
+
string source = 7;
|
|
380
|
+
int32 sort_order = 8;
|
|
381
|
+
bool is_active = 9;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
message ListAvatarBordersRequest {
|
|
385
|
+
bool include_inactive = 1; // admin-only — gateway gates by role
|
|
386
|
+
string source = 2; // optional filter
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
message ListAvatarBordersResponse {
|
|
390
|
+
repeated AvatarBorder items = 1;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
message UpsertAvatarBorderRequest {
|
|
394
|
+
string id = 1; // empty = create
|
|
395
|
+
string code = 2; // required when creating
|
|
396
|
+
string name = 3;
|
|
397
|
+
string description = 4;
|
|
398
|
+
string image_url = 5;
|
|
399
|
+
bool is_animated = 6;
|
|
400
|
+
string source = 7;
|
|
401
|
+
int32 sort_order = 8;
|
|
402
|
+
bool is_active = 9;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
message DeleteAvatarBorderRequest {
|
|
406
|
+
string id = 1;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message DeleteAvatarBorderResponse {
|
|
410
|
+
bool ok = 1;
|
|
411
|
+
}
|