@@ -10,6 +10,7 @@ service SpaceApi {
1010 rpc GenerateKeyPair (GenerateKeyPairRequest ) returns (GenerateKeyPairResponse ) {}
1111 rpc GenerateKeyPairWithForce (GenerateKeyPairRequest ) returns (GenerateKeyPairResponse ) {}
1212 rpc Subscribe (google.protobuf.Empty ) returns (stream FileEventResponse ) {}
13+ rpc TxlSubscribe (google.protobuf.Empty ) returns (stream TextileEventResponse ) {}
1314 rpc OpenFile (OpenFileRequest ) returns (OpenFileResponse ) {}
1415 rpc AddItems (AddItemsRequest ) returns (AddItemsResponse ) {}
1516 rpc CreateFolder (CreateFolderRequest ) returns (CreateFolderResponse ) {}
@@ -40,37 +41,60 @@ message ConfigInfoResponse {
4041 string port = 2 ;
4142 string appPath = 3 ;
4243}
44+
4345message GenerateKeyPairRequest {}
4446
4547message GenerateKeyPairResponse {
4648 string publicKey = 1 ;
4749 string privateKey = 2 ;
4850}
51+
4952enum EventType {
5053 ENTRY_ADDED = 0 ;
5154 ENTRY_DELETED = 1 ;
5255 ENTRY_UPDATED = 2 ;
5356}
57+
5458message FileEventResponse {
5559 EventType type = 1 ;
5660 ListDirectoryEntry entry = 2 ;
5761}
62+
63+ message TextileEventResponse {
64+ string bucket = 1 ;
65+ }
66+
5867message OpenFileRequest {
5968 string path = 1 ;
6069}
70+
6171message OpenFileResponse {
6272 string location = 1 ;
6373}
74+
6475message AddItemsRequest {
6576 repeated string sourcePaths = 1 ; // full paths to file or Folder on FS. Needs to be a location available to the daemon
6677 string targetPath = 2 ; // target path in bucket.
6778}
68- // not sure we need to return anything other than an error if we failed
79+
80+ message AddItemResult {
81+ string sourcePath = 1 ;
82+ string bucketPath = 2 ;
83+ }
84+
85+ message AddItemError {
86+ string sourcePath = 1 ;
87+ string error = 2 ;
88+ }
89+
6990message AddItemsResponse {
91+ repeated AddItemResult results = 1 ;
92+ repeated AddItemError errors = 2 ;
7093}
94+
7195message CreateFolderRequest {
7296 string path = 1 ; // target path in bucket to add new empty folder
7397}
7498// not sure we need to return anything other than an error if we failed
7599message CreateFolderResponse {
76- }
100+ }
0 commit comments