@aepstore-dev/contracts 1.0.6 → 1.1.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.
@@ -0,0 +1,327 @@
1
+ syntax = "proto3";
2
+
3
+ package products.v1;
4
+
5
+ service ProductsService {
6
+ rpc Create(CreateProductRequest) returns (ProductResponse);
7
+ rpc FindAll(QueryProductsRequest) returns (ProductsListResponse);
8
+ rpc FindAllApproved(QueryProductsRequest) returns (ProductsListResponse);
9
+ rpc FindMy(FindMyRequest) returns (ProductsListResponse);
10
+ rpc FindOne(FindOneRequest) returns (ProductResponse);
11
+ rpc Update(UpdateProductRequest) returns (ProductResponse);
12
+ rpc Remove(RemoveProductRequest) returns (Ok);
13
+ rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
14
+ rpc GetPriceRange(Empty) returns (PriceRangeResponse);
15
+
16
+ rpc AddToFavorites(FavoriteRequest) returns (Ok);
17
+ rpc RemoveFromFavorites(FavoriteRequest) returns (Ok);
18
+
19
+ rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
20
+ rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
21
+
22
+ rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
23
+ rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
24
+ rpc ResubmitProduct(ResubmitProductRequest) returns (ProductResponse);
25
+
26
+ rpc GetSecureDownloadLinks(GetSecureDownloadLinksRequest) returns (SecureDownloadLinksResponse);
27
+ rpc GetAttachmentDownloadInfo(GetAttachmentDownloadInfoRequest) returns (AttachmentDownloadInfoResponse);
28
+ rpc GetAttachmentStream(GetAttachmentStreamRequest) returns (stream AttachmentChunk);
29
+
30
+ rpc GetTopProduct(Empty) returns (ProductResponse);
31
+ rpc GetPopularProducts(QueryProductsRequest) returns (ProductsListResponse);
32
+ }
33
+
34
+ // =================================================================
35
+ // Enums
36
+ // =================================================================
37
+
38
+ enum ProductStatus {
39
+ PRODUCT_STATUS_UNSPECIFIED = 0;
40
+ PRODUCT_STATUS_ACTIVE = 1;
41
+ PRODUCT_STATUS_DRAFT = 2;
42
+ }
43
+
44
+ enum ModerationStatus {
45
+ MODERATION_STATUS_UNSPECIFIED = 0;
46
+ MODERATION_STATUS_PENDING = 1;
47
+ MODERATION_STATUS_APPROVED = 2;
48
+ MODERATION_STATUS_REJECTED = 3;
49
+ }
50
+
51
+ enum MediaType {
52
+ MEDIA_TYPE_UNSPECIFIED = 0;
53
+ MEDIA_TYPE_IMAGE = 1;
54
+ MEDIA_TYPE_VIDEO = 2;
55
+ }
56
+
57
+ // =================================================================
58
+ // Nested entities
59
+ // =================================================================
60
+
61
+ message Category {
62
+ string id = 1;
63
+ string name = 2;
64
+ }
65
+
66
+ message Application {
67
+ string id = 1;
68
+ string name = 2;
69
+ }
70
+
71
+ message Tag {
72
+ string id = 1;
73
+ string name = 2;
74
+ }
75
+
76
+ message ProductMedia {
77
+ string id = 1;
78
+ string url = 2;
79
+ MediaType type = 3;
80
+ }
81
+
82
+ message Attachment {
83
+ string id = 1;
84
+ string url = 2;
85
+ string file_key = 3;
86
+ string file_name = 4;
87
+ double file_size = 5;
88
+ string created_at = 6;
89
+ }
90
+
91
+ message ProductUser {
92
+ string id = 1;
93
+ string username = 2;
94
+ string avatar_url = 3;
95
+ }
96
+
97
+ message Product {
98
+ string id = 1;
99
+ string name = 2;
100
+ string description = 3;
101
+ string price = 4; // Decimal as string (D7)
102
+ string discount_percent = 5; // Decimal as string
103
+ string final_price = 6; // Decimal as string
104
+ string average_rating = 7; // double as string for consistency
105
+ ProductStatus status = 8;
106
+ ModerationStatus moderation_status = 9;
107
+ string moderation_comment = 10;
108
+ string moderated_by = 11;
109
+ string moderated_at = 12;
110
+ string created_at = 13;
111
+ string updated_at = 14;
112
+ string preview = 15;
113
+ string video = 16;
114
+ ProductUser user = 17;
115
+ repeated ProductMedia media = 18;
116
+ repeated Category categories = 19;
117
+ repeated Application applications = 20;
118
+ repeated Tag tags = 21;
119
+ }
120
+
121
+ message ProductResponse {
122
+ Product product = 1;
123
+ }
124
+
125
+ message ProductsListResponse {
126
+ repeated Product items = 1;
127
+ int32 total = 2;
128
+ int32 page = 3;
129
+ int32 limit = 4;
130
+ }
131
+
132
+ message Ok {
133
+ bool ok = 1;
134
+ }
135
+
136
+ message Empty {}
137
+
138
+ // =================================================================
139
+ // Create / Update / Query
140
+ // =================================================================
141
+
142
+ message CreateProductRequest {
143
+ string user_id = 1;
144
+ string name = 2;
145
+ string price = 3; // Decimal as string
146
+ repeated string category_ids = 4;
147
+ repeated string application_ids = 5;
148
+ repeated string tags = 6;
149
+ string discount_percent = 7; // optional
150
+ string final_price = 8; // optional
151
+ string video = 9;
152
+ string description = 10;
153
+ ProductStatus status = 11;
154
+ }
155
+
156
+ message UpdateProductRequest {
157
+ string user_id = 1;
158
+ string id = 2;
159
+ string name = 3;
160
+ string description = 4;
161
+ string price = 5;
162
+ string discount_percent = 6;
163
+ string final_price = 7;
164
+ repeated string tags = 8;
165
+ }
166
+
167
+ message QueryProductsRequest {
168
+ string search = 1;
169
+ repeated string category_ids = 2;
170
+ repeated string application_ids = 3;
171
+ repeated string tags = 4;
172
+ string min_price = 5;
173
+ string max_price = 6;
174
+ int32 page = 7;
175
+ int32 limit = 8;
176
+ string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
177
+ string sort_order = 10; // asc | desc
178
+ ProductStatus status = 11;
179
+ ModerationStatus moderation_status = 12;
180
+ }
181
+
182
+ message FindMyRequest {
183
+ string user_id = 1;
184
+ QueryProductsRequest query = 2;
185
+ }
186
+
187
+ message FindOneRequest {
188
+ string id = 1;
189
+ string viewer_user_id = 2; // optional — to compute is_favorited etc.
190
+ }
191
+
192
+ message RemoveProductRequest {
193
+ string id = 1;
194
+ string user_id = 2;
195
+ }
196
+
197
+ message SubmitForModerationRequest {
198
+ string id = 1;
199
+ string user_id = 2;
200
+ }
201
+
202
+ message PriceRangeResponse {
203
+ string min = 1; // Decimal as string
204
+ string max = 2;
205
+ }
206
+
207
+ // =================================================================
208
+ // Favorites
209
+ // =================================================================
210
+
211
+ message FavoriteRequest {
212
+ string user_id = 1;
213
+ string product_id = 2;
214
+ }
215
+
216
+ // =================================================================
217
+ // Media / Attachments metadata
218
+ // =================================================================
219
+
220
+ message MediaFile {
221
+ string url = 1;
222
+ MediaType type = 2;
223
+ }
224
+
225
+ message SaveMediaMetadataRequest {
226
+ string id = 1;
227
+ string user_id = 2;
228
+ repeated MediaFile files = 3;
229
+ string upload_id = 4;
230
+ }
231
+
232
+ message AttachmentMeta {
233
+ string url = 1;
234
+ string file_key = 2;
235
+ string file_name = 3;
236
+ double file_size = 4;
237
+ }
238
+
239
+ message SaveAttachmentMetadataRequest {
240
+ string id = 1;
241
+ string user_id = 2;
242
+ AttachmentMeta attachment = 3;
243
+ string upload_id = 4;
244
+ }
245
+
246
+ // =================================================================
247
+ // Moderation
248
+ // =================================================================
249
+
250
+ message ProductModerationQueryRequest {
251
+ ModerationStatus status = 1;
252
+ int32 page = 2;
253
+ int32 limit = 3;
254
+ string sort_by = 4;
255
+ string sort_order = 5;
256
+ }
257
+
258
+ message ModerateProductRequest {
259
+ string product_id = 1;
260
+ string moderator_id = 2;
261
+ string action = 3; // 'approve' | 'reject'
262
+ string comment = 4;
263
+ }
264
+
265
+ message ModerationResponse {
266
+ bool success = 1;
267
+ string message = 2;
268
+ Product product = 3;
269
+ ModerationStatus moderation_status = 4;
270
+ string moderation_comment = 5;
271
+ string moderated_by = 6;
272
+ string moderated_at = 7;
273
+ }
274
+
275
+ message ResubmitProductRequest {
276
+ string product_id = 1;
277
+ string user_id = 2;
278
+ string comment = 3;
279
+ // Free-form payload of changes — serialized as JSON string to keep the
280
+ // legacy `any` shape without forcing a strict schema on a free-form patch.
281
+ string changes_json = 4;
282
+ }
283
+
284
+ // =================================================================
285
+ // Secure downloads
286
+ // =================================================================
287
+
288
+ message GetSecureDownloadLinksRequest {
289
+ string product_id = 1;
290
+ string user_id = 2;
291
+ int32 expires_in = 3;
292
+ }
293
+
294
+ message SecureDownloadLink {
295
+ string download_url = 1;
296
+ int32 expires_in = 2;
297
+ string file_name = 3;
298
+ double file_size = 4;
299
+ string attachment_id = 5;
300
+ }
301
+
302
+ message SecureDownloadLinksResponse {
303
+ repeated SecureDownloadLink links = 1;
304
+ }
305
+
306
+ message GetAttachmentDownloadInfoRequest {
307
+ string product_id = 1;
308
+ string attachment_id = 2;
309
+ string user_id = 3;
310
+ }
311
+
312
+ message AttachmentDownloadInfoResponse {
313
+ string file_name = 1;
314
+ double file_size = 2;
315
+ string content_type = 3;
316
+ }
317
+
318
+ message GetAttachmentStreamRequest {
319
+ string product_id = 1;
320
+ string attachment_id = 2;
321
+ string user_id = 3;
322
+ }
323
+
324
+ message AttachmentChunk {
325
+ bytes data = 1;
326
+ bool last = 2;
327
+ }
@@ -0,0 +1,78 @@
1
+ syntax = "proto3";
2
+
3
+ package taxonomy.v1;
4
+
5
+ service TaxonomyService {
6
+ rpc FindAllCategories(Empty) returns (CategoriesListResponse);
7
+ rpc FindAllApplications(Empty) returns (ApplicationsListResponse);
8
+ rpc FindAllTags(QueryTagsRequest) returns (TagsListResponse);
9
+
10
+ rpc CreateCategory(CreateCategoryRequest) returns (CategoryResponse);
11
+ rpc CreateApplication(CreateApplicationRequest) returns (ApplicationResponse);
12
+ }
13
+
14
+ message Category {
15
+ string id = 1;
16
+ string name = 2;
17
+ string description = 3;
18
+ string created_at = 4;
19
+ string updated_at = 5;
20
+ }
21
+
22
+ message Application {
23
+ string id = 1;
24
+ string name = 2;
25
+ string description = 3;
26
+ string created_at = 4;
27
+ string updated_at = 5;
28
+ }
29
+
30
+ message Tag {
31
+ string id = 1;
32
+ string name = 2;
33
+ }
34
+
35
+ // =================================================================
36
+ // Requests / responses
37
+ // =================================================================
38
+
39
+ message Empty {}
40
+
41
+ message CategoriesListResponse {
42
+ repeated Category items = 1;
43
+ }
44
+
45
+ message ApplicationsListResponse {
46
+ repeated Application items = 1;
47
+ }
48
+
49
+ message QueryTagsRequest {
50
+ string search = 1;
51
+ int32 page = 2;
52
+ int32 limit = 3;
53
+ }
54
+
55
+ message TagsListResponse {
56
+ repeated Tag items = 1;
57
+ int32 total = 2;
58
+ int32 page = 3;
59
+ int32 limit = 4;
60
+ }
61
+
62
+ message CreateCategoryRequest {
63
+ string name = 1;
64
+ string description = 2;
65
+ }
66
+
67
+ message CategoryResponse {
68
+ Category category = 1;
69
+ }
70
+
71
+ message CreateApplicationRequest {
72
+ string name = 1;
73
+ string description = 2;
74
+ }
75
+
76
+ message ApplicationResponse {
77
+ Application application = 1;
78
+ }
@@ -0,0 +1,49 @@
1
+ syntax = "proto3";
2
+
3
+ package upload.v1;
4
+
5
+ // Ported from legacy libs/shared/src/proto/upload.proto.
6
+ // Bumped package to upload.v1 for consistency with the rest of the new stack.
7
+ service UploadService {
8
+ rpc UploadFile(stream FileChunk) returns (UploadResponse);
9
+ rpc GetUploadStatus(UploadStatusRequest) returns (UploadStatusResponse);
10
+ rpc GenerateSignedUrl(SignedUrlRequest) returns (SignedUrlResponse);
11
+ }
12
+
13
+ message FileChunk {
14
+ string filename = 1;
15
+ bytes data = 2;
16
+ string mime_type = 3;
17
+ bool is_last = 4;
18
+ int32 chunk_index = 5;
19
+ string upload_id = 6;
20
+ }
21
+
22
+ message UploadResponse {
23
+ string file_url = 1;
24
+ bool success = 2;
25
+ string message = 3;
26
+ string upload_id = 4;
27
+ int64 file_size = 5;
28
+ }
29
+
30
+ message UploadStatusRequest {
31
+ string upload_id = 1;
32
+ }
33
+
34
+ message UploadStatusResponse {
35
+ string status = 1;
36
+ int32 progress_percent = 2;
37
+ string message = 3;
38
+ }
39
+
40
+ message SignedUrlRequest {
41
+ string file_key = 1;
42
+ int32 expires_in = 2;
43
+ }
44
+
45
+ message SignedUrlResponse {
46
+ string signed_url = 1;
47
+ bool success = 2;
48
+ string message = 3;
49
+ }
@@ -0,0 +1,222 @@
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
+
16
+ // =================================================================
17
+ // Common types
18
+ // =================================================================
19
+
20
+ message User {
21
+ string id = 1;
22
+ string email = 2;
23
+ string username = 3;
24
+ string avatar_url = 4;
25
+ repeated string roles = 5;
26
+ string role = 6; // primary role for backwards compat
27
+ string created_at = 7; // ISO 8601
28
+ string updated_at = 8;
29
+ }
30
+
31
+ message Country {
32
+ string id = 1;
33
+ string code = 2;
34
+ string name = 3;
35
+ }
36
+
37
+ message SocialMedia {
38
+ string id = 1;
39
+ string platform = 2;
40
+ string url = 3;
41
+ }
42
+
43
+ message CreateSocialMedia {
44
+ string platform = 1;
45
+ string url = 2;
46
+ }
47
+
48
+ message Product {
49
+ string id = 1;
50
+ string name = 2;
51
+ string description = 3;
52
+ string price = 4; // Decimal as string (D7)
53
+ string created_at = 5;
54
+ string updated_at = 6;
55
+ }
56
+
57
+ message Video {
58
+ string id = 1;
59
+ string title = 2;
60
+ string description = 3;
61
+ string url = 4;
62
+ string created_at = 5;
63
+ string updated_at = 6;
64
+ }
65
+
66
+ message ActiveDevice {
67
+ string id = 1;
68
+ string user_agent = 2;
69
+ string ip = 3;
70
+ string created_at = 4;
71
+ string last_used_at = 5;
72
+ }
73
+
74
+ message ProfileStats {
75
+ int32 subscribers_count = 1;
76
+ int32 subscriptions_count = 2;
77
+ int32 products_count = 3;
78
+ int32 videos_count = 4;
79
+ }
80
+
81
+ // =================================================================
82
+ // GetPublicProfile
83
+ // =================================================================
84
+
85
+ message GetPublicProfileRequest {
86
+ string username = 1;
87
+ string viewer_user_id = 2; // optional — present when caller is authenticated
88
+ }
89
+
90
+ message PublicProfileResponse {
91
+ string id = 1;
92
+ string username = 2;
93
+ string full_name = 3;
94
+ string rating = 4; // Decimal as string
95
+ string about_me = 5;
96
+ repeated SocialMedia social_media = 6;
97
+ ProfileStats stats = 7;
98
+ repeated Video videos = 8;
99
+ repeated Product products = 9;
100
+ Country country = 10;
101
+ string avatar_url = 11;
102
+ string banner_url = 12;
103
+ string role = 13;
104
+ string created_at = 14;
105
+ bool hide_subscriptions = 15;
106
+ // Either populated lists or empty depending on hide_subscriptions
107
+ repeated User subscriptions = 16;
108
+ repeated User subscribers = 17;
109
+ bool is_owner = 18;
110
+ }
111
+
112
+ // =================================================================
113
+ // UpdateProfile
114
+ // =================================================================
115
+
116
+ message UpdateProfileRequest {
117
+ string user_id = 1;
118
+ string full_name = 2;
119
+ string about_me = 3;
120
+ bool newsletter_subscription = 4;
121
+ bool hide_subscriptions = 5;
122
+ string avatar_url = 6;
123
+ string banner_url = 7;
124
+ string country_id = 8;
125
+ string timezone = 9;
126
+ repeated CreateSocialMedia social_media = 10;
127
+ }
128
+
129
+ // =================================================================
130
+ // UpdateUser
131
+ // =================================================================
132
+
133
+ message UpdateUserRequest {
134
+ string user_id = 1;
135
+ string username = 2;
136
+ string email = 3;
137
+ string code = 4; // confirmation code when changing email/username
138
+ }
139
+
140
+ message UserResponse {
141
+ User user = 1;
142
+ }
143
+
144
+ // =================================================================
145
+ // UpdateUserRole (admin)
146
+ // =================================================================
147
+
148
+ message UpdateUserRoleRequest {
149
+ string admin_id = 1;
150
+ string user_id = 2;
151
+ string role = 3;
152
+ }
153
+
154
+ // =================================================================
155
+ // GetUsers (paginated)
156
+ // =================================================================
157
+
158
+ message GetUsersRequest {
159
+ string page = 1;
160
+ string limit = 2;
161
+ string search = 3;
162
+ string role_name = 4;
163
+ }
164
+
165
+ message GetUsersResponse {
166
+ repeated User items = 1;
167
+ int32 total = 2;
168
+ int32 page = 3;
169
+ int32 limit = 4;
170
+ }
171
+
172
+ // =================================================================
173
+ // Active devices
174
+ // =================================================================
175
+
176
+ message GetActiveDevicesRequest {
177
+ string user_id = 1;
178
+ }
179
+
180
+ message GetActiveDevicesResponse {
181
+ repeated ActiveDevice devices = 1;
182
+ }
183
+
184
+ message ManageDevicesRequest {
185
+ string user_id = 1;
186
+ repeated string device_ids_to_remove = 2;
187
+ }
188
+
189
+ message ManageDevicesResponse {
190
+ bool ok = 1;
191
+ int32 removed_count = 2;
192
+ }
193
+
194
+ // =================================================================
195
+ // GetUserFields — paginated dynamic field sets
196
+ // =================================================================
197
+
198
+ enum UserFieldsType {
199
+ USER_FIELDS_TYPE_UNSPECIFIED = 0;
200
+ USER_FIELDS_TYPE_VIDEOS = 1;
201
+ USER_FIELDS_TYPE_PRODUCTS = 2;
202
+ USER_FIELDS_TYPE_SUBSCRIPTIONS = 3;
203
+ USER_FIELDS_TYPE_SUBSCRIBERS = 4;
204
+ }
205
+
206
+ message GetUserFieldsRequest {
207
+ string username = 1;
208
+ UserFieldsType type = 2;
209
+ int32 page = 3;
210
+ int32 limit = 4;
211
+ string viewer_user_id = 5; // optional
212
+ }
213
+
214
+ message GetUserFieldsResponse {
215
+ repeated Video videos = 1;
216
+ repeated Product products = 2;
217
+ repeated User subscriptions = 3;
218
+ repeated User subscribers = 4;
219
+ int32 total = 5;
220
+ int32 page = 6;
221
+ int32 limit = 7;
222
+ }