Skip to content

Commit

Permalink
Added an endpoint in AppProvider to create new files
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Sep 17, 2021
1 parent 3f84706 commit 0dfbb05
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 4 deletions.
29 changes: 28 additions & 1 deletion cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,38 @@ import "cs3/types/v1beta1/types.proto";
// Any method MAY return UNKNOWN.
// Any method MAY return UNAUTHENTICATED.
service ProviderAPI {
// Returns the App provider URL
// Creates a new file to be opened by an app. The new file MAY be either
// empty or generated out of a template if the AppProvider has such capability.
rpc CreateFileForApp(CreateFileForAppRequest) returns (CreateFileForAppResponse);
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
}

message CreateFileForAppRequest {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The target container where the file has to be created.
cs3.storage.provider.v1beta1.Reference ref = 2;
// REQUIRED.
// The name of the file to be created.
string filename = 3;
}

message CreateFileForAppResponse {
// REQUIRED.
// The response status.
cs3.rpc.v1beta1.Status status = 1;
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The resourceInfo of the file that was created.
cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
}

message OpenInAppRequest {
// OPTIONAL.
// Opaque information.
Expand Down
6 changes: 5 additions & 1 deletion cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ service GatewayAPI {
// ************************ APP PROVIDER ********************/
// *****************************************************************/

// Returns the App provider URL, which allows the user to open a resource in an online editor.
// Creates a new file to be opened by an app. The new file MAY be either
// empty or generated out of a template if the AppProvider has such capability.
rpc CreateFileForApp(cs3.app.provider.v1beta1.CreateFileForAppRequest) returns (cs3.app.provider.v1beta1.CreateFileForAppResponse);
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse);
// *****************************************************************/
// ************************ USER SHARE PROVIDER ********************/
Expand Down
111 changes: 109 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,14 @@ <h2>Table of Contents</h2>
<a href="#cs3%2fapp%2fprovider%2fv1beta1%2fprovider_api.proto">cs3/app/provider/v1beta1/provider_api.proto</a>
<ul>

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

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

<li>
<a href="#cs3.app.provider.v1beta1.OpenInAppRequest"><span class="badge">M</span>OpenInAppRequest</a>
</li>
Expand Down Expand Up @@ -2779,11 +2787,20 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
*****************************************************************/</p></td>
</tr>

<tr>
<td>CreateFileForApp</td>
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppRequest">.cs3.app.provider.v1beta1.CreateFileForAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppResponse">.cs3.app.provider.v1beta1.CreateFileForAppResponse</a></td>
<td><p>Creates a new file to be opened by an app. The new file MAY be either
empty or generated out of a template if the AppProvider has such capability.</p></td>
</tr>

<tr>
<td>OpenInApp</td>
<td><a href="#cs3.gateway.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">.cs3.app.provider.v1beta1.OpenInAppResponse</a></td>
<td><p>Returns the App provider URL, which allows the user to open a resource in an online editor.
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
MUST return CODE_NOT_FOUND if the resource does not exist.

*****************************************************************/
************************ USER SHARE PROVIDER ********************/
Expand Down Expand Up @@ -4999,6 +5016,88 @@ <h2 id="cs3/app/provider/v1beta1/provider_api.proto">cs3/app/provider/v1beta1/pr
<p></p>


<h3 id="cs3.app.provider.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</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>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>ref</td>
<td><a href="#cs3.storage.provider.v1beta1.Reference">cs3.storage.provider.v1beta1.Reference</a></td>
<td></td>
<td><p>REQUIRED.
The target container where the file has to be created. </p></td>
</tr>

<tr>
<td>filename</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The name of the file to be created. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.provider.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</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>status</td>
<td><a href="#cs3.rpc.v1beta1.Status">cs3.rpc.v1beta1.Status</a></td>
<td></td>
<td><p>REQUIRED.
The response status. </p></td>
</tr>

<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>resource_info</td>
<td><a href="#cs3.storage.provider.v1beta1.ResourceInfo">cs3.storage.provider.v1beta1.ResourceInfo</a></td>
<td></td>
<td><p>REQUIRED.
The resourceInfo of the file that was created. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</h3>
<p></p>

Expand Down Expand Up @@ -5145,11 +5244,19 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>
</thead>
<tbody>

<tr>
<td>CreateFileForApp</td>
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</a></td>
<td><p>Creates a new file to be opened by an app. The new file MAY be either
empty or generated out of a template if the AppProvider has such capability.</p></td>
</tr>

<tr>
<td>OpenInApp</td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">OpenInAppResponse</a></td>
<td><p>Returns the App provider URL
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
MUST return CODE_NOT_FOUND if the resource does not exist.</p></td>
</tr>

Expand Down

0 comments on commit 0dfbb05

Please sign in to comment.