@aepstore-dev/contracts 1.0.6 → 1.2.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/dist/proto/paths.d.ts +15 -0
- package/dist/proto/paths.js +18 -2
- package/gen/activity.ts +281 -0
- package/gen/auth.ts +164 -19
- package/gen/mail.ts +91 -0
- package/gen/products.ts +452 -0
- package/gen/taxonomy.ts +131 -0
- package/gen/upload.ts +217 -0
- package/gen/users.ts +269 -0
- package/package.json +8 -5
- package/proto/activity.proto +201 -0
- package/proto/auth.proto +101 -18
- package/proto/mail.proto +42 -0
- package/proto/products.proto +327 -0
- package/proto/taxonomy.proto +78 -0
- package/proto/upload.proto +135 -0
- package/proto/users.proto +222 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package upload.v1;
|
|
4
|
+
|
|
5
|
+
// Thin signing service. File bytes NEVER pass through this service — clients
|
|
6
|
+
// upload/download directly to/from S3 (Yandex Object Storage) using presigned
|
|
7
|
+
// URLs this service mints. Memory/bandwidth flat regardless of file size.
|
|
8
|
+
//
|
|
9
|
+
// Large files (product deliverables, up to ~1GB) use the multipart flow:
|
|
10
|
+
// CreateMultipartUpload → (SignPart × N, client PUTs each part to S3) →
|
|
11
|
+
// CompleteMultipartUpload (or AbortMultipartUpload on failure)
|
|
12
|
+
//
|
|
13
|
+
// Small files (preview images, avatars) use the single-PUT flow: CreateUploadUrl.
|
|
14
|
+
//
|
|
15
|
+
// Downloads are gated elsewhere (products-service verifies purchase, then calls
|
|
16
|
+
// GenerateSignedUrl). This service does not know about purchases.
|
|
17
|
+
service UploadService {
|
|
18
|
+
rpc CreateMultipartUpload(CreateMultipartUploadRequest) returns (CreateMultipartUploadResponse);
|
|
19
|
+
rpc SignPart(SignPartRequest) returns (SignPartResponse);
|
|
20
|
+
rpc CompleteMultipartUpload(CompleteMultipartUploadRequest) returns (CompleteMultipartUploadResponse);
|
|
21
|
+
rpc AbortMultipartUpload(AbortMultipartUploadRequest) returns (Ok);
|
|
22
|
+
|
|
23
|
+
rpc CreateUploadUrl(CreateUploadUrlRequest) returns (CreateUploadUrlResponse);
|
|
24
|
+
|
|
25
|
+
rpc GenerateSignedUrl(SignedUrlRequest) returns (SignedUrlResponse);
|
|
26
|
+
|
|
27
|
+
rpc DeleteObject(DeleteObjectRequest) returns (Ok);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Determines the object key prefix (and future ACL/privacy policy).
|
|
31
|
+
// ATTACHMENT = paid product deliverable (private; presigned GET only after purchase).
|
|
32
|
+
// MEDIA / AVATAR / BANNER = preview assets.
|
|
33
|
+
enum UploadKind {
|
|
34
|
+
UPLOAD_KIND_UNSPECIFIED = 0;
|
|
35
|
+
UPLOAD_KIND_ATTACHMENT = 1;
|
|
36
|
+
UPLOAD_KIND_MEDIA = 2;
|
|
37
|
+
UPLOAD_KIND_AVATAR = 3;
|
|
38
|
+
UPLOAD_KIND_BANNER = 4;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message Ok {
|
|
42
|
+
bool ok = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Multipart upload (large files)
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
message CreateMultipartUploadRequest {
|
|
50
|
+
string file_name = 1;
|
|
51
|
+
string mime_type = 2;
|
|
52
|
+
int64 file_size = 3;
|
|
53
|
+
UploadKind kind = 4;
|
|
54
|
+
string owner_id = 5; // user initiating, for key namespacing + audit
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message CreateMultipartUploadResponse {
|
|
58
|
+
string upload_id = 1; // S3 multipart UploadId
|
|
59
|
+
string file_key = 2; // object key this service generated
|
|
60
|
+
int64 part_size = 3; // recommended part size (bytes) the client should slice with
|
|
61
|
+
int32 part_count = 4; // number of parts for file_size at part_size
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message SignPartRequest {
|
|
65
|
+
string file_key = 1;
|
|
66
|
+
string upload_id = 2;
|
|
67
|
+
int32 part_number = 3; // 1-based
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message SignPartResponse {
|
|
71
|
+
string url = 1; // presigned PUT URL for this single part
|
|
72
|
+
int32 expires_in = 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message CompletedPart {
|
|
76
|
+
int32 part_number = 1;
|
|
77
|
+
string etag = 2; // ETag the client received in the S3 PUT response header for this part
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message CompleteMultipartUploadRequest {
|
|
81
|
+
string file_key = 1;
|
|
82
|
+
string upload_id = 2;
|
|
83
|
+
repeated CompletedPart parts = 3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message CompleteMultipartUploadResponse {
|
|
87
|
+
string file_key = 1;
|
|
88
|
+
string location = 2; // final object location (internal reference)
|
|
89
|
+
int64 file_size = 3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message AbortMultipartUploadRequest {
|
|
93
|
+
string file_key = 1;
|
|
94
|
+
string upload_id = 2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Single-PUT upload (small files)
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
message CreateUploadUrlRequest {
|
|
102
|
+
string file_name = 1;
|
|
103
|
+
string mime_type = 2;
|
|
104
|
+
UploadKind kind = 3;
|
|
105
|
+
string owner_id = 4;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message CreateUploadUrlResponse {
|
|
109
|
+
string url = 1; // presigned PUT URL (client PUTs the whole file)
|
|
110
|
+
string file_key = 2;
|
|
111
|
+
int32 expires_in = 3;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
115
|
+
// Download
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
|
|
118
|
+
message SignedUrlRequest {
|
|
119
|
+
string file_key = 1;
|
|
120
|
+
int32 expires_in = 2; // optional, default 3600
|
|
121
|
+
string download_file_name = 3; // optional: forces Content-Disposition attachment filename
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message SignedUrlResponse {
|
|
125
|
+
string signed_url = 1;
|
|
126
|
+
int32 expires_in = 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// Cleanup
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
|
|
133
|
+
message DeleteObjectRequest {
|
|
134
|
+
string file_key = 1;
|
|
135
|
+
}
|
|
@@ -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
|
+
}
|