1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
// Namespace: "keybase.1"
// Protocol: "SimpleFS"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

use super::common::*;
use super::kbfs_common::*;
pub type OpID = Vec<u8>;

// LINT: @lint("ignore")
pub type KBFSRevision = i64;

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum KBFSArchivedType {
  Revision_0,
  Time_1,
  Time_string_2,
  Rel_time_string_3,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum KBFSArchivedParam {
  Revision {revision: KBFSRevision},
  Time {time: Time},
  Time_string {time_string: String},
  Rel_time_string {rel_time_string: String},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct KBFSArchivedPath {
  #[serde(default)]
  pub path: Option<String>,
  pub archivedParam: Option<KBFSArchivedParam>,
  pub identifyBehavior: Option<TLFIdentifyBehavior>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct KBFSPath {
  #[serde(default)]
  pub path: Option<String>,
  pub identifyBehavior: Option<TLFIdentifyBehavior>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum PathType {
  Local_0,
  Kbfs_1,
  Kbfs_archived_2,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum Path {
  Local {local: String},
  Kbfs {kbfs: KBFSPath},
  Kbfs_archived {kbfs_archived: KBFSArchivedPath},
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum DirentType {
  File_0,
  Dir_1,
  Sym_2,
  Exec_3,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum PrefetchStatus {
  Not_started_0,
  In_progress_1,
  Complete_2,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct PrefetchProgress {
  pub start: Option<Time>,
  pub endEstimate: Option<Time>,
  pub bytesTotal: Option<i64>,
  pub bytesFetched: Option<i64>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct Dirent {
  pub time: Option<Time>,
  pub size: Option<i32>,
  #[serde(default)]
  pub name: Option<String>,
  pub direntType: Option<DirentType>,
  pub lastWriterUnverified: Option<User>,
  #[serde(default)]
  pub writable: Option<bool>,
  pub prefetchStatus: Option<PrefetchStatus>,
  pub prefetchProgress: Option<PrefetchProgress>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct DirentWithRevision {
  pub entry: Option<Dirent>,
  pub revision: Option<KBFSRevision>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum RevisionSpanType {
  Default_0, // scattered revisions across different time intervals
  Last_five_1, // the five most recent revisions
}

pub type ErrorNum = i32;

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum OpenFlags {
  Read_0, // exclusive of other flags
  Replace_1, // overwrite
  Existing_2, // fail if not present already
  Write_4, // read is implied if not write, executable, or directory
  Append_8,
  Directory_16,
}

pub type Progress = i32;

#[derive(Serialize, Deserialize, Debug)]
pub struct SimpleFSListResult {
  #[serde(default)]
  pub entries: Option<Vec<Dirent>>,
  pub progress: Option<Progress>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FileContent {
  #[serde(default)]
  pub data: Option<String>,
  pub progress: Option<Progress>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum AsyncOps {
  List_0,
  List_recursive_1,
  Read_2,
  Write_3,
  Copy_4,
  Move_5,
  Remove_6,
  List_recursive_to_depth_7,
  Get_revisions_8,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum ListFilter {
  No_filter_0,
  Filter_all_hidden_1,
  Filter_system_hidden_2,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ListArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  pub filter: Option<ListFilter>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ListToDepthArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  pub filter: Option<ListFilter>,
  pub depth: Option<i32>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct RemoveArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  #[serde(default)]
  pub recursive: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ReadArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  pub offset: Option<i64>,
  pub size: Option<i32>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct WriteArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  pub offset: Option<i64>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct CopyArgs {
  pub opID: Option<OpID>,
  pub src: Option<Path>,
  pub dest: Option<Path>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct MoveArgs {
  pub opID: Option<OpID>,
  pub src: Option<Path>,
  pub dest: Option<Path>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GetRevisionsArgs {
  pub opID: Option<OpID>,
  pub path: Option<Path>,
  pub spanType: Option<RevisionSpanType>,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum OpDescription {
  List {list: ListArgs},
  List_recursive {list_recursive: ListArgs},
  List_recursive_to_depth {list_recursive_to_depth: ListToDepthArgs},
  Read {read: ReadArgs},
  Write {write: WriteArgs},
  Copy {copy: CopyArgs},
  Move {r#move: MoveArgs},
  Remove {remove: RemoveArgs},
  Get_revisions {get_revisions: GetRevisionsArgs},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GetRevisionsResult {
  #[serde(default)]
  pub revisions: Option<Vec<DirentWithRevision>>,
  pub progress: Option<Progress>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct OpProgress {
  pub start: Option<Time>,
  pub endEstimate: Option<Time>,
  pub opType: Option<AsyncOps>,
  pub bytesTotal: Option<i64>,
  pub bytesRead: Option<i64>,
  pub bytesWritten: Option<i64>,
  pub filesTotal: Option<i64>,
  pub filesRead: Option<i64>,
  pub filesWritten: Option<i64>,
}

























































// @lint("ignore")
#[derive(Serialize, Deserialize, Debug)]
pub struct SimpleFSGetHTTPAddressAndTokenResponse {
  #[serde(default)]
  pub address: Option<String>,
  #[serde(default)]
  pub token: Option<String>,
}

// @lint("ignore")








#[derive(Serialize, Deserialize, Debug)]
pub struct SimpleFSQuotaUsage {
  pub usageBytes: Option<i64>,
  pub archiveBytes: Option<i64>,
  pub limitBytes: Option<i64>,
  pub gitUsageBytes: Option<i64>,
  pub gitArchiveBytes: Option<i64>,
  pub gitLimitBytes: Option<i64>,
}







#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum FolderSyncMode {
  Disabled_0,
  Enabled_1,
  Partial_2,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FolderSyncConfig {
  pub mode: Option<FolderSyncMode>,
  #[serde(default)]
  pub paths: Option<Vec<String>>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FolderSyncConfigAndStatus {
  pub config: Option<FolderSyncConfig>,
  pub status: Option<FolderSyncStatus>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FolderSyncConfigAndStatusWithFolder {
  pub folder: Option<Folder>,
  pub config: Option<FolderSyncConfig>,
  pub status: Option<FolderSyncStatus>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct SyncConfigAndStatusRes {
  #[serde(default)]
  pub folders: Option<Vec<FolderSyncConfigAndStatusWithFolder>>,
  pub overallStatus: Option<FolderSyncStatus>,
}













#[derive(Serialize, Deserialize, Debug)]
pub struct FSSettings {
  pub spaceAvailableNotificationThreshold: Option<i64>,
}









#[derive(Serialize, Deserialize, Debug)]
pub struct SimpleFSStats {
  pub processStats: Option<ProcessRuntimeStats>,
  #[serde(default)]
  pub blockCacheDbStats: Option<Vec<String>>,
  #[serde(default)]
  pub syncCacheDbStats: Option<Vec<String>>,
  #[serde(default)]
  pub runtimeDbStats: Option<Vec<DbStats>>,
}



#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum SubscriptionTopic {
  Favorites_0,
  Journal_status_1,
  Online_status_2,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum PathSubscriptionTopic {
  Children_0,
  Stat_1,
}