Skip to content

Commit

Permalink
Created a mimetype message and reworked API for listing the supported…
Browse files Browse the repository at this point in the history
… mime types
  • Loading branch information
glpatcern committed Sep 21, 2021
1 parent 7b2ef69 commit 1daa6aa
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 51 deletions.
6 changes: 3 additions & 3 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 @@ -136,8 +136,8 @@ message ListSupportedMimeTypesResponse {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The list of supported mime types with the apps which they can be opened with.
map<string, AppProviderList> mime_types = 3;
// The list of supported mime types and their properties.
repeated MimeTypeInfo mime_types = 3;
}

message GetDefaultAppProviderForMimeTypeRequest {
Expand Down
28 changes: 24 additions & 4 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,7 +68,27 @@ 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 MimeTypeInfo {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The mime type.
string mime_type = 2;
// REQUIRED.
// The file extension mapped to this mime type.
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;
}
170 changes: 126 additions & 44 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.MimeTypesEntry"><span class="badge">M</span>ListSupportedMimeTypesResponse.MimeTypesEntry</a>
</li>

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

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

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

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


<li>
<a href="#cs3.app.registry.v1beta1.ProviderInfo.Capability"><span class="badge">E</span>ProviderInfo.Capability</a>
</li>



</ul>
Expand Down Expand Up @@ -5622,41 +5626,10 @@ <h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMi

<tr>
<td>mime_types</td>
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The list of supported mime types with the apps which they can be opened with. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</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><a href="#cs3.app.registry.v1beta1.MimeTypeList">MimeTypeList</a></td>
<td></td>
<td><p> </p></td>
<td><p>REQUIRED.
The list of supported mime types and their properties. </p></td>
</tr>

</tbody>
Expand Down Expand Up @@ -5780,7 +5753,7 @@ <h3 id="cs3.app.registry.v1beta1.RegistryAPI">RegistryAPI</h3>
<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 @@ -5809,8 +5782,8 @@ <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>
<h3 id="cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</h3>
<p>Represents a mime type and its corresponding file extension.</p>


<table class="field-table">
Expand All @@ -5819,10 +5792,83 @@ <h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
</thead>
<tbody>

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>mime_type</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The mime type. </p></td>
</tr>

<tr>
<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>description</td>
<td><a href="#string">string</a></td>
<td></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>
</table>





<h3 id="cs3.app.registry.v1beta1.MimeTypeList">MimeTypeList</h3>
<p>Holds a list of mime types.</p>


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

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

Expand Down Expand Up @@ -5868,12 +5914,19 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
For example, tcp://localhost:1099. </p></td>
</tr>

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

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A human-readable name of the app provider. </p></td>
A human-readable name of the underlying app. </p></td>
</tr>

<tr>
Expand All @@ -5882,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 Expand Up @@ -5911,6 +5964,35 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>



<h3 id="cs3.app.registry.v1beta1.ProviderInfo.Capability">ProviderInfo.Capability</h3>
<p>REQUIRED.</p><p>The capability of the underlying app.</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>CAPABILITY_INVALID</td>
<td>0</td>
<td><p></p></td>
</tr>

<tr>
<td>CAPABILITY_VIEWER</td>
<td>1</td>
<td><p>The app is a simple viewer.</p></td>
</tr>

<tr>
<td>CAPABILITY_EDITOR</td>
<td>2</td>
<td><p>The app is a full editor.</p></td>
</tr>

</tbody>
</table>




Expand Down

0 comments on commit 1daa6aa

Please sign in to comment.