Skip to content

Commit

Permalink
Reworked API for listing the supported mime types
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Sep 14, 2021
1 parent 8078210 commit b8c4d03
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 9,446 deletions.
5 changes: 1 addition & 4 deletions cs3/app/registry/v1beta1/registry_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ service RegistryAPI {
rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
// Returns a list of the available app providers known by this registry.
rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
// Returns a list of the supported mime types along with the apps which they can opened with.
// Returns a list of the supported mime types along with the apps which they can be opened with.
rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse);
// Returns the default app provider which serves a specified mime type.
rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
Expand Down Expand Up @@ -138,9 +138,6 @@ message ListSupportedMimeTypesResponse {
// REQUIRED.
// The list of supported mime types and their properties.
MimeTypeList mime_types = 3;
// REQUIRED.
// The list of supported apps indexed by mime type.
map<string, AppProviderList> apps = 4;
}

message GetDefaultAppProviderForMimeTypeRequest {
Expand Down
28 changes: 16 additions & 12 deletions cs3/app/registry/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ message ProviderInfo {
string name = 5;
// OPTIONAL.
// Information to describe the functionalities
// offered by the app provider. Meant to be read
// offered by the underlying app. Meant to be read
// by humans.
string description = 6;
// OPTIONAL.
Expand All @@ -68,28 +68,32 @@ message ProviderInfo {
bool desktop_only = 8;
}

// Holds a list of app providers which can open a particular mime type.
message AppProviderList {
repeated ProviderInfo app_providers = 1;
}

// Represents a mime type and its corresponding file extension.
message MimeType {
message MimeTypeInfo {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The mime type.
string mime_type = 2;
// REQUIRED.
// The friendly name of this mime type.
string name = 3;
// REQUIRED.
// The file extension mapped to this mime type.
string ext = 4;
string ext = 3;
// REQUIRED.
// The list of app providers which can open this mime type
repeated ProviderInfo app_providers = 4;
// OPTIONAL.
// The friendly name of this mime type.
string name = 5;
// OPTIONAL.
// Human-readable information to describe the mime type.
string description = 6;
// OPTIONAL.
// A URI to a static asset which represents the mime type icon.
string icon = 7;
}

// Holds a list of mime types.
message MimeTypeList {
repeated MimeType mime_types = 1;
repeated MimeTypeInfo mime_types = 1;
}
116 changes: 35 additions & 81 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,6 @@ <h2>Table of Contents</h2>
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse"><span class="badge">M</span>ListSupportedMimeTypesResponse</a>
</li>

<li>
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry"><span class="badge">M</span>ListSupportedMimeTypesResponse.AppsEntry</a>
</li>

<li>
<a href="#cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest"><span class="badge">M</span>SetDefaultAppProviderForMimeTypeRequest</a>
</li>
Expand All @@ -610,11 +606,7 @@ <h2>Table of Contents</h2>
<ul>

<li>
<a href="#cs3.app.registry.v1beta1.AppProviderList"><span class="badge">M</span>AppProviderList</a>
</li>

<li>
<a href="#cs3.app.registry.v1beta1.MimeType"><span class="badge">M</span>MimeType</a>
<a href="#cs3.app.registry.v1beta1.MimeTypeInfo"><span class="badge">M</span>MimeTypeInfo</a>
</li>

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

<tr>
<td>apps</td>
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry">ListSupportedMimeTypesResponse.AppsEntry</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The list of supported apps indexed by mime type. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.AppsEntry">ListSupportedMimeTypesResponse.AppsEntry</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>key</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>value</td>
<td><a href="#cs3.app.registry.v1beta1.AppProviderList">AppProviderList</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -5792,14 +5745,15 @@ <h3 id="cs3.app.registry.v1beta1.RegistryAPI">RegistryAPI</h3>
<td>ListAppProviders</td>
<td><a href="#cs3.app.registry.v1beta1.ListAppProvidersRequest">ListAppProvidersRequest</a></td>
<td><a href="#cs3.app.registry.v1beta1.ListAppProvidersResponse">ListAppProvidersResponse</a></td>
<td><p>Returns a list of the available app providers known by this registry.</p></td>
<td><p>Registers a new mime type
Returns a list of the available app providers known by this registry.</p></td>
</tr>

<tr>
<td>ListSupportedMimeTypes</td>
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesRequest">ListSupportedMimeTypesRequest</a></td>
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMimeTypesResponse</a></td>
<td><p>Returns a list of the supported mime types along with the apps which they can opened with.</p></td>
<td><p>Returns a list of the supported mime types along with the apps which they can be opened with.</p></td>
</tr>

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


<h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
<p>Holds a list of app providers which can open a particular mime type.</p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>app_providers</td>
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.registry.v1beta1.MimeType">MimeType</h3>
<h3 id="cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</h3>
<p>Represents a mime type and its corresponding file extension.</p>


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

<tr>
<td>name</td>
<td>ext</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The file extension mapped to this mime type. </p></td>
</tr>

<tr>
<td>app_providers</td>
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The list of app providers which can open this mime type </p></td>
</tr>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
The friendly name of this mime type. </p></td>
</tr>

<tr>
<td>ext</td>
<td>description</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The file extension mapped to this mime type. </p></td>
<td><p>OPTIONAL.
Human-readable information to describe the mime type. </p></td>
</tr>

<tr>
<td>icon</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A URI to a static asset which represents the mime type icon. </p></td>
</tr>

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

<tr>
<td>mime_types</td>
<td><a href="#cs3.app.registry.v1beta1.MimeType">MimeType</a></td>
<td><a href="#cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
Expand Down Expand Up @@ -5981,7 +5935,7 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
<td></td>
<td><p>OPTIONAL.
Information to describe the functionalities
offered by the app provider. Meant to be read
offered by the underlying app. Meant to be read
by humans. </p></td>
</tr>

Expand Down
Loading

0 comments on commit b8c4d03

Please sign in to comment.