Skip to content

Commit b8c4d03

Browse files
committed
Reworked API for listing the supported mime types
1 parent 8078210 commit b8c4d03

File tree

4 files changed

+53
-9446
lines changed

4 files changed

+53
-9446
lines changed

cs3/app/registry/v1beta1/registry_api.proto

+1-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ service RegistryAPI {
5757
rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
5858
// Returns a list of the available app providers known by this registry.
5959
rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
60-
// Returns a list of the supported mime types along with the apps which they can opened with.
60+
// Returns a list of the supported mime types along with the apps which they can be opened with.
6161
rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse);
6262
// Returns the default app provider which serves a specified mime type.
6363
rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
@@ -138,9 +138,6 @@ message ListSupportedMimeTypesResponse {
138138
// REQUIRED.
139139
// The list of supported mime types and their properties.
140140
MimeTypeList mime_types = 3;
141-
// REQUIRED.
142-
// The list of supported apps indexed by mime type.
143-
map<string, AppProviderList> apps = 4;
144141
}
145142

146143
message GetDefaultAppProviderForMimeTypeRequest {

cs3/app/registry/v1beta1/resources.proto

+16-12
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ message ProviderInfo {
5757
string name = 5;
5858
// OPTIONAL.
5959
// Information to describe the functionalities
60-
// offered by the app provider. Meant to be read
60+
// offered by the underlying app. Meant to be read
6161
// by humans.
6262
string description = 6;
6363
// OPTIONAL.
@@ -68,28 +68,32 @@ message ProviderInfo {
6868
bool desktop_only = 8;
6969
}
7070

71-
// Holds a list of app providers which can open a particular mime type.
72-
message AppProviderList {
73-
repeated ProviderInfo app_providers = 1;
74-
}
75-
7671
// Represents a mime type and its corresponding file extension.
77-
message MimeType {
72+
message MimeTypeInfo {
7873
// OPTIONAL.
7974
// Opaque information.
8075
cs3.types.v1beta1.Opaque opaque = 1;
8176
// REQUIRED.
8277
// The mime type.
8378
string mime_type = 2;
8479
// REQUIRED.
85-
// The friendly name of this mime type.
86-
string name = 3;
87-
// REQUIRED.
8880
// The file extension mapped to this mime type.
89-
string ext = 4;
81+
string ext = 3;
82+
// REQUIRED.
83+
// The list of app providers which can open this mime type
84+
repeated ProviderInfo app_providers = 4;
85+
// OPTIONAL.
86+
// The friendly name of this mime type.
87+
string name = 5;
88+
// OPTIONAL.
89+
// Human-readable information to describe the mime type.
90+
string description = 6;
91+
// OPTIONAL.
92+
// A URI to a static asset which represents the mime type icon.
93+
string icon = 7;
9094
}
9195

9296
// Holds a list of mime types.
9397
message MimeTypeList {
94-
repeated MimeType mime_types = 1;
98+
repeated MimeTypeInfo mime_types = 1;
9599
}

docs/index.html

+35-81
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,6 @@ <h2>Table of Contents</h2>
582582
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse"><span class="badge">M</span>ListSupportedMimeTypesResponse</a>
583583
</li>
584584

585-
<li>
586-
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry"><span class="badge">M</span>ListSupportedMimeTypesResponse.AppsEntry</a>
587-
</li>
588-
589585
<li>
590586
<a href="#cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest"><span class="badge">M</span>SetDefaultAppProviderForMimeTypeRequest</a>
591587
</li>
@@ -610,11 +606,7 @@ <h2>Table of Contents</h2>
610606
<ul>
611607

612608
<li>
613-
<a href="#cs3.app.registry.v1beta1.AppProviderList"><span class="badge">M</span>AppProviderList</a>
614-
</li>
615-
616-
<li>
617-
<a href="#cs3.app.registry.v1beta1.MimeType"><span class="badge">M</span>MimeType</a>
609+
<a href="#cs3.app.registry.v1beta1.MimeTypeInfo"><span class="badge">M</span>MimeTypeInfo</a>
618610
</li>
619611

620612
<li>
@@ -5639,45 +5631,6 @@ <h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMi
56395631
The list of supported mime types and their properties. </p></td>
56405632
</tr>
56415633

5642-
<tr>
5643-
<td>apps</td>
5644-
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry">ListSupportedMimeTypesResponse.AppsEntry</a></td>
5645-
<td>repeated</td>
5646-
<td><p>REQUIRED.
5647-
The list of supported apps indexed by mime type. </p></td>
5648-
</tr>
5649-
5650-
</tbody>
5651-
</table>
5652-
5653-
5654-
5655-
5656-
5657-
<h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry">ListSupportedMimeTypesResponse.AppsEntry</h3>
5658-
<p></p>
5659-
5660-
5661-
<table class="field-table">
5662-
<thead>
5663-
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
5664-
</thead>
5665-
<tbody>
5666-
5667-
<tr>
5668-
<td>key</td>
5669-
<td><a href="#string">string</a></td>
5670-
<td></td>
5671-
<td><p> </p></td>
5672-
</tr>
5673-
5674-
<tr>
5675-
<td>value</td>
5676-
<td><a href="#cs3.app.registry.v1beta1.AppProviderList">AppProviderList</a></td>
5677-
<td></td>
5678-
<td><p> </p></td>
5679-
</tr>
5680-
56815634
</tbody>
56825635
</table>
56835636

@@ -5792,14 +5745,15 @@ <h3 id="cs3.app.registry.v1beta1.RegistryAPI">RegistryAPI</h3>
57925745
<td>ListAppProviders</td>
57935746
<td><a href="#cs3.app.registry.v1beta1.ListAppProvidersRequest">ListAppProvidersRequest</a></td>
57945747
<td><a href="#cs3.app.registry.v1beta1.ListAppProvidersResponse">ListAppProvidersResponse</a></td>
5795-
<td><p>Returns a list of the available app providers known by this registry.</p></td>
5748+
<td><p>Registers a new mime type
5749+
Returns a list of the available app providers known by this registry.</p></td>
57965750
</tr>
57975751

57985752
<tr>
57995753
<td>ListSupportedMimeTypes</td>
58005754
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesRequest">ListSupportedMimeTypesRequest</a></td>
58015755
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMimeTypesResponse</a></td>
5802-
<td><p>Returns a list of the supported mime types along with the apps which they can opened with.</p></td>
5756+
<td><p>Returns a list of the supported mime types along with the apps which they can be opened with.</p></td>
58035757
</tr>
58045758

58055759
<tr>
@@ -5828,31 +5782,7 @@ <h2 id="cs3/app/registry/v1beta1/resources.proto">cs3/app/registry/v1beta1/resou
58285782
<p></p>
58295783

58305784

5831-
<h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
5832-
<p>Holds a list of app providers which can open a particular mime type.</p>
5833-
5834-
5835-
<table class="field-table">
5836-
<thead>
5837-
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
5838-
</thead>
5839-
<tbody>
5840-
5841-
<tr>
5842-
<td>app_providers</td>
5843-
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
5844-
<td>repeated</td>
5845-
<td><p> </p></td>
5846-
</tr>
5847-
5848-
</tbody>
5849-
</table>
5850-
5851-
5852-
5853-
5854-
5855-
<h3 id="cs3.app.registry.v1beta1.MimeType">MimeType</h3>
5785+
<h3 id="cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</h3>
58565786
<p>Represents a mime type and its corresponding file extension.</p>
58575787

58585788

@@ -5879,19 +5809,43 @@ <h3 id="cs3.app.registry.v1beta1.MimeType">MimeType</h3>
58795809
</tr>
58805810

58815811
<tr>
5882-
<td>name</td>
5812+
<td>ext</td>
58835813
<td><a href="#string">string</a></td>
58845814
<td></td>
58855815
<td><p>REQUIRED.
5816+
The file extension mapped to this mime type. </p></td>
5817+
</tr>
5818+
5819+
<tr>
5820+
<td>app_providers</td>
5821+
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
5822+
<td>repeated</td>
5823+
<td><p>REQUIRED.
5824+
The list of app providers which can open this mime type </p></td>
5825+
</tr>
5826+
5827+
<tr>
5828+
<td>name</td>
5829+
<td><a href="#string">string</a></td>
5830+
<td></td>
5831+
<td><p>OPTIONAL.
58865832
The friendly name of this mime type. </p></td>
58875833
</tr>
58885834

58895835
<tr>
5890-
<td>ext</td>
5836+
<td>description</td>
58915837
<td><a href="#string">string</a></td>
58925838
<td></td>
5893-
<td><p>REQUIRED.
5894-
The file extension mapped to this mime type. </p></td>
5839+
<td><p>OPTIONAL.
5840+
Human-readable information to describe the mime type. </p></td>
5841+
</tr>
5842+
5843+
<tr>
5844+
<td>icon</td>
5845+
<td><a href="#string">string</a></td>
5846+
<td></td>
5847+
<td><p>OPTIONAL.
5848+
A URI to a static asset which represents the mime type icon. </p></td>
58955849
</tr>
58965850

58975851
</tbody>
@@ -5913,7 +5867,7 @@ <h3 id="cs3.app.registry.v1beta1.MimeTypeList">MimeTypeList</h3>
59135867

59145868
<tr>
59155869
<td>mime_types</td>
5916-
<td><a href="#cs3.app.registry.v1beta1.MimeType">MimeType</a></td>
5870+
<td><a href="#cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</a></td>
59175871
<td>repeated</td>
59185872
<td><p> </p></td>
59195873
</tr>
@@ -5981,7 +5935,7 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
59815935
<td></td>
59825936
<td><p>OPTIONAL.
59835937
Information to describe the functionalities
5984-
offered by the app provider. Meant to be read
5938+
offered by the underlying app. Meant to be read
59855939
by humans. </p></td>
59865940
</tr>
59875941

0 commit comments

Comments
 (0)