@aepstore-dev/contracts 1.107.0 → 1.108.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.js +1 -1
- package/gen/auth.ts +1 -1
- package/gen/mail.js +1 -1
- package/gen/mail.ts +1 -1
- package/gen/notifications.js +1 -1
- package/gen/notifications.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.d.ts +40 -0
- package/gen/upload.js +4 -1
- package/gen/upload.ts +65 -1
- package/gen/users.js +1 -1
- package/gen/users.ts +1 -1
- package/package.json +36 -35
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +417 -417
- package/proto/mail.proto +54 -54
- package/proto/products.proto +382 -382
- package/proto/taxonomy.proto +105 -105
- package/proto/upload.proto +194 -155
package/proto/products.proto
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
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
|
-
|
|
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
84
|
message ProductMedia {
|
|
85
85
|
string id = 1;
|
|
86
86
|
string url = 2;
|
|
@@ -89,81 +89,81 @@ message ProductMedia {
|
|
|
89
89
|
double file_size = 5;
|
|
90
90
|
string mime_type = 6;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
message Attachment {
|
|
94
|
-
string id = 1;
|
|
95
|
-
string url = 2;
|
|
96
|
-
string file_key = 3;
|
|
97
|
-
string file_name = 4;
|
|
98
|
-
double file_size = 5;
|
|
99
|
-
string created_at = 6;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
message ProductUser {
|
|
103
|
-
string id = 1;
|
|
104
|
-
string username = 2;
|
|
105
|
-
string avatar_url = 3;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Moderation block — null on the product while it's a DRAFT / never submitted.
|
|
109
|
-
// status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
|
|
110
|
-
message ProductModeration {
|
|
111
|
-
ModerationStatus status = 1;
|
|
112
|
-
string comment = 2; // moderator note (mainly on REJECTED)
|
|
113
|
-
string moderated_by = 3; // moderator user id
|
|
114
|
-
string moderated_at = 4; // ISO 8601
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
message Product {
|
|
118
|
-
reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
|
|
119
|
-
string id = 1;
|
|
120
|
-
string name = 2;
|
|
121
|
-
string description = 3;
|
|
122
|
-
string price = 4; // Decimal as string (D7), in `currency`
|
|
123
|
-
string discount_percent = 5; // Decimal as string
|
|
92
|
+
|
|
93
|
+
message Attachment {
|
|
94
|
+
string id = 1;
|
|
95
|
+
string url = 2;
|
|
96
|
+
string file_key = 3;
|
|
97
|
+
string file_name = 4;
|
|
98
|
+
double file_size = 5;
|
|
99
|
+
string created_at = 6;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message ProductUser {
|
|
103
|
+
string id = 1;
|
|
104
|
+
string username = 2;
|
|
105
|
+
string avatar_url = 3;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Moderation block — null on the product while it's a DRAFT / never submitted.
|
|
109
|
+
// status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
|
|
110
|
+
message ProductModeration {
|
|
111
|
+
ModerationStatus status = 1;
|
|
112
|
+
string comment = 2; // moderator note (mainly on REJECTED)
|
|
113
|
+
string moderated_by = 3; // moderator user id
|
|
114
|
+
string moderated_at = 4; // ISO 8601
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
message Product {
|
|
118
|
+
reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
|
|
119
|
+
string id = 1;
|
|
120
|
+
string name = 2;
|
|
121
|
+
string description = 3;
|
|
122
|
+
string price = 4; // Decimal as string (D7), in `currency`
|
|
123
|
+
string discount_percent = 5; // Decimal as string
|
|
124
124
|
string final_price = 6; // Decimal as string, in `currency`
|
|
125
125
|
// Converted final_price display amounts by currency (RUB/USD/EUR).
|
|
126
126
|
// Not persisted; computed from the cached payments-service FX rates.
|
|
127
127
|
map<string, string> prices = 36;
|
|
128
128
|
string average_rating = 7; // double as string for consistency
|
|
129
|
-
ProductStatus status = 8;
|
|
130
|
-
// Listing currency the seller priced in: RUB | USD | EUR (default RUB).
|
|
131
|
-
// Settlement/ledger is always RUB — conversion is snapshotted at checkout.
|
|
132
|
-
string currency = 35;
|
|
133
|
-
ProductModeration moderation = 32; // null while DRAFT / not yet submitted
|
|
134
|
-
string created_at = 13;
|
|
135
|
-
string updated_at = 14;
|
|
136
|
-
string deleted_at = 34; // ISO 8601 when soft-deleted, empty/null otherwise
|
|
137
|
-
string preview = 15;
|
|
138
|
-
string video = 16;
|
|
139
|
-
ProductUser user = 17;
|
|
140
|
-
repeated ProductMedia media = 18;
|
|
141
|
-
repeated Category categories = 19;
|
|
142
|
-
repeated Application applications = 20;
|
|
143
|
-
repeated Tag tags = 21;
|
|
144
|
-
|
|
145
|
-
// Aggregate counts (populated where the query includes _count).
|
|
146
|
-
int32 favorites_count = 22;
|
|
147
|
-
int32 views_count = 23;
|
|
148
|
-
int32 reviews_count = 24;
|
|
149
|
-
|
|
150
|
-
// Viewer-contextual flags (populated by FindOne when a viewer is known).
|
|
151
|
-
bool owner = 25;
|
|
152
|
-
bool is_favorite = 26;
|
|
153
|
-
bool is_viewed = 27;
|
|
154
|
-
string revenue = 28; // owner-only, current-month revenue (Decimal as string)
|
|
155
|
-
bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
|
|
156
|
-
bool is_reviewed = 31; // viewer has already left a review on this product
|
|
157
|
-
|
|
158
|
-
// Popularity (populated by GetTopProduct / GetPopularProducts).
|
|
159
|
-
string popularity_score = 29; // double as string
|
|
160
|
-
|
|
161
|
-
// OWNER-ONLY: the product's deliverable files. Populated by FindOne only
|
|
162
|
-
// when the viewer is the product owner; empty for everyone else (never
|
|
163
|
-
// exposes private attachment metadata to non-owners).
|
|
164
|
-
repeated ProductAttachment attachments = 33;
|
|
165
|
-
}
|
|
166
|
-
|
|
129
|
+
ProductStatus status = 8;
|
|
130
|
+
// Listing currency the seller priced in: RUB | USD | EUR (default RUB).
|
|
131
|
+
// Settlement/ledger is always RUB — conversion is snapshotted at checkout.
|
|
132
|
+
string currency = 35;
|
|
133
|
+
ProductModeration moderation = 32; // null while DRAFT / not yet submitted
|
|
134
|
+
string created_at = 13;
|
|
135
|
+
string updated_at = 14;
|
|
136
|
+
string deleted_at = 34; // ISO 8601 when soft-deleted, empty/null otherwise
|
|
137
|
+
string preview = 15;
|
|
138
|
+
string video = 16;
|
|
139
|
+
ProductUser user = 17;
|
|
140
|
+
repeated ProductMedia media = 18;
|
|
141
|
+
repeated Category categories = 19;
|
|
142
|
+
repeated Application applications = 20;
|
|
143
|
+
repeated Tag tags = 21;
|
|
144
|
+
|
|
145
|
+
// Aggregate counts (populated where the query includes _count).
|
|
146
|
+
int32 favorites_count = 22;
|
|
147
|
+
int32 views_count = 23;
|
|
148
|
+
int32 reviews_count = 24;
|
|
149
|
+
|
|
150
|
+
// Viewer-contextual flags (populated by FindOne when a viewer is known).
|
|
151
|
+
bool owner = 25;
|
|
152
|
+
bool is_favorite = 26;
|
|
153
|
+
bool is_viewed = 27;
|
|
154
|
+
string revenue = 28; // owner-only, current-month revenue (Decimal as string)
|
|
155
|
+
bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
|
|
156
|
+
bool is_reviewed = 31; // viewer has already left a review on this product
|
|
157
|
+
|
|
158
|
+
// Popularity (populated by GetTopProduct / GetPopularProducts).
|
|
159
|
+
string popularity_score = 29; // double as string
|
|
160
|
+
|
|
161
|
+
// OWNER-ONLY: the product's deliverable files. Populated by FindOne only
|
|
162
|
+
// when the viewer is the product owner; empty for everyone else (never
|
|
163
|
+
// exposes private attachment metadata to non-owners).
|
|
164
|
+
repeated ProductAttachment attachments = 33;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
167
|
message ProductAttachment {
|
|
168
168
|
string id = 1;
|
|
169
169
|
string file_name = 2;
|
|
@@ -171,8 +171,8 @@ message ProductAttachment {
|
|
|
171
171
|
reserved 4, 5;
|
|
172
172
|
reserved "url", "mime_type";
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
// Compact product shape for "related products" — only the fields a card needs.
|
|
174
|
+
|
|
175
|
+
// Compact product shape for "related products" — only the fields a card needs.
|
|
176
176
|
message RelatedProduct {
|
|
177
177
|
string id = 1;
|
|
178
178
|
string name = 2;
|
|
@@ -185,125 +185,125 @@ message RelatedProduct {
|
|
|
185
185
|
string currency = 9; // RUB | USD | EUR
|
|
186
186
|
map<string, string> prices = 10; // Converted final_price display amounts.
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
message ProductResponse {
|
|
190
|
-
Product product = 1;
|
|
191
|
-
// Populated only by FindOne: up to 2 other approved products by the same author.
|
|
192
|
-
repeated RelatedProduct related_products = 2;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
message TopProductRequest {
|
|
196
|
-
// Optional. If set, the top product is searched only among this seller's products.
|
|
197
|
-
string user_id = 1;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
message ProductsListResponse {
|
|
201
|
-
repeated Product items = 1;
|
|
202
|
-
int32 total = 2;
|
|
203
|
-
int32 page = 3;
|
|
204
|
-
int32 limit = 4;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
message Ok {
|
|
208
|
-
bool ok = 1;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
message Empty {}
|
|
212
|
-
|
|
213
|
-
// =================================================================
|
|
214
|
-
// Create / Update / Query
|
|
215
|
-
// =================================================================
|
|
216
|
-
|
|
217
|
-
message CreateProductRequest {
|
|
218
|
-
string user_id = 1;
|
|
219
|
-
string name = 2;
|
|
220
|
-
string price = 3; // Decimal as string
|
|
221
|
-
repeated string category_ids = 4;
|
|
222
|
-
repeated string application_ids = 5;
|
|
223
|
-
repeated string tags = 6;
|
|
224
|
-
string discount_percent = 7; // optional
|
|
225
|
-
string final_price = 8; // optional
|
|
226
|
-
string video = 9;
|
|
227
|
-
string description = 10;
|
|
228
|
-
ProductStatus status = 11;
|
|
229
|
-
string currency = 12; // RUB | USD | EUR; empty → RUB
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
message UpdateProductRequest {
|
|
233
|
-
string user_id = 1;
|
|
234
|
-
string id = 2;
|
|
235
|
-
string name = 3;
|
|
236
|
-
string description = 4;
|
|
237
|
-
string price = 5;
|
|
238
|
-
string discount_percent = 6;
|
|
239
|
-
string final_price = 7;
|
|
240
|
-
repeated string tags = 8;
|
|
241
|
-
repeated string category_ids = 9;
|
|
242
|
-
repeated string application_ids = 10;
|
|
243
|
-
string currency = 11; // RUB | USD | EUR; empty → no change
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
message QueryProductsRequest {
|
|
247
|
-
string search = 1;
|
|
248
|
-
repeated string category_ids = 2;
|
|
249
|
-
repeated string application_ids = 3;
|
|
250
|
-
repeated string tags = 4;
|
|
251
|
-
string min_price = 5;
|
|
252
|
-
string max_price = 6;
|
|
253
|
-
int32 page = 7;
|
|
254
|
-
int32 limit = 8;
|
|
255
|
-
string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
|
|
256
|
-
string sort_order = 10; // asc | desc
|
|
257
|
-
ProductStatus status = 11;
|
|
188
|
+
|
|
189
|
+
message ProductResponse {
|
|
190
|
+
Product product = 1;
|
|
191
|
+
// Populated only by FindOne: up to 2 other approved products by the same author.
|
|
192
|
+
repeated RelatedProduct related_products = 2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
message TopProductRequest {
|
|
196
|
+
// Optional. If set, the top product is searched only among this seller's products.
|
|
197
|
+
string user_id = 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
message ProductsListResponse {
|
|
201
|
+
repeated Product items = 1;
|
|
202
|
+
int32 total = 2;
|
|
203
|
+
int32 page = 3;
|
|
204
|
+
int32 limit = 4;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
message Ok {
|
|
208
|
+
bool ok = 1;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
message Empty {}
|
|
212
|
+
|
|
213
|
+
// =================================================================
|
|
214
|
+
// Create / Update / Query
|
|
215
|
+
// =================================================================
|
|
216
|
+
|
|
217
|
+
message CreateProductRequest {
|
|
218
|
+
string user_id = 1;
|
|
219
|
+
string name = 2;
|
|
220
|
+
string price = 3; // Decimal as string
|
|
221
|
+
repeated string category_ids = 4;
|
|
222
|
+
repeated string application_ids = 5;
|
|
223
|
+
repeated string tags = 6;
|
|
224
|
+
string discount_percent = 7; // optional
|
|
225
|
+
string final_price = 8; // optional
|
|
226
|
+
string video = 9;
|
|
227
|
+
string description = 10;
|
|
228
|
+
ProductStatus status = 11;
|
|
229
|
+
string currency = 12; // RUB | USD | EUR; empty → RUB
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
message UpdateProductRequest {
|
|
233
|
+
string user_id = 1;
|
|
234
|
+
string id = 2;
|
|
235
|
+
string name = 3;
|
|
236
|
+
string description = 4;
|
|
237
|
+
string price = 5;
|
|
238
|
+
string discount_percent = 6;
|
|
239
|
+
string final_price = 7;
|
|
240
|
+
repeated string tags = 8;
|
|
241
|
+
repeated string category_ids = 9;
|
|
242
|
+
repeated string application_ids = 10;
|
|
243
|
+
string currency = 11; // RUB | USD | EUR; empty → no change
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
message QueryProductsRequest {
|
|
247
|
+
string search = 1;
|
|
248
|
+
repeated string category_ids = 2;
|
|
249
|
+
repeated string application_ids = 3;
|
|
250
|
+
repeated string tags = 4;
|
|
251
|
+
string min_price = 5;
|
|
252
|
+
string max_price = 6;
|
|
253
|
+
int32 page = 7;
|
|
254
|
+
int32 limit = 8;
|
|
255
|
+
string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
|
|
256
|
+
string sort_order = 10; // asc | desc
|
|
257
|
+
ProductStatus status = 11;
|
|
258
258
|
ModerationStatus moderation_status = 12;
|
|
259
259
|
bool deleted_only = 13; // owner-only list filter; used by /products/my?status=deleted
|
|
260
260
|
string seller_user_id = 14; // admin/public filter by Product.userId
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
message FindMyRequest {
|
|
264
|
-
string user_id = 1;
|
|
265
|
-
QueryProductsRequest query = 2;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
message FindOneRequest {
|
|
269
|
-
string id = 1;
|
|
270
|
-
string viewer_user_id = 2; // optional — to compute is_favorited etc.
|
|
271
|
-
string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
message RemoveProductRequest {
|
|
275
|
-
string id = 1;
|
|
276
|
-
string user_id = 2;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
message RestoreProductRequest {
|
|
280
|
-
string id = 1;
|
|
281
|
-
string user_id = 2;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
message SubmitForModerationRequest {
|
|
285
|
-
string id = 1;
|
|
286
|
-
string user_id = 2;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
message PriceRangeResponse {
|
|
290
|
-
string min = 1; // Decimal as string
|
|
291
|
-
string max = 2;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// =================================================================
|
|
295
|
-
// Favorites
|
|
296
|
-
// =================================================================
|
|
297
|
-
|
|
298
|
-
message FavoriteRequest {
|
|
299
|
-
string user_id = 1;
|
|
300
|
-
string product_id = 2;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// =================================================================
|
|
304
|
-
// Media / Attachments metadata
|
|
305
|
-
// =================================================================
|
|
306
|
-
|
|
262
|
+
|
|
263
|
+
message FindMyRequest {
|
|
264
|
+
string user_id = 1;
|
|
265
|
+
QueryProductsRequest query = 2;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
message FindOneRequest {
|
|
269
|
+
string id = 1;
|
|
270
|
+
string viewer_user_id = 2; // optional — to compute is_favorited etc.
|
|
271
|
+
string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
message RemoveProductRequest {
|
|
275
|
+
string id = 1;
|
|
276
|
+
string user_id = 2;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
message RestoreProductRequest {
|
|
280
|
+
string id = 1;
|
|
281
|
+
string user_id = 2;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
message SubmitForModerationRequest {
|
|
285
|
+
string id = 1;
|
|
286
|
+
string user_id = 2;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
message PriceRangeResponse {
|
|
290
|
+
string min = 1; // Decimal as string
|
|
291
|
+
string max = 2;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// =================================================================
|
|
295
|
+
// Favorites
|
|
296
|
+
// =================================================================
|
|
297
|
+
|
|
298
|
+
message FavoriteRequest {
|
|
299
|
+
string user_id = 1;
|
|
300
|
+
string product_id = 2;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// =================================================================
|
|
304
|
+
// Media / Attachments metadata
|
|
305
|
+
// =================================================================
|
|
306
|
+
|
|
307
307
|
message MediaFile {
|
|
308
308
|
reserved 1, 2;
|
|
309
309
|
string file_name = 3;
|
|
@@ -311,14 +311,14 @@ message MediaFile {
|
|
|
311
311
|
string mime_type = 5;
|
|
312
312
|
string storage_key = 6;
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
message SaveMediaMetadataRequest {
|
|
316
|
-
string id = 1;
|
|
317
|
-
string user_id = 2;
|
|
318
|
-
repeated MediaFile files = 3;
|
|
319
|
-
string upload_id = 4;
|
|
320
|
-
}
|
|
321
|
-
|
|
314
|
+
|
|
315
|
+
message SaveMediaMetadataRequest {
|
|
316
|
+
string id = 1;
|
|
317
|
+
string user_id = 2;
|
|
318
|
+
repeated MediaFile files = 3;
|
|
319
|
+
string upload_id = 4;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
322
|
message AttachmentMeta {
|
|
323
323
|
reserved 1;
|
|
324
324
|
string storage_key = 2;
|
|
@@ -326,107 +326,107 @@ message AttachmentMeta {
|
|
|
326
326
|
double file_size = 4;
|
|
327
327
|
string mime_type = 5;
|
|
328
328
|
}
|
|
329
|
-
|
|
330
|
-
message SaveAttachmentMetadataRequest {
|
|
331
|
-
string id = 1;
|
|
332
|
-
string user_id = 2;
|
|
333
|
-
AttachmentMeta attachment = 3;
|
|
334
|
-
string upload_id = 4;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
message RemoveMediaRequest {
|
|
338
|
-
string id = 1; // product id
|
|
339
|
-
string user_id = 2;
|
|
340
|
-
string media_id = 3;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
message RemoveAttachmentRequest {
|
|
344
|
-
string id = 1; // product id
|
|
345
|
-
string user_id = 2;
|
|
346
|
-
string attachment_id = 3;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
// =================================================================
|
|
350
|
-
// Moderation
|
|
351
|
-
// =================================================================
|
|
352
|
-
|
|
353
|
-
message ProductModerationQueryRequest {
|
|
354
|
-
ModerationStatus status = 1;
|
|
355
|
-
int32 page = 2;
|
|
356
|
-
int32 limit = 3;
|
|
357
|
-
string sort_by = 4;
|
|
358
|
-
string sort_order = 5;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
message ModerateProductRequest {
|
|
362
|
-
string product_id = 1;
|
|
363
|
-
string moderator_id = 2;
|
|
364
|
-
string action = 3; // 'approve' | 'reject'
|
|
365
|
-
string comment = 4;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
message ModerationResponse {
|
|
369
|
-
bool success = 1;
|
|
370
|
-
string message = 2;
|
|
371
|
-
Product product = 3;
|
|
372
|
-
ModerationStatus moderation_status = 4;
|
|
373
|
-
string moderation_comment = 5;
|
|
374
|
-
string moderated_by = 6;
|
|
375
|
-
string moderated_at = 7;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
message ResubmitProductRequest {
|
|
379
|
-
string product_id = 1;
|
|
380
|
-
string user_id = 2;
|
|
381
|
-
string comment = 3;
|
|
382
|
-
// Free-form payload of changes — serialized as JSON string to keep the
|
|
383
|
-
// legacy `any` shape without forcing a strict schema on a free-form patch.
|
|
384
|
-
string changes_json = 4;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// =================================================================
|
|
388
|
-
// Secure downloads
|
|
389
|
-
// =================================================================
|
|
390
|
-
|
|
391
|
-
message GetSecureDownloadLinksRequest {
|
|
392
|
-
string product_id = 1;
|
|
393
|
-
string user_id = 2;
|
|
394
|
-
int32 expires_in = 3;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
message SecureDownloadLink {
|
|
398
|
-
string download_url = 1;
|
|
399
|
-
int32 expires_in = 2;
|
|
400
|
-
string file_name = 3;
|
|
401
|
-
double file_size = 4;
|
|
402
|
-
string attachment_id = 5;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
message SecureDownloadLinksResponse {
|
|
406
|
-
repeated SecureDownloadLink links = 1;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
message GetAttachmentDownloadInfoRequest {
|
|
410
|
-
string product_id = 1;
|
|
411
|
-
string attachment_id = 2;
|
|
412
|
-
string user_id = 3;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
message AttachmentDownloadInfoResponse {
|
|
416
|
-
string file_name = 1;
|
|
417
|
-
double file_size = 2;
|
|
418
|
-
string content_type = 3;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
message GetAttachmentDownloadUrlRequest {
|
|
422
|
-
string product_id = 1;
|
|
423
|
-
string attachment_id = 2;
|
|
424
|
-
string user_id = 3;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
message AttachmentDownloadUrlResponse {
|
|
428
|
-
string download_url = 1;
|
|
429
|
-
int32 expires_in = 2;
|
|
430
|
-
string file_name = 3;
|
|
431
|
-
double file_size = 4;
|
|
432
|
-
}
|
|
329
|
+
|
|
330
|
+
message SaveAttachmentMetadataRequest {
|
|
331
|
+
string id = 1;
|
|
332
|
+
string user_id = 2;
|
|
333
|
+
AttachmentMeta attachment = 3;
|
|
334
|
+
string upload_id = 4;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
message RemoveMediaRequest {
|
|
338
|
+
string id = 1; // product id
|
|
339
|
+
string user_id = 2;
|
|
340
|
+
string media_id = 3;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
message RemoveAttachmentRequest {
|
|
344
|
+
string id = 1; // product id
|
|
345
|
+
string user_id = 2;
|
|
346
|
+
string attachment_id = 3;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// =================================================================
|
|
350
|
+
// Moderation
|
|
351
|
+
// =================================================================
|
|
352
|
+
|
|
353
|
+
message ProductModerationQueryRequest {
|
|
354
|
+
ModerationStatus status = 1;
|
|
355
|
+
int32 page = 2;
|
|
356
|
+
int32 limit = 3;
|
|
357
|
+
string sort_by = 4;
|
|
358
|
+
string sort_order = 5;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
message ModerateProductRequest {
|
|
362
|
+
string product_id = 1;
|
|
363
|
+
string moderator_id = 2;
|
|
364
|
+
string action = 3; // 'approve' | 'reject'
|
|
365
|
+
string comment = 4;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
message ModerationResponse {
|
|
369
|
+
bool success = 1;
|
|
370
|
+
string message = 2;
|
|
371
|
+
Product product = 3;
|
|
372
|
+
ModerationStatus moderation_status = 4;
|
|
373
|
+
string moderation_comment = 5;
|
|
374
|
+
string moderated_by = 6;
|
|
375
|
+
string moderated_at = 7;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
message ResubmitProductRequest {
|
|
379
|
+
string product_id = 1;
|
|
380
|
+
string user_id = 2;
|
|
381
|
+
string comment = 3;
|
|
382
|
+
// Free-form payload of changes — serialized as JSON string to keep the
|
|
383
|
+
// legacy `any` shape without forcing a strict schema on a free-form patch.
|
|
384
|
+
string changes_json = 4;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// =================================================================
|
|
388
|
+
// Secure downloads
|
|
389
|
+
// =================================================================
|
|
390
|
+
|
|
391
|
+
message GetSecureDownloadLinksRequest {
|
|
392
|
+
string product_id = 1;
|
|
393
|
+
string user_id = 2;
|
|
394
|
+
int32 expires_in = 3;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
message SecureDownloadLink {
|
|
398
|
+
string download_url = 1;
|
|
399
|
+
int32 expires_in = 2;
|
|
400
|
+
string file_name = 3;
|
|
401
|
+
double file_size = 4;
|
|
402
|
+
string attachment_id = 5;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
message SecureDownloadLinksResponse {
|
|
406
|
+
repeated SecureDownloadLink links = 1;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message GetAttachmentDownloadInfoRequest {
|
|
410
|
+
string product_id = 1;
|
|
411
|
+
string attachment_id = 2;
|
|
412
|
+
string user_id = 3;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
message AttachmentDownloadInfoResponse {
|
|
416
|
+
string file_name = 1;
|
|
417
|
+
double file_size = 2;
|
|
418
|
+
string content_type = 3;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
message GetAttachmentDownloadUrlRequest {
|
|
422
|
+
string product_id = 1;
|
|
423
|
+
string attachment_id = 2;
|
|
424
|
+
string user_id = 3;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
message AttachmentDownloadUrlResponse {
|
|
428
|
+
string download_url = 1;
|
|
429
|
+
int32 expires_in = 2;
|
|
430
|
+
string file_name = 3;
|
|
431
|
+
double file_size = 4;
|
|
432
|
+
}
|