Skip to content

Commit f381ff8

Browse files
committed
Added an endpoint in AppProvider to create new files
1 parent 40dd70b commit f381ff8

File tree

3 files changed

+145
-4
lines changed

3 files changed

+145
-4
lines changed

cs3/app/provider/v1beta1/provider_api.proto

+31-1
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,41 @@ import "cs3/types/v1beta1/types.proto";
5353
// Any method MAY return UNKNOWN.
5454
// Any method MAY return UNAUTHENTICATED.
5555
service ProviderAPI {
56-
// Returns the App provider URL
56+
// Creates a new file to be opened by an app. The new file MAY be either
57+
// empty or generated out of a template if the AppProvider has such capability.
58+
rpc CreateFileForApp(CreateFileForAppRequest) returns (CreateFileForAppResponse);
59+
// Returns the App URL and all necessary info to open a resource in an online editor.
5760
// MUST return CODE_NOT_FOUND if the resource does not exist.
5861
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
5962
}
6063

64+
message CreateFileForAppRequest {
65+
// OPTIONAL.
66+
// Opaque information.
67+
cs3.types.v1beta1.Opaque opaque = 1;
68+
// REQUIRED.
69+
// The target container where the file has to be created.
70+
cs3.storage.provider.v1beta1.Reference ref = 2;
71+
// REQUIRED.
72+
// The name of the file to be created.
73+
string filename = 3;
74+
// OPTIONAL.
75+
// A reference to a template that SHOULD be used to create the file.
76+
string template = 4;
77+
}
78+
79+
message CreateFileForAppResponse {
80+
// REQUIRED.
81+
// The response status.
82+
cs3.rpc.v1beta1.Status status = 1;
83+
// OPTIONAL.
84+
// Opaque information.
85+
cs3.types.v1beta1.Opaque opaque = 2;
86+
// REQUIRED.
87+
// The resourceInfo of the file that was created.
88+
cs3.storage.provider.v1beta1.ResourceInfo resource_info = 3;
89+
}
90+
6191
message OpenInAppRequest {
6292
// OPTIONAL.
6393
// Opaque information.

cs3/gateway/v1beta1/gateway_api.proto

+5-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ service GatewayAPI {
179179
// ************************ APP PROVIDER ********************/
180180
// *****************************************************************/
181181

182-
// Returns the App provider URL, which allows the user to open a resource in an online editor.
182+
// Creates a new file to be opened by an app. The new file MAY be either
183+
// empty or generated out of a template if the AppProvider has such capability.
184+
rpc CreateFileForApp(cs3.app.provider.v1beta1.CreateFileForAppRequest) returns (cs3.app.provider.v1beta1.CreateFileForAppResponse);
185+
// Returns the App URL and all necessary info to open a resource in an online editor.
186+
// MUST return CODE_NOT_FOUND if the resource does not exist.
183187
rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse);
184188
// *****************************************************************/
185189
// ************************ USER SHARE PROVIDER ********************/

docs/index.html

+109-2
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ <h2>Table of Contents</h2>
492492
<a href="#cs3%2fapp%2fprovider%2fv1beta1%2fprovider_api.proto">cs3/app/provider/v1beta1/provider_api.proto</a>
493493
<ul>
494494

495+
<li>
496+
<a href="#cs3.app.provider.v1beta1.CreateFileForAppRequest"><span class="badge">M</span>CreateFileForAppRequest</a>
497+
</li>
498+
499+
<li>
500+
<a href="#cs3.app.provider.v1beta1.CreateFileForAppResponse"><span class="badge">M</span>CreateFileForAppResponse</a>
501+
</li>
502+
495503
<li>
496504
<a href="#cs3.app.provider.v1beta1.OpenInAppRequest"><span class="badge">M</span>OpenInAppRequest</a>
497505
</li>
@@ -2779,11 +2787,20 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
27792787
*****************************************************************/</p></td>
27802788
</tr>
27812789

2790+
<tr>
2791+
<td>CreateFileForApp</td>
2792+
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppRequest">.cs3.app.provider.v1beta1.CreateFileForAppRequest</a></td>
2793+
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppResponse">.cs3.app.provider.v1beta1.CreateFileForAppResponse</a></td>
2794+
<td><p>Creates a new file to be opened by an app. The new file MAY be either
2795+
empty or generated out of a template if the AppProvider has such capability.</p></td>
2796+
</tr>
2797+
27822798
<tr>
27832799
<td>OpenInApp</td>
27842800
<td><a href="#cs3.gateway.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
27852801
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">.cs3.app.provider.v1beta1.OpenInAppResponse</a></td>
2786-
<td><p>Returns the App provider URL, which allows the user to open a resource in an online editor.
2802+
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
2803+
MUST return CODE_NOT_FOUND if the resource does not exist.
27872804

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

50015018

5019+
<h3 id="cs3.app.provider.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</h3>
5020+
<p></p>
5021+
5022+
5023+
<table class="field-table">
5024+
<thead>
5025+
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
5026+
</thead>
5027+
<tbody>
5028+
5029+
<tr>
5030+
<td>opaque</td>
5031+
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
5032+
<td></td>
5033+
<td><p>OPTIONAL.
5034+
Opaque information. </p></td>
5035+
</tr>
5036+
5037+
<tr>
5038+
<td>ref</td>
5039+
<td><a href="#cs3.storage.provider.v1beta1.Reference">cs3.storage.provider.v1beta1.Reference</a></td>
5040+
<td></td>
5041+
<td><p>REQUIRED.
5042+
The target container where the file has to be created. </p></td>
5043+
</tr>
5044+
5045+
<tr>
5046+
<td>filename</td>
5047+
<td><a href="#string">string</a></td>
5048+
<td></td>
5049+
<td><p>REQUIRED.
5050+
The name of the file to be created. </p></td>
5051+
</tr>
5052+
5053+
</tbody>
5054+
</table>
5055+
5056+
5057+
5058+
5059+
5060+
<h3 id="cs3.app.provider.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</h3>
5061+
<p></p>
5062+
5063+
5064+
<table class="field-table">
5065+
<thead>
5066+
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
5067+
</thead>
5068+
<tbody>
5069+
5070+
<tr>
5071+
<td>status</td>
5072+
<td><a href="#cs3.rpc.v1beta1.Status">cs3.rpc.v1beta1.Status</a></td>
5073+
<td></td>
5074+
<td><p>REQUIRED.
5075+
The response status. </p></td>
5076+
</tr>
5077+
5078+
<tr>
5079+
<td>opaque</td>
5080+
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
5081+
<td></td>
5082+
<td><p>OPTIONAL.
5083+
Opaque information. </p></td>
5084+
</tr>
5085+
5086+
<tr>
5087+
<td>resource_info</td>
5088+
<td><a href="#cs3.storage.provider.v1beta1.ResourceInfo">cs3.storage.provider.v1beta1.ResourceInfo</a></td>
5089+
<td></td>
5090+
<td><p>REQUIRED.
5091+
The resourceInfo of the file that was created. </p></td>
5092+
</tr>
5093+
5094+
</tbody>
5095+
</table>
5096+
5097+
5098+
5099+
5100+
50025101
<h3 id="cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</h3>
50035102
<p></p>
50045103

@@ -5145,11 +5244,19 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>
51455244
</thead>
51465245
<tbody>
51475246

5247+
<tr>
5248+
<td>CreateFileForApp</td>
5249+
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppRequest">CreateFileForAppRequest</a></td>
5250+
<td><a href="#cs3.app.provider.v1beta1.CreateFileForAppResponse">CreateFileForAppResponse</a></td>
5251+
<td><p>Creates a new file to be opened by an app. The new file MAY be either
5252+
empty or generated out of a template if the AppProvider has such capability.</p></td>
5253+
</tr>
5254+
51485255
<tr>
51495256
<td>OpenInApp</td>
51505257
<td><a href="#cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
51515258
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">OpenInAppResponse</a></td>
5152-
<td><p>Returns the App provider URL
5259+
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
51535260
MUST return CODE_NOT_FOUND if the resource does not exist.</p></td>
51545261
</tr>
51555262

0 commit comments

Comments
 (0)