OXYGENHUB
# 3f02e5ea4f2d oxygenhub / crates / hub-api / ts / index.d.ts
5.9 KiB · last changed API: a proposal's files and each side's bytes 1 month ago source blame history raw
1
// Generated by `cargo run -p hub-api --bin hub-api-typescript`; do not edit.
2
// Types of the Oxygenhub JSON API (hub spec §12.1).
3
4
export type Visibility = "public" | "internal" | "private";
5
6
export type Repository = {
7
  clone_url: string;
8
  created_ms: number;
9
  default_bookmark: string;
10
  description: string;
11
  name: string;
12
  owner: string;
13
  updated_ms: number;
14
  visibility: Visibility;
15
};
16
17
export type Bookmark = {
18
  changes: number;
19
  default: boolean;
20
  heads: string[];
21
  name: string;
22
};
23
24
export type Tag = {
25
  heads: string[];
26
  message: string;
27
  name: string;
28
  signer?: string | null;
29
};
30
31
export type Author = {
32
  account?: string | null;
33
  email: string;
34
  key: string;
35
  name: string;
36
};
37
38
export type Signature = {
39
  status: "unsigned";
40
} | {
41
  key: string;
42
  revoked: boolean;
43
  sealed: boolean;
44
  status: "valid";
45
} | {
46
  reason: string;
47
  status: "invalid";
48
};
49
50
export type ChangeSummary = {
51
  author: Author;
52
  deps: string[];
53
  hash: string;
54
  head: boolean;
55
  message: string;
56
  signature: Signature;
57
  when_ms: number;
58
};
59
60
export type Problem = {
61
  detail: string;
62
  status: number;
63
  title: string;
64
};
65
66
export type Approval = {
67
  account: string;
68
  key?: string | null;
69
  sealed: boolean;
70
};
71
72
export type ProposalSource = {
73
  bookmark: string;
74
  kind: "bookmark";
75
} | {
76
  bookmark: string;
77
  kind: "fork";
78
  name: string;
79
  owner: string;
80
} | {
81
  hashes: string[];
82
  kind: "changes";
83
};
84
85
export type ProposalState = "draft" | "open" | "landed" | "closed";
86
87
export type Proposal = {
88
  approvals: Approval[];
89
  author: string;
90
  blockers: string[];
91
  body: string;
92
  changes: ChangeSummary[];
93
  conflicted: boolean;
94
  created_ms: number;
95
  landable: boolean;
96
  number: number;
97
  projected_heads: string[];
98
  projected_state?: string | null;
99
  repository_url: string;
100
  source: ProposalSource;
101
  source_url?: string | null;
102
  state: ProposalState;
103
  target: string;
104
  title: string;
105
  updated_ms: number;
106
  url: string;
107
};
108
109
export type Label = {
110
  colour: string;
111
  description: string;
112
  name: string;
113
};
114
115
export type Issue = {
116
  assignees: string[];
117
  author: string;
118
  body: string;
119
  closed_ms?: number | null;
120
  comments: number;
121
  created_ms: number;
122
  labels: Label[];
123
  locked: boolean;
124
  milestone?: string | null;
125
  number: number;
126
  pinned: boolean;
127
  reason: string;
128
  state: string;
129
  title: string;
130
  updated_ms: number;
131
  url: string;
132
};
133
134
export type Milestone = {
135
  closed: number;
136
  description: string;
137
  due_ms?: number | null;
138
  open: number;
139
  state: string;
140
  title: string;
141
};
142
143
export type Atom = {
144
  change: string;
145
  index: number;
146
};
147
148
export type Comment = {
149
  anchor?: Atom | unknown;
150
  author: string;
151
  body: string;
152
  created_ms: number;
153
  id: number;
154
  path?: string | null;
155
  resolved: boolean;
156
};
157
158
export type ProposalFile = {
159
  added: number;
160
  from?: string | null;
161
  kind: string;
162
  path: string;
163
  removed: number;
164
};
165
166
export type Review = {
167
  author: string;
168
  body: string;
169
  created_ms: number;
170
  id: number;
171
  sealed: boolean;
172
  verdict: string;
173
};
174
175
export type TreeEntry = {
176
  conflicted: boolean;
177
  exec: boolean;
178
  kind: string;
179
  name: string;
180
  path: string;
181
  size?: number | null;
182
};
183
184
export type BlameLine = {
185
  author: string;
186
  change: string;
187
  index: number;
188
  line: number;
189
  text: string;
190
  when_ms: number;
191
};
192
193
export type FileChange = {
194
  added: number;
195
  from?: string | null;
196
  kind: string;
197
  path: string;
198
  removed: number;
199
};
200
201
export type ChangeDetail = {
202
  body: string;
203
  change: ChangeSummary;
204
  dependents: string[];
205
  files: FileChange[];
206
  in_bookmarks: string[];
207
  in_tags: string[];
208
};
209
210
export type History = {
211
  changes: ChangeSummary[];
212
  heads: string[];
213
  offset: number;
214
  reference: string;
215
  total: number;
216
};
217
218
export type Conflict = {
219
  bookmark: string;
220
  contributors: string[];
221
  kind: string;
222
  path: string;
223
};
224
225
export type Push = {
226
  at_ms: number;
227
  changes: number;
228
  heads: number;
229
  new_state: string;
230
  ok: boolean;
231
  old_state: string;
232
  pusher: string;
233
  reason: string;
234
  reference: string;
235
};
236
237
export type Policy = {
238
  expires_ms: number;
239
  root_threshold: number;
240
  roots: string[];
241
  rules: Rule[];
242
  serial: number;
243
};
244
245
export type Rule = {
246
  allow_conflicts: boolean;
247
  keys: string[];
248
  pattern: string;
249
  require: string;
250
  threshold: number;
251
};
252
253
export type Trust = {
254
  hub_key: string;
255
  invalid: string[];
256
  policy?: Policy | unknown;
257
  sealed: number;
258
  signed: number;
259
  unsigned: number;
260
};
261
262
export type Hook = {
263
  active: boolean;
264
  created_ms: number;
265
  events: string;
266
  id: number;
267
  url: string;
268
};
269
270
export type NewHook = {
271
  events?: string;
272
  secret: string;
273
  url: string;
274
};
275
276
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
277
278
export type Check = {
279
  finished_ms?: number | null;
280
  name: string;
281
  reporter: string;
282
  seal?: string | null;
283
  started_ms: number;
284
  state: string;
285
  status: CheckStatus;
286
  summary: string;
287
  url: string;
288
};
289
290
export type NewCheck = {
291
  name: string;
292
  seal?: string | null;
293
  state: string;
294
  status: CheckStatus;
295
  summary?: string;
296
  url?: string;
297
};
298
299
export type User = {
300
  created_ms: number;
301
  display_name: string;
302
  is_admin: boolean;
303
  keys: string[];
304
  username: string;
305
};
306
307
export type Organisation = {
308
  description: string;
309
  display_name: string;
310
  members: string[];
311
  name: string;
312
};
313
314
export type NewRepository = {
315
  description?: string;
316
  name: string;
317
  owner: string;
318
  visibility?: Visibility;
319
};
320
321
export type NewIssue = {
322
  body?: string;
323
  title: string;
324
};
325
326
export type NewComment = {
327
  body: string;
328
};
329
330
export type NewProposal = {
331
  body?: string;
332
  draft?: boolean;
333
  source: string;
334
  target: string;
335
  title: string;
336
};
337
338
export type NewReview = {
339
  body?: string;
340
  verdict: string;
341
};
342
343
export type IssueStateChange = {
344
  reason?: string;
345
  state: string;
346
};
347
348
export type WebhookEnvelope = {
349
  actor: string;
350
  at_ms: number;
351
  data: unknown;
352
  delivery: string;
353
  event: string;
354
  repository?: Repository | unknown;
355
};
356
357
export type ProposalEvent = {
358
  check?: Check | unknown;
359
  kind: string;
360
  number: number;
361
};
362