@aepstore-dev/contracts 1.54.0 → 1.55.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/activity.js +1 -1
- package/gen/activity.ts +1 -1
- package/gen/auth.d.ts +5 -0
- package/gen/auth.js +1 -1
- package/gen/auth.ts +6 -1
- package/gen/mail.js +1 -1
- package/gen/mail.ts +1 -1
- package/gen/payments.js +1 -1
- package/gen/payments.ts +1 -1
- package/gen/products.js +1 -1
- package/gen/products.ts +1 -1
- package/gen/support.js +1 -1
- package/gen/support.ts +1 -1
- package/gen/taxonomy.js +1 -1
- package/gen/taxonomy.ts +1 -1
- package/gen/upload.js +1 -1
- package/gen/upload.ts +1 -1
- package/gen/users.js +1 -1
- package/gen/users.ts +1 -1
- package/package.json +35 -35
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +198 -195
- package/proto/mail.proto +54 -54
- package/proto/payments.proto +445 -445
- package/proto/products.proto +402 -402
- package/proto/support.proto +144 -144
- package/proto/taxonomy.proto +105 -105
- package/proto/upload.proto +171 -171
- package/proto/users.proto +700 -700
package/proto/products.proto
CHANGED
|
@@ -1,412 +1,412 @@
|
|
|
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 Restore(RestoreProductRequest) returns (ProductResponse);
|
|
14
|
-
rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
|
|
15
|
-
rpc GetPriceRange(Empty) returns (PriceRangeResponse);
|
|
16
|
-
|
|
17
|
-
rpc AddToFavorites(FavoriteRequest) returns (Ok);
|
|
18
|
-
rpc RemoveFromFavorites(FavoriteRequest) returns (Ok);
|
|
19
|
-
|
|
20
|
-
rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
|
|
21
|
-
rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
|
|
22
|
-
rpc RemoveMedia(RemoveMediaRequest) returns (ProductResponse);
|
|
23
|
-
rpc RemoveAttachment(RemoveAttachmentRequest) returns (ProductResponse);
|
|
24
|
-
|
|
25
|
-
rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
|
|
26
|
-
rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
|
|
27
|
-
rpc ResubmitProduct(ResubmitProductRequest) returns (ProductResponse);
|
|
28
|
-
|
|
29
|
-
rpc GetSecureDownloadLinks(GetSecureDownloadLinksRequest) returns (SecureDownloadLinksResponse);
|
|
30
|
-
rpc GetAttachmentDownloadInfo(GetAttachmentDownloadInfoRequest) returns (AttachmentDownloadInfoResponse);
|
|
31
|
-
// Single presigned GET URL for one attachment (after purchase/access check).
|
|
32
|
-
// Bytes never traverse the backend — see upload-service.
|
|
33
|
-
rpc GetAttachmentDownloadUrl(GetAttachmentDownloadUrlRequest) returns (AttachmentDownloadUrlResponse);
|
|
34
|
-
|
|
35
|
-
rpc GetTopProduct(TopProductRequest) returns (ProductResponse);
|
|
36
|
-
rpc GetPopularProducts(QueryProductsRequest) returns (ProductsListResponse);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// =================================================================
|
|
40
|
-
// Enums
|
|
41
|
-
// =================================================================
|
|
42
|
-
|
|
43
|
-
// Member names match the DB enum string values exactly (enums: String on the
|
|
44
|
-
// wire) so values pass straight through with no mapping. UNSPECIFIED=0 covers
|
|
45
|
-
// null/optional (e.g. nullable moderation_status, missing list filters).
|
|
46
|
-
enum ProductStatus {
|
|
47
|
-
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
48
|
-
ACTIVE = 1;
|
|
49
|
-
DRAFT = 2;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
enum ModerationStatus {
|
|
53
|
-
MODERATION_STATUS_UNSPECIFIED = 0;
|
|
54
|
-
PENDING = 1;
|
|
55
|
-
APPROVED = 2;
|
|
56
|
-
REJECTED = 3;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
enum MediaType {
|
|
60
|
-
MEDIA_TYPE_UNSPECIFIED = 0;
|
|
61
|
-
IMAGE = 1;
|
|
62
|
-
VIDEO = 2;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// =================================================================
|
|
66
|
-
// Nested entities
|
|
67
|
-
// =================================================================
|
|
68
|
-
|
|
69
|
-
message Category {
|
|
70
|
-
string id = 1;
|
|
71
|
-
string name = 2;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
message Application {
|
|
75
|
-
string id = 1;
|
|
76
|
-
string name = 2;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
message Tag {
|
|
80
|
-
string id = 1;
|
|
81
|
-
string name = 2;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
message ProductMedia {
|
|
85
|
-
string id = 1;
|
|
86
|
-
string url = 2;
|
|
87
|
-
MediaType type = 3;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
message Attachment {
|
|
91
|
-
string id = 1;
|
|
92
|
-
string url = 2;
|
|
93
|
-
string file_key = 3;
|
|
94
|
-
string file_name = 4;
|
|
95
|
-
double file_size = 5;
|
|
96
|
-
string created_at = 6;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
message ProductUser {
|
|
100
|
-
string id = 1;
|
|
101
|
-
string username = 2;
|
|
102
|
-
string avatar_url = 3;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Moderation block — null on the product while it's a DRAFT / never submitted.
|
|
106
|
-
// status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
|
|
107
|
-
message ProductModeration {
|
|
108
|
-
ModerationStatus status = 1;
|
|
109
|
-
string comment = 2; // moderator note (mainly on REJECTED)
|
|
110
|
-
string moderated_by = 3; // moderator user id
|
|
111
|
-
string moderated_at = 4; // ISO 8601
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
message Product {
|
|
115
|
-
reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
|
|
116
|
-
string id = 1;
|
|
117
|
-
string name = 2;
|
|
118
|
-
string description = 3;
|
|
119
|
-
string price = 4; // Decimal as string (D7)
|
|
120
|
-
string discount_percent = 5; // Decimal as string
|
|
121
|
-
string final_price = 6; // Decimal as string
|
|
122
|
-
string average_rating = 7; // double as string for consistency
|
|
123
|
-
ProductStatus status = 8;
|
|
124
|
-
ProductModeration moderation = 32; // null while DRAFT / not yet submitted
|
|
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 Restore(RestoreProductRequest) returns (ProductResponse);
|
|
14
|
+
rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
|
|
15
|
+
rpc GetPriceRange(Empty) returns (PriceRangeResponse);
|
|
16
|
+
|
|
17
|
+
rpc AddToFavorites(FavoriteRequest) returns (Ok);
|
|
18
|
+
rpc RemoveFromFavorites(FavoriteRequest) returns (Ok);
|
|
19
|
+
|
|
20
|
+
rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
|
|
21
|
+
rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
|
|
22
|
+
rpc RemoveMedia(RemoveMediaRequest) returns (ProductResponse);
|
|
23
|
+
rpc RemoveAttachment(RemoveAttachmentRequest) returns (ProductResponse);
|
|
24
|
+
|
|
25
|
+
rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
|
|
26
|
+
rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
|
|
27
|
+
rpc ResubmitProduct(ResubmitProductRequest) returns (ProductResponse);
|
|
28
|
+
|
|
29
|
+
rpc GetSecureDownloadLinks(GetSecureDownloadLinksRequest) returns (SecureDownloadLinksResponse);
|
|
30
|
+
rpc GetAttachmentDownloadInfo(GetAttachmentDownloadInfoRequest) returns (AttachmentDownloadInfoResponse);
|
|
31
|
+
// Single presigned GET URL for one attachment (after purchase/access check).
|
|
32
|
+
// Bytes never traverse the backend — see upload-service.
|
|
33
|
+
rpc GetAttachmentDownloadUrl(GetAttachmentDownloadUrlRequest) returns (AttachmentDownloadUrlResponse);
|
|
34
|
+
|
|
35
|
+
rpc GetTopProduct(TopProductRequest) returns (ProductResponse);
|
|
36
|
+
rpc GetPopularProducts(QueryProductsRequest) returns (ProductsListResponse);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// =================================================================
|
|
40
|
+
// Enums
|
|
41
|
+
// =================================================================
|
|
42
|
+
|
|
43
|
+
// Member names match the DB enum string values exactly (enums: String on the
|
|
44
|
+
// wire) so values pass straight through with no mapping. UNSPECIFIED=0 covers
|
|
45
|
+
// null/optional (e.g. nullable moderation_status, missing list filters).
|
|
46
|
+
enum ProductStatus {
|
|
47
|
+
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
48
|
+
ACTIVE = 1;
|
|
49
|
+
DRAFT = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enum ModerationStatus {
|
|
53
|
+
MODERATION_STATUS_UNSPECIFIED = 0;
|
|
54
|
+
PENDING = 1;
|
|
55
|
+
APPROVED = 2;
|
|
56
|
+
REJECTED = 3;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
enum MediaType {
|
|
60
|
+
MEDIA_TYPE_UNSPECIFIED = 0;
|
|
61
|
+
IMAGE = 1;
|
|
62
|
+
VIDEO = 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// =================================================================
|
|
66
|
+
// Nested entities
|
|
67
|
+
// =================================================================
|
|
68
|
+
|
|
69
|
+
message Category {
|
|
70
|
+
string id = 1;
|
|
71
|
+
string name = 2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message Application {
|
|
75
|
+
string id = 1;
|
|
76
|
+
string name = 2;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message Tag {
|
|
80
|
+
string id = 1;
|
|
81
|
+
string name = 2;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message ProductMedia {
|
|
85
|
+
string id = 1;
|
|
86
|
+
string url = 2;
|
|
87
|
+
MediaType type = 3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message Attachment {
|
|
91
|
+
string id = 1;
|
|
92
|
+
string url = 2;
|
|
93
|
+
string file_key = 3;
|
|
94
|
+
string file_name = 4;
|
|
95
|
+
double file_size = 5;
|
|
96
|
+
string created_at = 6;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message ProductUser {
|
|
100
|
+
string id = 1;
|
|
101
|
+
string username = 2;
|
|
102
|
+
string avatar_url = 3;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Moderation block — null on the product while it's a DRAFT / never submitted.
|
|
106
|
+
// status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
|
|
107
|
+
message ProductModeration {
|
|
108
|
+
ModerationStatus status = 1;
|
|
109
|
+
string comment = 2; // moderator note (mainly on REJECTED)
|
|
110
|
+
string moderated_by = 3; // moderator user id
|
|
111
|
+
string moderated_at = 4; // ISO 8601
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message Product {
|
|
115
|
+
reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
|
|
116
|
+
string id = 1;
|
|
117
|
+
string name = 2;
|
|
118
|
+
string description = 3;
|
|
119
|
+
string price = 4; // Decimal as string (D7)
|
|
120
|
+
string discount_percent = 5; // Decimal as string
|
|
121
|
+
string final_price = 6; // Decimal as string
|
|
122
|
+
string average_rating = 7; // double as string for consistency
|
|
123
|
+
ProductStatus status = 8;
|
|
124
|
+
ProductModeration moderation = 32; // null while DRAFT / not yet submitted
|
|
125
125
|
string created_at = 13;
|
|
126
126
|
string updated_at = 14;
|
|
127
127
|
string deleted_at = 34; // ISO 8601 when soft-deleted, empty/null otherwise
|
|
128
128
|
string preview = 15;
|
|
129
|
-
string video = 16;
|
|
130
|
-
ProductUser user = 17;
|
|
131
|
-
repeated ProductMedia media = 18;
|
|
132
|
-
repeated Category categories = 19;
|
|
133
|
-
repeated Application applications = 20;
|
|
134
|
-
repeated Tag tags = 21;
|
|
135
|
-
|
|
136
|
-
// Aggregate counts (populated where the query includes _count).
|
|
137
|
-
int32 favorites_count = 22;
|
|
138
|
-
int32 views_count = 23;
|
|
139
|
-
int32 reviews_count = 24;
|
|
140
|
-
|
|
141
|
-
// Viewer-contextual flags (populated by FindOne when a viewer is known).
|
|
142
|
-
bool owner = 25;
|
|
143
|
-
bool is_favorite = 26;
|
|
144
|
-
bool is_viewed = 27;
|
|
145
|
-
string revenue = 28; // owner-only, current-month revenue (Decimal as string)
|
|
146
|
-
bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
|
|
147
|
-
bool is_reviewed = 31; // viewer has already left a review on this product
|
|
148
|
-
|
|
149
|
-
// Popularity (populated by GetTopProduct / GetPopularProducts).
|
|
150
|
-
string popularity_score = 29; // double as string
|
|
151
|
-
|
|
152
|
-
// OWNER-ONLY: the product's deliverable files. Populated by FindOne only
|
|
153
|
-
// when the viewer is the product owner; empty for everyone else (never
|
|
154
|
-
// exposes private attachment metadata to non-owners).
|
|
155
|
-
repeated ProductAttachment attachments = 33;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
message ProductAttachment {
|
|
159
|
-
string id = 1;
|
|
160
|
-
string file_name = 2;
|
|
161
|
-
double file_size = 3;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Compact product shape for "related products" — only the fields a card needs.
|
|
165
|
-
message RelatedProduct {
|
|
166
|
-
string id = 1;
|
|
167
|
-
string name = 2;
|
|
168
|
-
string price = 3; // Decimal as string
|
|
169
|
-
string discount_percent = 4; // Decimal as string
|
|
170
|
-
string final_price = 5; // Decimal as string
|
|
171
|
-
string preview = 6;
|
|
172
|
-
ProductUser user = 7;
|
|
173
|
-
repeated Category categories = 8;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
message ProductResponse {
|
|
177
|
-
Product product = 1;
|
|
178
|
-
// Populated only by FindOne: up to 2 other approved products by the same author.
|
|
179
|
-
repeated RelatedProduct related_products = 2;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
message TopProductRequest {
|
|
183
|
-
// Optional. If set, the top product is searched only among this seller's products.
|
|
184
|
-
string user_id = 1;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
message ProductsListResponse {
|
|
188
|
-
repeated Product items = 1;
|
|
189
|
-
int32 total = 2;
|
|
190
|
-
int32 page = 3;
|
|
191
|
-
int32 limit = 4;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
message Ok {
|
|
195
|
-
bool ok = 1;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
message Empty {}
|
|
199
|
-
|
|
200
|
-
// =================================================================
|
|
201
|
-
// Create / Update / Query
|
|
202
|
-
// =================================================================
|
|
203
|
-
|
|
204
|
-
message CreateProductRequest {
|
|
205
|
-
string user_id = 1;
|
|
206
|
-
string name = 2;
|
|
207
|
-
string price = 3; // Decimal as string
|
|
208
|
-
repeated string category_ids = 4;
|
|
209
|
-
repeated string application_ids = 5;
|
|
210
|
-
repeated string tags = 6;
|
|
211
|
-
string discount_percent = 7; // optional
|
|
212
|
-
string final_price = 8; // optional
|
|
213
|
-
string video = 9;
|
|
214
|
-
string description = 10;
|
|
215
|
-
ProductStatus status = 11;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
message UpdateProductRequest {
|
|
219
|
-
string user_id = 1;
|
|
220
|
-
string id = 2;
|
|
221
|
-
string name = 3;
|
|
222
|
-
string description = 4;
|
|
223
|
-
string price = 5;
|
|
224
|
-
string discount_percent = 6;
|
|
225
|
-
string final_price = 7;
|
|
226
|
-
repeated string tags = 8;
|
|
227
|
-
repeated string category_ids = 9;
|
|
228
|
-
repeated string application_ids = 10;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
message QueryProductsRequest {
|
|
232
|
-
string search = 1;
|
|
233
|
-
repeated string category_ids = 2;
|
|
234
|
-
repeated string application_ids = 3;
|
|
235
|
-
repeated string tags = 4;
|
|
236
|
-
string min_price = 5;
|
|
237
|
-
string max_price = 6;
|
|
238
|
-
int32 page = 7;
|
|
239
|
-
int32 limit = 8;
|
|
129
|
+
string video = 16;
|
|
130
|
+
ProductUser user = 17;
|
|
131
|
+
repeated ProductMedia media = 18;
|
|
132
|
+
repeated Category categories = 19;
|
|
133
|
+
repeated Application applications = 20;
|
|
134
|
+
repeated Tag tags = 21;
|
|
135
|
+
|
|
136
|
+
// Aggregate counts (populated where the query includes _count).
|
|
137
|
+
int32 favorites_count = 22;
|
|
138
|
+
int32 views_count = 23;
|
|
139
|
+
int32 reviews_count = 24;
|
|
140
|
+
|
|
141
|
+
// Viewer-contextual flags (populated by FindOne when a viewer is known).
|
|
142
|
+
bool owner = 25;
|
|
143
|
+
bool is_favorite = 26;
|
|
144
|
+
bool is_viewed = 27;
|
|
145
|
+
string revenue = 28; // owner-only, current-month revenue (Decimal as string)
|
|
146
|
+
bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
|
|
147
|
+
bool is_reviewed = 31; // viewer has already left a review on this product
|
|
148
|
+
|
|
149
|
+
// Popularity (populated by GetTopProduct / GetPopularProducts).
|
|
150
|
+
string popularity_score = 29; // double as string
|
|
151
|
+
|
|
152
|
+
// OWNER-ONLY: the product's deliverable files. Populated by FindOne only
|
|
153
|
+
// when the viewer is the product owner; empty for everyone else (never
|
|
154
|
+
// exposes private attachment metadata to non-owners).
|
|
155
|
+
repeated ProductAttachment attachments = 33;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
message ProductAttachment {
|
|
159
|
+
string id = 1;
|
|
160
|
+
string file_name = 2;
|
|
161
|
+
double file_size = 3;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Compact product shape for "related products" — only the fields a card needs.
|
|
165
|
+
message RelatedProduct {
|
|
166
|
+
string id = 1;
|
|
167
|
+
string name = 2;
|
|
168
|
+
string price = 3; // Decimal as string
|
|
169
|
+
string discount_percent = 4; // Decimal as string
|
|
170
|
+
string final_price = 5; // Decimal as string
|
|
171
|
+
string preview = 6;
|
|
172
|
+
ProductUser user = 7;
|
|
173
|
+
repeated Category categories = 8;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
message ProductResponse {
|
|
177
|
+
Product product = 1;
|
|
178
|
+
// Populated only by FindOne: up to 2 other approved products by the same author.
|
|
179
|
+
repeated RelatedProduct related_products = 2;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message TopProductRequest {
|
|
183
|
+
// Optional. If set, the top product is searched only among this seller's products.
|
|
184
|
+
string user_id = 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message ProductsListResponse {
|
|
188
|
+
repeated Product items = 1;
|
|
189
|
+
int32 total = 2;
|
|
190
|
+
int32 page = 3;
|
|
191
|
+
int32 limit = 4;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
message Ok {
|
|
195
|
+
bool ok = 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message Empty {}
|
|
199
|
+
|
|
200
|
+
// =================================================================
|
|
201
|
+
// Create / Update / Query
|
|
202
|
+
// =================================================================
|
|
203
|
+
|
|
204
|
+
message CreateProductRequest {
|
|
205
|
+
string user_id = 1;
|
|
206
|
+
string name = 2;
|
|
207
|
+
string price = 3; // Decimal as string
|
|
208
|
+
repeated string category_ids = 4;
|
|
209
|
+
repeated string application_ids = 5;
|
|
210
|
+
repeated string tags = 6;
|
|
211
|
+
string discount_percent = 7; // optional
|
|
212
|
+
string final_price = 8; // optional
|
|
213
|
+
string video = 9;
|
|
214
|
+
string description = 10;
|
|
215
|
+
ProductStatus status = 11;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
message UpdateProductRequest {
|
|
219
|
+
string user_id = 1;
|
|
220
|
+
string id = 2;
|
|
221
|
+
string name = 3;
|
|
222
|
+
string description = 4;
|
|
223
|
+
string price = 5;
|
|
224
|
+
string discount_percent = 6;
|
|
225
|
+
string final_price = 7;
|
|
226
|
+
repeated string tags = 8;
|
|
227
|
+
repeated string category_ids = 9;
|
|
228
|
+
repeated string application_ids = 10;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
message QueryProductsRequest {
|
|
232
|
+
string search = 1;
|
|
233
|
+
repeated string category_ids = 2;
|
|
234
|
+
repeated string application_ids = 3;
|
|
235
|
+
repeated string tags = 4;
|
|
236
|
+
string min_price = 5;
|
|
237
|
+
string max_price = 6;
|
|
238
|
+
int32 page = 7;
|
|
239
|
+
int32 limit = 8;
|
|
240
240
|
string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
|
|
241
241
|
string sort_order = 10; // asc | desc
|
|
242
242
|
ProductStatus status = 11;
|
|
243
243
|
ModerationStatus moderation_status = 12;
|
|
244
244
|
bool deleted_only = 13; // owner-only list filter; used by /products/my?status=deleted
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
message FindMyRequest {
|
|
248
|
-
string user_id = 1;
|
|
249
|
-
QueryProductsRequest query = 2;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
message FindOneRequest {
|
|
253
|
-
string id = 1;
|
|
254
|
-
string viewer_user_id = 2; // optional — to compute is_favorited etc.
|
|
255
|
-
string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
message RemoveProductRequest {
|
|
259
|
-
string id = 1;
|
|
260
|
-
string user_id = 2;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
message RestoreProductRequest {
|
|
264
|
-
string id = 1;
|
|
265
|
-
string user_id = 2;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
message SubmitForModerationRequest {
|
|
269
|
-
string id = 1;
|
|
270
|
-
string user_id = 2;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
message PriceRangeResponse {
|
|
274
|
-
string min = 1; // Decimal as string
|
|
275
|
-
string max = 2;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// =================================================================
|
|
279
|
-
// Favorites
|
|
280
|
-
// =================================================================
|
|
281
|
-
|
|
282
|
-
message FavoriteRequest {
|
|
283
|
-
string user_id = 1;
|
|
284
|
-
string product_id = 2;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// =================================================================
|
|
288
|
-
// Media / Attachments metadata
|
|
289
|
-
// =================================================================
|
|
290
|
-
|
|
291
|
-
message MediaFile {
|
|
292
|
-
string url = 1;
|
|
293
|
-
MediaType type = 2;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
message SaveMediaMetadataRequest {
|
|
297
|
-
string id = 1;
|
|
298
|
-
string user_id = 2;
|
|
299
|
-
repeated MediaFile files = 3;
|
|
300
|
-
string upload_id = 4;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
message AttachmentMeta {
|
|
304
|
-
string url = 1;
|
|
305
|
-
string file_key = 2;
|
|
306
|
-
string file_name = 3;
|
|
307
|
-
double file_size = 4;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
message SaveAttachmentMetadataRequest {
|
|
311
|
-
string id = 1;
|
|
312
|
-
string user_id = 2;
|
|
313
|
-
AttachmentMeta attachment = 3;
|
|
314
|
-
string upload_id = 4;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
message RemoveMediaRequest {
|
|
318
|
-
string id = 1; // product id
|
|
319
|
-
string user_id = 2;
|
|
320
|
-
string media_id = 3;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
message RemoveAttachmentRequest {
|
|
324
|
-
string id = 1; // product id
|
|
325
|
-
string user_id = 2;
|
|
326
|
-
string attachment_id = 3;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// =================================================================
|
|
330
|
-
// Moderation
|
|
331
|
-
// =================================================================
|
|
332
|
-
|
|
333
|
-
message ProductModerationQueryRequest {
|
|
334
|
-
ModerationStatus status = 1;
|
|
335
|
-
int32 page = 2;
|
|
336
|
-
int32 limit = 3;
|
|
337
|
-
string sort_by = 4;
|
|
338
|
-
string sort_order = 5;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
message ModerateProductRequest {
|
|
342
|
-
string product_id = 1;
|
|
343
|
-
string moderator_id = 2;
|
|
344
|
-
string action = 3; // 'approve' | 'reject'
|
|
345
|
-
string comment = 4;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
message ModerationResponse {
|
|
349
|
-
bool success = 1;
|
|
350
|
-
string message = 2;
|
|
351
|
-
Product product = 3;
|
|
352
|
-
ModerationStatus moderation_status = 4;
|
|
353
|
-
string moderation_comment = 5;
|
|
354
|
-
string moderated_by = 6;
|
|
355
|
-
string moderated_at = 7;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
message ResubmitProductRequest {
|
|
359
|
-
string product_id = 1;
|
|
360
|
-
string user_id = 2;
|
|
361
|
-
string comment = 3;
|
|
362
|
-
// Free-form payload of changes — serialized as JSON string to keep the
|
|
363
|
-
// legacy `any` shape without forcing a strict schema on a free-form patch.
|
|
364
|
-
string changes_json = 4;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
// =================================================================
|
|
368
|
-
// Secure downloads
|
|
369
|
-
// =================================================================
|
|
370
|
-
|
|
371
|
-
message GetSecureDownloadLinksRequest {
|
|
372
|
-
string product_id = 1;
|
|
373
|
-
string user_id = 2;
|
|
374
|
-
int32 expires_in = 3;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
message SecureDownloadLink {
|
|
378
|
-
string download_url = 1;
|
|
379
|
-
int32 expires_in = 2;
|
|
380
|
-
string file_name = 3;
|
|
381
|
-
double file_size = 4;
|
|
382
|
-
string attachment_id = 5;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
message SecureDownloadLinksResponse {
|
|
386
|
-
repeated SecureDownloadLink links = 1;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
message GetAttachmentDownloadInfoRequest {
|
|
390
|
-
string product_id = 1;
|
|
391
|
-
string attachment_id = 2;
|
|
392
|
-
string user_id = 3;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
message AttachmentDownloadInfoResponse {
|
|
396
|
-
string file_name = 1;
|
|
397
|
-
double file_size = 2;
|
|
398
|
-
string content_type = 3;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
message GetAttachmentDownloadUrlRequest {
|
|
402
|
-
string product_id = 1;
|
|
403
|
-
string attachment_id = 2;
|
|
404
|
-
string user_id = 3;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
message AttachmentDownloadUrlResponse {
|
|
408
|
-
string download_url = 1;
|
|
409
|
-
int32 expires_in = 2;
|
|
410
|
-
string file_name = 3;
|
|
411
|
-
double file_size = 4;
|
|
412
|
-
}
|
|
246
|
+
|
|
247
|
+
message FindMyRequest {
|
|
248
|
+
string user_id = 1;
|
|
249
|
+
QueryProductsRequest query = 2;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
message FindOneRequest {
|
|
253
|
+
string id = 1;
|
|
254
|
+
string viewer_user_id = 2; // optional — to compute is_favorited etc.
|
|
255
|
+
string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
message RemoveProductRequest {
|
|
259
|
+
string id = 1;
|
|
260
|
+
string user_id = 2;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
message RestoreProductRequest {
|
|
264
|
+
string id = 1;
|
|
265
|
+
string user_id = 2;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
message SubmitForModerationRequest {
|
|
269
|
+
string id = 1;
|
|
270
|
+
string user_id = 2;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
message PriceRangeResponse {
|
|
274
|
+
string min = 1; // Decimal as string
|
|
275
|
+
string max = 2;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// =================================================================
|
|
279
|
+
// Favorites
|
|
280
|
+
// =================================================================
|
|
281
|
+
|
|
282
|
+
message FavoriteRequest {
|
|
283
|
+
string user_id = 1;
|
|
284
|
+
string product_id = 2;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// =================================================================
|
|
288
|
+
// Media / Attachments metadata
|
|
289
|
+
// =================================================================
|
|
290
|
+
|
|
291
|
+
message MediaFile {
|
|
292
|
+
string url = 1;
|
|
293
|
+
MediaType type = 2;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
message SaveMediaMetadataRequest {
|
|
297
|
+
string id = 1;
|
|
298
|
+
string user_id = 2;
|
|
299
|
+
repeated MediaFile files = 3;
|
|
300
|
+
string upload_id = 4;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
message AttachmentMeta {
|
|
304
|
+
string url = 1;
|
|
305
|
+
string file_key = 2;
|
|
306
|
+
string file_name = 3;
|
|
307
|
+
double file_size = 4;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
message SaveAttachmentMetadataRequest {
|
|
311
|
+
string id = 1;
|
|
312
|
+
string user_id = 2;
|
|
313
|
+
AttachmentMeta attachment = 3;
|
|
314
|
+
string upload_id = 4;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
message RemoveMediaRequest {
|
|
318
|
+
string id = 1; // product id
|
|
319
|
+
string user_id = 2;
|
|
320
|
+
string media_id = 3;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
message RemoveAttachmentRequest {
|
|
324
|
+
string id = 1; // product id
|
|
325
|
+
string user_id = 2;
|
|
326
|
+
string attachment_id = 3;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// =================================================================
|
|
330
|
+
// Moderation
|
|
331
|
+
// =================================================================
|
|
332
|
+
|
|
333
|
+
message ProductModerationQueryRequest {
|
|
334
|
+
ModerationStatus status = 1;
|
|
335
|
+
int32 page = 2;
|
|
336
|
+
int32 limit = 3;
|
|
337
|
+
string sort_by = 4;
|
|
338
|
+
string sort_order = 5;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
message ModerateProductRequest {
|
|
342
|
+
string product_id = 1;
|
|
343
|
+
string moderator_id = 2;
|
|
344
|
+
string action = 3; // 'approve' | 'reject'
|
|
345
|
+
string comment = 4;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
message ModerationResponse {
|
|
349
|
+
bool success = 1;
|
|
350
|
+
string message = 2;
|
|
351
|
+
Product product = 3;
|
|
352
|
+
ModerationStatus moderation_status = 4;
|
|
353
|
+
string moderation_comment = 5;
|
|
354
|
+
string moderated_by = 6;
|
|
355
|
+
string moderated_at = 7;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
message ResubmitProductRequest {
|
|
359
|
+
string product_id = 1;
|
|
360
|
+
string user_id = 2;
|
|
361
|
+
string comment = 3;
|
|
362
|
+
// Free-form payload of changes — serialized as JSON string to keep the
|
|
363
|
+
// legacy `any` shape without forcing a strict schema on a free-form patch.
|
|
364
|
+
string changes_json = 4;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// =================================================================
|
|
368
|
+
// Secure downloads
|
|
369
|
+
// =================================================================
|
|
370
|
+
|
|
371
|
+
message GetSecureDownloadLinksRequest {
|
|
372
|
+
string product_id = 1;
|
|
373
|
+
string user_id = 2;
|
|
374
|
+
int32 expires_in = 3;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
message SecureDownloadLink {
|
|
378
|
+
string download_url = 1;
|
|
379
|
+
int32 expires_in = 2;
|
|
380
|
+
string file_name = 3;
|
|
381
|
+
double file_size = 4;
|
|
382
|
+
string attachment_id = 5;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
message SecureDownloadLinksResponse {
|
|
386
|
+
repeated SecureDownloadLink links = 1;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
message GetAttachmentDownloadInfoRequest {
|
|
390
|
+
string product_id = 1;
|
|
391
|
+
string attachment_id = 2;
|
|
392
|
+
string user_id = 3;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
message AttachmentDownloadInfoResponse {
|
|
396
|
+
string file_name = 1;
|
|
397
|
+
double file_size = 2;
|
|
398
|
+
string content_type = 3;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
message GetAttachmentDownloadUrlRequest {
|
|
402
|
+
string product_id = 1;
|
|
403
|
+
string attachment_id = 2;
|
|
404
|
+
string user_id = 3;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
message AttachmentDownloadUrlResponse {
|
|
408
|
+
string download_url = 1;
|
|
409
|
+
int32 expires_in = 2;
|
|
410
|
+
string file_name = 3;
|
|
411
|
+
double file_size = 4;
|
|
412
|
+
}
|