OXYGENHUB
# bf73998c5198 oxygenhub-vscode / src / hubapi.d.ts
6.5 KiB · last changed Proposals in native diff editors (0.2.0) 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 | null;
150
  author: string;
151
  body: string;
152
  created_ms: number;
153
  id: number;
154
  line?: number | null;
155
  path?: string | null;
156
  resolved: boolean;
157
};
158
159
export type ProposalFile = {
160
  added: number;
161
  from?: string | null;
162
  kind: string;
163
  path: string;
164
  removed: number;
165
};
166
167
export type Review = {
168
  author: string;
169
  body: string;
170
  created_ms: number;
171
  id: number;
172
  sealed: boolean;
173
  verdict: string;
174
};
175
176
export type TreeEntry = {
177
  conflicted: boolean;
178
  exec: boolean;
179
  kind: string;
180
  name: string;
181
  path: string;
182
  size?: number | null;
183
};
184
185
export type BlameLine = {
186
  author: string;
187
  change: string;
188
  index: number;
189
  line: number;
190
  text: string;
191
  when_ms: number;
192
};
193
194
export type FileChange = {
195
  added: number;
196
  from?: string | null;
197
  kind: string;
198
  path: string;
199
  removed: number;
200
};
201
202
export type ChangeDetail = {
203
  body: string;
204
  change: ChangeSummary;
205
  dependents: string[];
206
  files: FileChange[];
207
  in_bookmarks: string[];
208
  in_tags: string[];
209
};
210
211
export type History = {
212
  changes: ChangeSummary[];
213
  heads: string[];
214
  offset: number;
215
  reference: string;
216
  total: number;
217
};
218
219
export type Conflict = {
220
  bookmark: string;
221
  contributors: string[];
222
  kind: string;
223
  path: string;
224
};
225
226
export type Push = {
227
  at_ms: number;
228
  changes: number;
229
  heads: number;
230
  new_state: string;
231
  ok: boolean;
232
  old_state: string;
233
  pusher: string;
234
  reason: string;
235
  reference: string;
236
};
237
238
export type Policy = {
239
  expires_ms: number;
240
  root_threshold: number;
241
  roots: string[];
242
  rules: Rule[];
243
  serial: number;
244
};
245
246
export type Rule = {
247
  allow_conflicts: boolean;
248
  keys: string[];
249
  pattern: string;
250
  require: string;
251
  threshold: number;
252
};
253
254
export type Trust = {
255
  hub_key: string;
256
  invalid: string[];
257
  policy?: Policy | null;
258
  sealed: number;
259
  signed: number;
260
  unsigned: number;
261
};
262
263
export type Hook = {
264
  active: boolean;
265
  created_ms: number;
266
  events: string;
267
  id: number;
268
  url: string;
269
};
270
271
export type NewHook = {
272
  events?: string;
273
  secret: string;
274
  url: string;
275
};
276
277
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
278
279
export type Check = {
280
  finished_ms?: number | null;
281
  name: string;
282
  reporter: string;
283
  seal?: string | null;
284
  started_ms: number;
285
  state: string;
286
  status: CheckStatus;
287
  summary: string;
288
  url: string;
289
};
290
291
export type NewCheck = {
292
  name: string;
293
  seal?: string | null;
294
  state: string;
295
  status: CheckStatus;
296
  summary?: string;
297
  url?: string;
298
};
299
300
export type User = {
301
  created_ms: number;
302
  display_name: string;
303
  is_admin: boolean;
304
  keys: string[];
305
  username: string;
306
};
307
308
export type Organisation = {
309
  description: string;
310
  display_name: string;
311
  members: string[];
312
  name: string;
313
};
314
315
export type NewRepository = {
316
  description?: string;
317
  name: string;
318
  owner: string;
319
  visibility?: Visibility;
320
};
321
322
export type NewIssue = {
323
  body?: string;
324
  title: string;
325
};
326
327
export type NewComment = {
328
  body: string;
329
  line?: number | null;
330
  path?: string | null;
331
};
332
333
export type NewProposal = {
334
  body?: string;
335
  draft?: boolean;
336
  source: string;
337
  target: string;
338
  title: string;
339
};
340
341
export type NewReview = {
342
  body?: string;
343
  verdict: string;
344
};
345
346
export type IssueStateChange = {
347
  reason?: string;
348
  state: string;
349
};
350
351
export type WebhookEnvelope = {
352
  actor: string;
353
  at_ms: number;
354
  data: unknown;
355
  delivery: string;
356
  event: string;
357
  repository?: Repository | null;
358
};
359
360
export type ProposalEvent = {
361
  check?: Check | null;
362
  kind: string;
363
  number: number;
364
};
365
366
export type ReleaseAsset = {
367
  content_type: string;
368
  downloads: number;
369
  hash: string;
370
  name: string;
371
  size: number;
372
  url: string;
373
};
374
375
export type Release = {
376
  archives: string[];
377
  assets: ReleaseAsset[];
378
  author: string;
379
  created_ms: number;
380
  heads: string[];
381
  latest: boolean;
382
  notes: string;
383
  prerelease: boolean;
384
  signer?: string | null;
385
  tag: string;
386
  title: string;
387
  url: string;
388
};
389
390
export type NewRelease = {
391
  notes?: string | null;
392
  prerelease?: boolean;
393
  tag: string;
394
  title: string;
395
};
396