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
// Namespace: "keybase.1"
// Protocol: "git"
#![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::favorite::*;
#[derive(Serialize, Deserialize, Debug)]
pub struct EncryptedGitMetadata {
  pub v: Option<i32>,
  #[serde(default)]
  pub e: Option<String>,
  pub n: Option<BoxNonce>,
  pub gen: Option<PerTeamKeyGeneration>,
}

pub type RepoID = String;

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum GitLocalMetadataVersion {
  V1_1,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitLocalMetadataV1 {
  pub repoName: Option<GitRepoName>,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum GitLocalMetadataVersioned {
  V1 {v1: GitLocalMetadataV1},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitCommit {
  #[serde(default)]
  pub commitHash: Option<String>,
  #[serde(default)]
  pub message: Option<String>,
  #[serde(default)]
  pub authorName: Option<String>,
  #[serde(default)]
  pub authorEmail: Option<String>,
  pub ctime: Option<Time>,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum GitPushType {
  Default_0,
  Createrepo_1,
  Renamerepo_3,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitRefMetadata {
  #[serde(default)]
  pub refName: Option<String>,
  #[serde(default)]
  pub commits: Option<Vec<GitCommit>>,
  #[serde(default)]
  pub moreCommitsAvailable: Option<bool>,
  #[serde(default)]
  pub isDelete: Option<bool>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitLocalMetadata {
  pub repoName: Option<GitRepoName>,
  #[serde(default)]
  pub refs: Option<Vec<GitRefMetadata>>,
  pub pushType: Option<GitPushType>,
  pub previousRepoName: Option<GitRepoName>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitServerMetadata {
  pub ctime: Option<Time>,
  pub mtime: Option<Time>,
  #[serde(default)]
  pub lastModifyingUsername: Option<String>,
  pub lastModifyingDeviceID: Option<DeviceID>,
  #[serde(default)]
  pub lastModifyingDeviceName: Option<String>,
}





#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum GitRepoResultState {
  Err_0,
  Ok_1,
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
pub enum GitRepoResult {
  Err {err: String},
  Ok {ok: GitRepoInfo},
}

#[derive(Serialize, Deserialize, Debug)]
pub struct GitRepoInfo {
  pub folder: Option<FolderHandle>,
  pub repoID: Option<RepoID>,
  pub localMetadata: Option<GitLocalMetadata>,
  pub serverMetadata: Option<GitServerMetadata>,
  #[serde(default)]
  pub repoUrl: Option<String>,
  #[serde(default)]
  pub globalUniqueID: Option<String>,
  #[serde(default)]
  pub canDelete: Option<bool>,
  pub teamRepoSettings: Option<GitTeamRepoSettings>,
}

















#[derive(Serialize, Deserialize, Debug)]
pub struct GitTeamRepoSettings {
  pub channelName: Option<String>,
  #[serde(default)]
  pub chatDisabled: Option<bool>,
}