@aepstore-dev/contracts 1.18.1 → 1.20.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/proto/users.proto CHANGED
@@ -1,263 +1,278 @@
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
- // Common types
24
- // =================================================================
25
-
26
- message User {
27
- string id = 1;
28
- string email = 2;
29
- string username = 3;
30
- string avatar_url = 4;
31
- repeated string roles = 5;
32
- string role = 6; // primary role for backwards compat
33
- string created_at = 7; // ISO 8601
34
- string updated_at = 8;
35
- bool is_banned = 9;
36
- string banned_until = 10; // ISO 8601, empty = permanent/none
37
- string ban_reason = 11;
38
- }
39
-
40
- message BanUserRequest {
41
- string admin_id = 1;
42
- string user_id = 2;
43
- string reason = 3;
44
- string until = 4; // ISO 8601; empty = permanent ban
45
- }
46
-
47
- message UnbanUserRequest {
48
- string admin_id = 1;
49
- string user_id = 2;
50
- }
51
-
52
- message Country {
53
- string id = 1;
54
- string code = 2;
55
- string name = 3;
56
- }
57
-
58
- message SocialMedia {
59
- string id = 1;
60
- string platform = 2;
61
- string url = 3;
62
- }
63
-
64
- message CreateSocialMedia {
65
- string platform = 1;
66
- string url = 2;
67
- }
68
-
69
- message Product {
70
- string id = 1;
71
- string name = 2;
72
- string description = 3;
73
- string price = 4; // Decimal as string (D7)
74
- string created_at = 5;
75
- string updated_at = 6;
76
- // profile-card preview fields
77
- string preview = 7;
78
- string final_price = 8; // Decimal as string
79
- string average_rating = 9; // number as string
80
- string status = 10;
81
- }
82
-
83
- message Video {
84
- string id = 1;
85
- string title = 2;
86
- string description = 3;
87
- string url = 4;
88
- string created_at = 5;
89
- string updated_at = 6;
90
- }
91
-
92
- message ActiveDevice {
93
- string id = 1;
94
- string user_agent = 2;
95
- string ip = 3;
96
- string created_at = 4;
97
- string last_used_at = 5;
98
- }
99
-
100
- message ProfileStats {
101
- int32 subscribers_count = 1;
102
- int32 subscriptions_count = 2;
103
- int32 products_count = 3;
104
- int32 videos_count = 4;
105
- }
106
-
107
- // =================================================================
108
- // GetPublicProfile
109
- // =================================================================
110
-
111
- message GetPublicProfileRequest {
112
- string username = 1;
113
- string viewer_user_id = 2; // optional — present when caller is authenticated
114
- }
115
-
116
- message PublicProfileResponse {
117
- string id = 1;
118
- string username = 2;
119
- string full_name = 3;
120
- string rating = 4; // Decimal as string
121
- string about_me = 5;
122
- repeated SocialMedia social_media = 6;
123
- ProfileStats stats = 7;
124
- repeated Video videos = 8;
125
- repeated Product products = 9;
126
- Country country = 10;
127
- string avatar_url = 11;
128
- string banner_url = 12;
129
- string role = 13;
130
- string created_at = 14;
131
- bool hide_subscriptions = 15;
132
- // Either populated lists or empty depending on hide_subscriptions
133
- repeated User subscriptions = 16;
134
- repeated User subscribers = 17;
135
- bool is_owner = 18;
136
- }
137
-
138
- // =================================================================
139
- // UpdateProfile
140
- // =================================================================
141
-
142
- message UpdateProfileRequest {
143
- string user_id = 1;
144
- string full_name = 2;
145
- string about_me = 3;
146
- bool newsletter_subscription = 4;
147
- bool hide_subscriptions = 5;
148
- string avatar_url = 6;
149
- string banner_url = 7;
150
- string country_id = 8;
151
- string timezone = 9;
152
- repeated CreateSocialMedia social_media = 10;
153
- }
154
-
155
- // =================================================================
156
- // UpdateUser
157
- // =================================================================
158
-
159
- message UpdateUserRequest {
160
- string user_id = 1;
161
- string username = 2;
162
- string email = 3;
163
- string code = 4; // confirmation code when changing email/username
164
- }
165
-
166
- message UserResponse {
167
- User user = 1;
168
- }
169
-
170
- // =================================================================
171
- // UpdateUserRole (admin)
172
- // =================================================================
173
-
174
- message UpdateUserRoleRequest {
175
- string admin_id = 1;
176
- string user_id = 2;
177
- string role = 3;
178
- string action = 4; // "grant" (default) | "revoke"
179
- }
180
-
181
- // =================================================================
182
- // GetUsers (paginated)
183
- // =================================================================
184
-
185
- message GetUsersRequest {
186
- string page = 1;
187
- string limit = 2;
188
- string search = 3;
189
- string role_name = 4;
190
- }
191
-
192
- message GetUsersResponse {
193
- repeated User items = 1;
194
- int32 total = 2;
195
- int32 page = 3;
196
- int32 limit = 4;
197
- }
198
-
199
- // =================================================================
200
- // Active devices
201
- // =================================================================
202
-
203
- message GetActiveDevicesRequest {
204
- string user_id = 1;
205
- }
206
-
207
- message GetActiveDevicesResponse {
208
- repeated ActiveDevice devices = 1;
209
- }
210
-
211
- message ManageDevicesRequest {
212
- string user_id = 1;
213
- repeated string device_ids_to_remove = 2;
214
- }
215
-
216
- message ManageDevicesResponse {
217
- bool ok = 1;
218
- int32 removed_count = 2;
219
- }
220
-
221
- // =================================================================
222
- // GetUserFields — paginated dynamic field sets
223
- // =================================================================
224
-
225
- enum UserFieldsType {
226
- USER_FIELDS_TYPE_UNSPECIFIED = 0;
227
- USER_FIELDS_TYPE_VIDEOS = 1;
228
- USER_FIELDS_TYPE_PRODUCTS = 2;
229
- USER_FIELDS_TYPE_SUBSCRIPTIONS = 3;
230
- USER_FIELDS_TYPE_SUBSCRIBERS = 4;
231
- }
232
-
233
- message GetUserFieldsRequest {
234
- string username = 1;
235
- UserFieldsType type = 2;
236
- int32 page = 3;
237
- int32 limit = 4;
238
- string viewer_user_id = 5; // optional
239
- }
240
-
241
- message GetUserFieldsResponse {
242
- repeated Video videos = 1;
243
- repeated Product products = 2;
244
- repeated User subscriptions = 3;
245
- repeated User subscribers = 4;
246
- int32 total = 5;
247
- int32 page = 6;
248
- int32 limit = 7;
249
- }
250
-
251
- // =================================================================
252
- // Subscriptions
253
- // =================================================================
254
-
255
- message SubscriptionRequest {
256
- string subscriber_id = 1; // the authenticated user performing the action
257
- string target_id = 2; // the user being (un)subscribed to/from
258
- }
259
-
260
- message SubscriptionResponse {
261
- bool subscribed = 1; // state after the call
262
- int32 subscribers_count = 2; // target's subscriber count after the call
263
- }
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
+ // Common types
24
+ // =================================================================
25
+
26
+ message User {
27
+ string id = 1;
28
+ string email = 2;
29
+ string username = 3;
30
+ string avatar_url = 4;
31
+ repeated string roles = 5;
32
+ string role = 6; // primary role for backwards compat
33
+ string created_at = 7; // ISO 8601
34
+ string updated_at = 8;
35
+ bool is_banned = 9;
36
+ string banned_until = 10; // ISO 8601, empty = permanent/none
37
+ string ban_reason = 11;
38
+ }
39
+
40
+ message BanUserRequest {
41
+ string admin_id = 1;
42
+ string user_id = 2;
43
+ string reason = 3;
44
+ string until = 4; // ISO 8601; empty = permanent ban
45
+ }
46
+
47
+ message UnbanUserRequest {
48
+ string admin_id = 1;
49
+ string user_id = 2;
50
+ }
51
+
52
+ message Country {
53
+ string id = 1;
54
+ string code = 2;
55
+ string name = 3;
56
+ }
57
+
58
+ message SocialMedia {
59
+ string id = 1;
60
+ string platform = 2;
61
+ string url = 3;
62
+ }
63
+
64
+ message CreateSocialMedia {
65
+ string platform = 1;
66
+ string url = 2;
67
+ }
68
+
69
+ message ProductUser {
70
+ string id = 1;
71
+ string username = 2;
72
+ string avatar_url = 3;
73
+ }
74
+
75
+ message Category {
76
+ string id = 1;
77
+ string name = 2;
78
+ }
79
+
80
+ message Product {
81
+ string id = 1;
82
+ string name = 2;
83
+ string description = 3;
84
+ string price = 4; // Decimal as string (D7)
85
+ string created_at = 5;
86
+ string updated_at = 6;
87
+ // profile-card preview fields
88
+ string preview = 7;
89
+ string final_price = 8; // Decimal as string
90
+ string average_rating = 9; // number as string
91
+ string status = 10;
92
+ // Author of the product (same person as the profile owner, but echoed per
93
+ // product so cards can render the author independently).
94
+ ProductUser user = 11;
95
+ repeated Category categories = 12;
96
+ }
97
+
98
+ message Video {
99
+ string id = 1;
100
+ string title = 2;
101
+ string description = 3;
102
+ string url = 4;
103
+ string created_at = 5;
104
+ string updated_at = 6;
105
+ }
106
+
107
+ message ActiveDevice {
108
+ string id = 1;
109
+ string user_agent = 2;
110
+ string ip = 3;
111
+ string created_at = 4;
112
+ string last_used_at = 5;
113
+ }
114
+
115
+ message ProfileStats {
116
+ int32 subscribers_count = 1;
117
+ int32 subscriptions_count = 2;
118
+ int32 products_count = 3;
119
+ int32 videos_count = 4;
120
+ }
121
+
122
+ // =================================================================
123
+ // GetPublicProfile
124
+ // =================================================================
125
+
126
+ message GetPublicProfileRequest {
127
+ string username = 1;
128
+ string viewer_user_id = 2; // optional — present when caller is authenticated
129
+ }
130
+
131
+ message PublicProfileResponse {
132
+ string id = 1;
133
+ string username = 2;
134
+ string full_name = 3;
135
+ string rating = 4; // Decimal as string
136
+ string about_me = 5;
137
+ repeated SocialMedia social_media = 6;
138
+ ProfileStats stats = 7;
139
+ repeated Video videos = 8;
140
+ repeated Product products = 9;
141
+ Country country = 10;
142
+ string avatar_url = 11;
143
+ string banner_url = 12;
144
+ string role = 13;
145
+ string created_at = 14;
146
+ bool hide_subscriptions = 15;
147
+ // Either populated lists or empty depending on hide_subscriptions
148
+ repeated User subscriptions = 16;
149
+ repeated User subscribers = 17;
150
+ bool is_owner = 18;
151
+ }
152
+
153
+ // =================================================================
154
+ // UpdateProfile
155
+ // =================================================================
156
+
157
+ message UpdateProfileRequest {
158
+ string user_id = 1;
159
+ string full_name = 2;
160
+ string about_me = 3;
161
+ bool newsletter_subscription = 4;
162
+ bool hide_subscriptions = 5;
163
+ string avatar_url = 6;
164
+ string banner_url = 7;
165
+ string country_id = 8;
166
+ string timezone = 9;
167
+ repeated CreateSocialMedia social_media = 10;
168
+ }
169
+
170
+ // =================================================================
171
+ // UpdateUser
172
+ // =================================================================
173
+
174
+ message UpdateUserRequest {
175
+ string user_id = 1;
176
+ string username = 2;
177
+ string email = 3;
178
+ string code = 4; // confirmation code when changing email/username
179
+ }
180
+
181
+ message UserResponse {
182
+ User user = 1;
183
+ }
184
+
185
+ // =================================================================
186
+ // UpdateUserRole (admin)
187
+ // =================================================================
188
+
189
+ message UpdateUserRoleRequest {
190
+ string admin_id = 1;
191
+ string user_id = 2;
192
+ string role = 3;
193
+ string action = 4; // "grant" (default) | "revoke"
194
+ }
195
+
196
+ // =================================================================
197
+ // GetUsers (paginated)
198
+ // =================================================================
199
+
200
+ message GetUsersRequest {
201
+ string page = 1;
202
+ string limit = 2;
203
+ string search = 3;
204
+ string role_name = 4;
205
+ }
206
+
207
+ message GetUsersResponse {
208
+ repeated User items = 1;
209
+ int32 total = 2;
210
+ int32 page = 3;
211
+ int32 limit = 4;
212
+ }
213
+
214
+ // =================================================================
215
+ // Active devices
216
+ // =================================================================
217
+
218
+ message GetActiveDevicesRequest {
219
+ string user_id = 1;
220
+ }
221
+
222
+ message GetActiveDevicesResponse {
223
+ repeated ActiveDevice devices = 1;
224
+ }
225
+
226
+ message ManageDevicesRequest {
227
+ string user_id = 1;
228
+ repeated string device_ids_to_remove = 2;
229
+ }
230
+
231
+ message ManageDevicesResponse {
232
+ bool ok = 1;
233
+ int32 removed_count = 2;
234
+ }
235
+
236
+ // =================================================================
237
+ // GetUserFields paginated dynamic field sets
238
+ // =================================================================
239
+
240
+ enum UserFieldsType {
241
+ USER_FIELDS_TYPE_UNSPECIFIED = 0;
242
+ USER_FIELDS_TYPE_VIDEOS = 1;
243
+ USER_FIELDS_TYPE_PRODUCTS = 2;
244
+ USER_FIELDS_TYPE_SUBSCRIPTIONS = 3;
245
+ USER_FIELDS_TYPE_SUBSCRIBERS = 4;
246
+ }
247
+
248
+ message GetUserFieldsRequest {
249
+ string username = 1;
250
+ UserFieldsType type = 2;
251
+ int32 page = 3;
252
+ int32 limit = 4;
253
+ string viewer_user_id = 5; // optional
254
+ }
255
+
256
+ message GetUserFieldsResponse {
257
+ repeated Video videos = 1;
258
+ repeated Product products = 2;
259
+ repeated User subscriptions = 3;
260
+ repeated User subscribers = 4;
261
+ int32 total = 5;
262
+ int32 page = 6;
263
+ int32 limit = 7;
264
+ }
265
+
266
+ // =================================================================
267
+ // Subscriptions
268
+ // =================================================================
269
+
270
+ message SubscriptionRequest {
271
+ string subscriber_id = 1; // the authenticated user performing the action
272
+ string target_id = 2; // the user being (un)subscribed to/from
273
+ }
274
+
275
+ message SubscriptionResponse {
276
+ bool subscribed = 1; // state after the call
277
+ int32 subscribers_count = 2; // target's subscriber count after the call
278
+ }