@mediaryorg/contracts 1.0.8 → 2.0.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 +9 -0
- package/dist/proto/paths.js +9 -0
- package/generated/auth/v1/auth.ts +58 -51
- package/generated/collection/v1/collection.ts +235 -0
- package/generated/favorite/v1/favorite.ts +146 -0
- package/generated/image/v1/image.ts +140 -0
- package/generated/library/v1/library.ts +216 -0
- package/generated/media/v1/media.ts +294 -0
- package/generated/media_request/v1/media_request.ts +223 -0
- package/generated/profile/v1/profile.ts +73 -0
- package/generated/recommendation/v1/recommendation.ts +126 -0
- package/generated/search/v1/search.ts +103 -0
- package/generated/user/v1/user.ts +103 -2
- package/package.json +3 -3
- package/proto/auth/v1/auth.proto +56 -52
- package/proto/collection/v1/collection.proto +120 -0
- package/proto/favorite/v1/favorite.proto +79 -0
- package/proto/image/v1/image.proto +73 -0
- package/proto/library/v1/library.proto +144 -0
- package/proto/media/v1/media.proto +197 -0
- package/proto/media_request/v1/media_request.proto +142 -0
- package/proto/profile/v1/profile.proto +35 -0
- package/proto/recommendation/v1/recommendation.proto +60 -0
- package/proto/search/v1/search.proto +62 -0
- package/proto/user/v1/user.proto +66 -4
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -2,8 +2,6 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
-
import "user/v1/user.proto";
|
|
6
|
-
|
|
7
5
|
service AuthService {
|
|
8
6
|
rpc Register(RegisterRequest) returns (RegisterResponse);
|
|
9
7
|
|
|
@@ -25,58 +23,14 @@ service AuthService {
|
|
|
25
23
|
rpc AdminValidateSession(AdminValidateSessionRequest) returns (AdminValidateSessionResponse);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
string
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
message ConfirmEmailResponse {
|
|
35
|
-
user.v1.User user = 1;
|
|
36
|
-
string session_id = 2;
|
|
37
|
-
int64 max_age_ms = 3;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
message OauthCallbackResponse {
|
|
41
|
-
user.v1.User user = 1;
|
|
42
|
-
string session_id = 2;
|
|
43
|
-
int64 max_age_ms = 3;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message AdminLoginResponse {
|
|
47
|
-
user.v1.User user = 1;
|
|
48
|
-
string session_id = 2;
|
|
49
|
-
int64 max_age_ms = 3;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
message ValidateSessionResponse {
|
|
53
|
-
bool valid = 1;
|
|
54
|
-
user.v1.User user = 2;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
message AdminValidateSessionResponse {
|
|
58
|
-
bool valid = 1;
|
|
59
|
-
user.v1.User user = 2;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
message ResendVerificationResponse {
|
|
63
|
-
string message = 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message RequestPasswordResetResponse {
|
|
67
|
-
string message = 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message SetNewPasswordResponse {
|
|
71
|
-
string message = 1;
|
|
26
|
+
// Identity-only view of a user emitted by auth-service.
|
|
27
|
+
message AuthUser {
|
|
28
|
+
string id = 1;
|
|
29
|
+
string email = 2;
|
|
30
|
+
string role = 3;
|
|
31
|
+
bool is_verified = 4;
|
|
72
32
|
}
|
|
73
33
|
|
|
74
|
-
message LogoutResponse {}
|
|
75
|
-
|
|
76
|
-
message AdminLogoutResponse {}
|
|
77
|
-
|
|
78
|
-
// --- Requests ---
|
|
79
|
-
|
|
80
34
|
message RegisterRequest {
|
|
81
35
|
string name = 1;
|
|
82
36
|
string email = 2;
|
|
@@ -94,33 +48,64 @@ message LoginRequest {
|
|
|
94
48
|
string password = 2;
|
|
95
49
|
}
|
|
96
50
|
|
|
51
|
+
message LoginResponse {
|
|
52
|
+
AuthUser user = 1;
|
|
53
|
+
string session_id = 2;
|
|
54
|
+
int64 max_age_ms = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
97
57
|
message LogoutRequest {
|
|
98
58
|
string session_id = 1;
|
|
99
59
|
}
|
|
100
60
|
|
|
61
|
+
message LogoutResponse {}
|
|
62
|
+
|
|
101
63
|
message ValidateSessionRequest {
|
|
102
64
|
string session_id = 1;
|
|
103
65
|
}
|
|
104
66
|
|
|
67
|
+
message ValidateSessionResponse {
|
|
68
|
+
bool valid = 1;
|
|
69
|
+
AuthUser user = 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
105
72
|
message ConfirmEmailRequest {
|
|
106
73
|
string email = 1;
|
|
107
74
|
string code = 2;
|
|
108
75
|
}
|
|
109
76
|
|
|
77
|
+
message ConfirmEmailResponse {
|
|
78
|
+
AuthUser user = 1;
|
|
79
|
+
string session_id = 2;
|
|
80
|
+
int64 max_age_ms = 3;
|
|
81
|
+
}
|
|
82
|
+
|
|
110
83
|
message ResendVerificationRequest {
|
|
111
84
|
string email = 1;
|
|
112
85
|
}
|
|
113
86
|
|
|
87
|
+
message ResendVerificationResponse {
|
|
88
|
+
string message = 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
114
91
|
message RequestPasswordResetRequest {
|
|
115
92
|
string email = 1;
|
|
116
93
|
}
|
|
117
94
|
|
|
95
|
+
message RequestPasswordResetResponse {
|
|
96
|
+
string message = 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
118
99
|
message SetNewPasswordRequest {
|
|
119
100
|
string email = 1;
|
|
120
101
|
string code = 2;
|
|
121
102
|
string password = 3;
|
|
122
103
|
}
|
|
123
104
|
|
|
105
|
+
message SetNewPasswordResponse {
|
|
106
|
+
string message = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
124
109
|
message OauthConnectRequest {
|
|
125
110
|
string provider = 1;
|
|
126
111
|
}
|
|
@@ -135,15 +120,34 @@ message OauthCallbackRequest {
|
|
|
135
120
|
string state = 3;
|
|
136
121
|
}
|
|
137
122
|
|
|
123
|
+
message OauthCallbackResponse {
|
|
124
|
+
AuthUser user = 1;
|
|
125
|
+
string session_id = 2;
|
|
126
|
+
int64 max_age_ms = 3;
|
|
127
|
+
}
|
|
128
|
+
|
|
138
129
|
message AdminLoginRequest {
|
|
139
130
|
string email = 1;
|
|
140
131
|
string password = 2;
|
|
141
132
|
}
|
|
142
133
|
|
|
134
|
+
message AdminLoginResponse {
|
|
135
|
+
AuthUser user = 1;
|
|
136
|
+
string session_id = 2;
|
|
137
|
+
int64 max_age_ms = 3;
|
|
138
|
+
}
|
|
139
|
+
|
|
143
140
|
message AdminLogoutRequest {
|
|
144
141
|
string session_id = 1;
|
|
145
142
|
}
|
|
146
143
|
|
|
144
|
+
message AdminLogoutResponse {}
|
|
145
|
+
|
|
147
146
|
message AdminValidateSessionRequest {
|
|
148
147
|
string session_id = 1;
|
|
149
148
|
}
|
|
149
|
+
|
|
150
|
+
message AdminValidateSessionResponse {
|
|
151
|
+
bool valid = 1;
|
|
152
|
+
AuthUser user = 2;
|
|
153
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package collection.v1;
|
|
4
|
+
|
|
5
|
+
service CollectionService {
|
|
6
|
+
// Global catalog of media collections (Movies, Series, Books, ...).
|
|
7
|
+
rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse);
|
|
8
|
+
rpc GetCollectionById(GetCollectionByIdRequest) returns (GetCollectionByIdResponse);
|
|
9
|
+
rpc GetCollectionByName(GetCollectionByNameRequest) returns (GetCollectionByNameResponse);
|
|
10
|
+
rpc SeedInitialCollections(SeedInitialCollectionsRequest) returns (SeedInitialCollectionsResponse);
|
|
11
|
+
|
|
12
|
+
// Per-user enabled collections.
|
|
13
|
+
rpc GetUserCollections(GetUserCollectionsRequest) returns (GetUserCollectionsResponse);
|
|
14
|
+
rpc GetAllCollectionsWithUserStatus(GetAllCollectionsWithUserStatusRequest) returns (GetAllCollectionsWithUserStatusResponse);
|
|
15
|
+
rpc GetAvailableCollections(GetAvailableCollectionsRequest) returns (GetAvailableCollectionsResponse);
|
|
16
|
+
rpc AddCollectionToUser(AddCollectionToUserRequest) returns (AddCollectionToUserResponse);
|
|
17
|
+
rpc RemoveCollectionFromUser(RemoveCollectionFromUserRequest) returns (RemoveCollectionFromUserResponse);
|
|
18
|
+
rpc InitializeDefaultCollections(InitializeDefaultCollectionsRequest) returns (InitializeDefaultCollectionsResponse);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message Collection {
|
|
22
|
+
string id = 1;
|
|
23
|
+
string name = 2;
|
|
24
|
+
string created_at = 3;
|
|
25
|
+
string updated_at = 4;
|
|
26
|
+
// Number of Media records linked to the collection (returned by list/get).
|
|
27
|
+
int32 media_count = 5;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message CollectionWithUserStatus {
|
|
31
|
+
Collection collection = 1;
|
|
32
|
+
bool is_added = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message UserCollection {
|
|
36
|
+
string id = 1;
|
|
37
|
+
string user_id = 2;
|
|
38
|
+
string collection_id = 3;
|
|
39
|
+
Collection collection = 4;
|
|
40
|
+
string created_at = 5;
|
|
41
|
+
string updated_at = 6;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message ListCollectionsRequest {}
|
|
45
|
+
|
|
46
|
+
message ListCollectionsResponse {
|
|
47
|
+
repeated Collection items = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message GetCollectionByIdRequest {
|
|
51
|
+
string collection_id = 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message GetCollectionByIdResponse {
|
|
55
|
+
Collection collection = 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message GetCollectionByNameRequest {
|
|
59
|
+
string name = 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message GetCollectionByNameResponse {
|
|
63
|
+
Collection collection = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message SeedInitialCollectionsRequest {}
|
|
67
|
+
|
|
68
|
+
message SeedInitialCollectionsResponse {
|
|
69
|
+
repeated Collection items = 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message GetUserCollectionsRequest {
|
|
73
|
+
string user_id = 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message GetUserCollectionsResponse {
|
|
77
|
+
repeated Collection items = 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message GetAllCollectionsWithUserStatusRequest {
|
|
81
|
+
string user_id = 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message GetAllCollectionsWithUserStatusResponse {
|
|
85
|
+
repeated CollectionWithUserStatus items = 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message GetAvailableCollectionsRequest {
|
|
89
|
+
string user_id = 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message GetAvailableCollectionsResponse {
|
|
93
|
+
repeated Collection items = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message AddCollectionToUserRequest {
|
|
97
|
+
string user_id = 1;
|
|
98
|
+
string collection_id = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message AddCollectionToUserResponse {
|
|
102
|
+
UserCollection user_collection = 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message RemoveCollectionFromUserRequest {
|
|
106
|
+
string user_id = 1;
|
|
107
|
+
string collection_id = 2;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message RemoveCollectionFromUserResponse {
|
|
111
|
+
string collection_id = 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message InitializeDefaultCollectionsRequest {
|
|
115
|
+
string user_id = 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message InitializeDefaultCollectionsResponse {
|
|
119
|
+
repeated UserCollection items = 1;
|
|
120
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package favorite.v1;
|
|
4
|
+
|
|
5
|
+
service FavoriteService {
|
|
6
|
+
rpc CheckMultipleFavorites(CheckMultipleFavoritesRequest) returns (CheckMultipleFavoritesResponse);
|
|
7
|
+
rpc ToggleFavorite(ToggleFavoriteRequest) returns (ToggleFavoriteResponse);
|
|
8
|
+
rpc IsFavorite(IsFavoriteRequest) returns (IsFavoriteResponse);
|
|
9
|
+
rpc ListUserFavorites(ListUserFavoritesRequest) returns (ListUserFavoritesResponse);
|
|
10
|
+
rpc RemoveAllForMedia(RemoveAllForMediaRequest) returns (RemoveAllForMediaResponse);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message Favorite {
|
|
14
|
+
string id = 1;
|
|
15
|
+
string user_id = 2;
|
|
16
|
+
string media_id = 3;
|
|
17
|
+
string created_at = 4;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message CheckMultipleFavoritesRequest {
|
|
21
|
+
string user_id = 1;
|
|
22
|
+
repeated string media_ids = 2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// `results` is a `media_id -> bool` map (matches the legacy REST shape).
|
|
26
|
+
message CheckMultipleFavoritesResponse {
|
|
27
|
+
map<string, bool> results = 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message ToggleFavoriteRequest {
|
|
31
|
+
string user_id = 1;
|
|
32
|
+
string media_id = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ToggleFavoriteResponse {
|
|
36
|
+
bool is_in_favorites = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message IsFavoriteRequest {
|
|
40
|
+
string user_id = 1;
|
|
41
|
+
string media_id = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message IsFavoriteResponse {
|
|
45
|
+
bool is_in_favorites = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message ListUserFavoritesRequest {
|
|
49
|
+
string user_id = 1;
|
|
50
|
+
optional string search = 2;
|
|
51
|
+
optional string collection_id = 3;
|
|
52
|
+
int32 page = 4;
|
|
53
|
+
int32 limit = 5;
|
|
54
|
+
string sort_by = 6;
|
|
55
|
+
string sort_order = 7;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message FavoritePaginationMeta {
|
|
59
|
+
int32 page = 1;
|
|
60
|
+
int32 limit = 2;
|
|
61
|
+
int32 total = 3;
|
|
62
|
+
int32 total_pages = 4;
|
|
63
|
+
bool has_next_page = 5;
|
|
64
|
+
bool has_prev_page = 6;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message ListUserFavoritesResponse {
|
|
68
|
+
repeated Favorite data = 1;
|
|
69
|
+
FavoritePaginationMeta meta = 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Used as a side-effect by library/media when content disappears.
|
|
73
|
+
message RemoveAllForMediaRequest {
|
|
74
|
+
string media_id = 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message RemoveAllForMediaResponse {
|
|
78
|
+
int32 removed_count = 1;
|
|
79
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package image.v1;
|
|
4
|
+
|
|
5
|
+
service ImageService {
|
|
6
|
+
// Returns the binary image (proxied + optionally resized).
|
|
7
|
+
// Useful when the gateway streams it back to the client. Size hints are
|
|
8
|
+
// advisory; the implementation may ignore them.
|
|
9
|
+
rpc ProxyImage(ProxyImageRequest) returns (ProxyImageResponse);
|
|
10
|
+
|
|
11
|
+
// Resolves a TMDB poster path (e.g. "/abc.jpg") to an absolute URL.
|
|
12
|
+
rpc GetTmdbPosterUrl(GetTmdbPosterUrlRequest) returns (GetTmdbPosterUrlResponse);
|
|
13
|
+
|
|
14
|
+
// Uploads a single image to object storage (R2) and returns its public URL.
|
|
15
|
+
rpc UploadImage(UploadImageRequest) returns (UploadImageResponse);
|
|
16
|
+
|
|
17
|
+
// Removes an image from object storage by its public URL or key.
|
|
18
|
+
rpc DeleteImage(DeleteImageRequest) returns (DeleteImageResponse);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// TMDB poster size variants accepted by the legacy controller.
|
|
22
|
+
enum TmdbPosterSize {
|
|
23
|
+
TMDB_POSTER_SIZE_UNSPECIFIED = 0;
|
|
24
|
+
TMDB_POSTER_SIZE_W92 = 1;
|
|
25
|
+
TMDB_POSTER_SIZE_W154 = 2;
|
|
26
|
+
TMDB_POSTER_SIZE_W185 = 3;
|
|
27
|
+
TMDB_POSTER_SIZE_W342 = 4;
|
|
28
|
+
TMDB_POSTER_SIZE_W500 = 5;
|
|
29
|
+
TMDB_POSTER_SIZE_W780 = 6;
|
|
30
|
+
TMDB_POSTER_SIZE_ORIGINAL = 7;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message ProxyImageRequest {
|
|
34
|
+
string url = 1;
|
|
35
|
+
optional int32 width = 2;
|
|
36
|
+
optional int32 height = 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message ProxyImageResponse {
|
|
40
|
+
bytes data = 1;
|
|
41
|
+
string content_type = 2;
|
|
42
|
+
int64 content_length = 3;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetTmdbPosterUrlRequest {
|
|
46
|
+
string poster_path = 1;
|
|
47
|
+
TmdbPosterSize size = 2;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message GetTmdbPosterUrlResponse {
|
|
51
|
+
string url = 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message UploadImageRequest {
|
|
55
|
+
// Raw file bytes. Allowed mime types: image/jpeg, image/png, image/webp.
|
|
56
|
+
// Max size: 4 MiB.
|
|
57
|
+
bytes data = 1;
|
|
58
|
+
string original_name = 2;
|
|
59
|
+
string mime_type = 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message UploadImageResponse {
|
|
63
|
+
string url = 1;
|
|
64
|
+
string original_name = 2;
|
|
65
|
+
int64 size = 3;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message DeleteImageRequest {
|
|
69
|
+
// Either a full URL (with public-host prefix) or just the storage key.
|
|
70
|
+
string url_or_key = 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message DeleteImageResponse {}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package library.v1;
|
|
4
|
+
|
|
5
|
+
import "media/v1/media.proto";
|
|
6
|
+
|
|
7
|
+
service LibraryService {
|
|
8
|
+
rpc AddFromSearch(AddFromSearchRequest) returns (AddFromSearchResponse);
|
|
9
|
+
rpc GetUserLibrary(GetUserLibraryRequest) returns (GetUserLibraryResponse);
|
|
10
|
+
rpc GetLibraryItem(GetLibraryItemRequest) returns (GetLibraryItemResponse);
|
|
11
|
+
rpc UpdateLibraryItem(UpdateLibraryItemRequest) returns (UpdateLibraryItemResponse);
|
|
12
|
+
rpc RemoveFromLibrary(RemoveFromLibraryRequest) returns (RemoveFromLibraryResponse);
|
|
13
|
+
rpc IsInLibrary(IsInLibraryRequest) returns (IsInLibraryResponse);
|
|
14
|
+
rpc GetGenres(GetGenresRequest) returns (GetGenresResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Mirrors prisma enum Status (PLANNED/IN_PROGRESS/COMPLETED/DROPPED).
|
|
18
|
+
enum LibraryItemStatus {
|
|
19
|
+
LIBRARY_ITEM_STATUS_UNSPECIFIED = 0;
|
|
20
|
+
LIBRARY_ITEM_STATUS_PLANNED = 1;
|
|
21
|
+
LIBRARY_ITEM_STATUS_IN_PROGRESS = 2;
|
|
22
|
+
LIBRARY_ITEM_STATUS_COMPLETED = 3;
|
|
23
|
+
LIBRARY_ITEM_STATUS_DROPPED = 4;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message LibraryItem {
|
|
27
|
+
string id = 1;
|
|
28
|
+
string user_id = 2;
|
|
29
|
+
string media_id = 3;
|
|
30
|
+
LibraryItemStatus status = 4;
|
|
31
|
+
optional double rating = 5;
|
|
32
|
+
optional string notes = 6;
|
|
33
|
+
string added_at = 7;
|
|
34
|
+
string updated_at = 8;
|
|
35
|
+
// Embedded media snapshot for the read paths (denormalized view).
|
|
36
|
+
media.v1.Media media = 9;
|
|
37
|
+
// Pre-aggregated counts to avoid extra round-trips on the gateway side.
|
|
38
|
+
int32 library_count = 10;
|
|
39
|
+
int32 reviews_count = 11;
|
|
40
|
+
bool is_favorite = 12;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Compact search hit accepted by AddFromSearch (mirrors AddFromSearchDto.searchResult).
|
|
44
|
+
message LibrarySearchHit {
|
|
45
|
+
string id = 1;
|
|
46
|
+
string title = 2;
|
|
47
|
+
optional string subtitle = 3;
|
|
48
|
+
optional string image_url = 4;
|
|
49
|
+
optional string year = 5;
|
|
50
|
+
string type = 6;
|
|
51
|
+
string source = 7;
|
|
52
|
+
optional string external_id = 8;
|
|
53
|
+
optional double rating = 9;
|
|
54
|
+
repeated string genres = 10;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message AddFromSearchRequest {
|
|
58
|
+
string user_id = 1;
|
|
59
|
+
LibrarySearchHit search_result = 2;
|
|
60
|
+
optional LibraryItemStatus status = 3;
|
|
61
|
+
optional double rating = 4;
|
|
62
|
+
optional string notes = 5;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message AddFromSearchResponse {
|
|
66
|
+
LibraryItem item = 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message GetUserLibraryRequest {
|
|
70
|
+
string user_id = 1;
|
|
71
|
+
repeated LibraryItemStatus statuses = 2;
|
|
72
|
+
optional string collection_name = 3;
|
|
73
|
+
optional media.v1.MediaSource source = 4;
|
|
74
|
+
optional string search = 5;
|
|
75
|
+
repeated string genres = 6;
|
|
76
|
+
optional double min_rating = 7;
|
|
77
|
+
optional double max_rating = 8;
|
|
78
|
+
optional int32 min_year = 9;
|
|
79
|
+
optional int32 max_year = 10;
|
|
80
|
+
int32 page = 11;
|
|
81
|
+
int32 limit = 12;
|
|
82
|
+
// addedAt | rating | title | releaseYear | favorites
|
|
83
|
+
string sort_by = 13;
|
|
84
|
+
string sort_order = 14;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message LibraryPaginationMeta {
|
|
88
|
+
int32 page = 1;
|
|
89
|
+
int32 limit = 2;
|
|
90
|
+
int32 total = 3;
|
|
91
|
+
int32 total_pages = 4;
|
|
92
|
+
bool has_next_page = 5;
|
|
93
|
+
bool has_prev_page = 6;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message GetUserLibraryResponse {
|
|
97
|
+
repeated LibraryItem data = 1;
|
|
98
|
+
LibraryPaginationMeta meta = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message GetLibraryItemRequest {
|
|
102
|
+
string user_id = 1;
|
|
103
|
+
string media_id = 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message GetLibraryItemResponse {
|
|
107
|
+
LibraryItem item = 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message UpdateLibraryItemRequest {
|
|
111
|
+
string user_id = 1;
|
|
112
|
+
string media_id = 2;
|
|
113
|
+
optional LibraryItemStatus status = 3;
|
|
114
|
+
optional double rating = 4;
|
|
115
|
+
optional string notes = 5;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message UpdateLibraryItemResponse {
|
|
119
|
+
LibraryItem item = 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message RemoveFromLibraryRequest {
|
|
123
|
+
string user_id = 1;
|
|
124
|
+
string media_id = 2;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
message RemoveFromLibraryResponse {}
|
|
128
|
+
|
|
129
|
+
message IsInLibraryRequest {
|
|
130
|
+
string user_id = 1;
|
|
131
|
+
string media_id = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message IsInLibraryResponse {
|
|
135
|
+
bool is_in_library = 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
message GetGenresRequest {
|
|
139
|
+
string user_id = 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
message GetGenresResponse {
|
|
143
|
+
repeated string genres = 1;
|
|
144
|
+
}
|