OXYGENHUB
# d943160dafeb oxygenhub / crates / hub-api / ts / index.d.ts
9.6 KiB · last changed Close and reopen a proposal through the API and oh 23 days 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
  note?: string | null;
37
};
38
39
export type Signature = {
40
  status: "unsigned";
41
} | {
42
  key: string;
43
  revoked: boolean;
44
  sealed: boolean;
45
  status: "valid";
46
} | {
47
  reason: string;
48
  status: "invalid";
49
};
50
51
export type Via = {
52
  expires_ms?: number | null;
53
  key: string;
54
  name: string;
55
  revoked: boolean;
56
  scope: string;
57
};
58
59
export type ChangeSummary = {
60
  author: Author;
61
  deps: string[];
62
  hash: string;
63
  head: boolean;
64
  message: string;
65
  signature: Signature;
66
  via?: Via | null;
67
  when_ms: number;
68
};
69
70
export type Problem = {
71
  detail: string;
72
  status: number;
73
  title: string;
74
};
75
76
export type Approval = {
77
  account: string;
78
  key?: string | null;
79
  sealed: boolean;
80
};
81
82
export type Label = {
83
  colour: string;
84
  description: string;
85
  name: string;
86
};
87
88
export type Landed = {
89
  by: string;
90
  via: string;
91
  when_ms: number;
92
};
93
94
export type ProposalSource = {
95
  bookmark: string;
96
  kind: "bookmark";
97
} | {
98
  bookmark: string;
99
  kind: "fork";
100
  name: string;
101
  owner: string;
102
} | {
103
  hashes: string[];
104
  kind: "changes";
105
};
106
107
export type ProposalState = "draft" | "open" | "landed" | "closed";
108
109
export type Proposal = {
110
  approvals: Approval[];
111
  author: string;
112
  blockers: string[];
113
  body: string;
114
  changes: ChangeSummary[];
115
  conflicted: boolean;
116
  created_ms: number;
117
  labels?: Label[];
118
  landable: boolean;
119
  landed?: Landed | null;
120
  number: number;
121
  projected_heads: string[];
122
  projected_state?: string | null;
123
  repository_url: string;
124
  requested_reviewers?: string[];
125
  source: ProposalSource;
126
  source_url?: string | null;
127
  state: ProposalState;
128
  target: string;
129
  title: string;
130
  updated_ms: number;
131
  url: string;
132
};
133
134
export type Issue = {
135
  assignees: string[];
136
  author: string;
137
  body: string;
138
  closed_ms?: number | null;
139
  comments: number;
140
  created_ms: number;
141
  labels: Label[];
142
  locked: boolean;
143
  milestone?: string | null;
144
  number: number;
145
  pinned: boolean;
146
  reason: string;
147
  state: string;
148
  title: string;
149
  updated_ms: number;
150
  url: string;
151
};
152
153
export type Milestone = {
154
  closed: number;
155
  description: string;
156
  due_ms?: number | null;
157
  open: number;
158
  state: string;
159
  title: string;
160
};
161
162
export type NewMilestone = {
163
  description?: string;
164
  due?: string | null;
165
  title: string;
166
};
167
168
export type MilestoneEdit = {
169
  description?: string | null;
170
  due?: string | null;
171
  state?: string | null;
172
  title?: string | null;
173
};
174
175
export type Atom = {
176
  change: string;
177
  index: number;
178
};
179
180
export type Comment = {
181
  anchor?: Atom | unknown;
182
  author: string;
183
  body: string;
184
  created_ms: number;
185
  id: number;
186
  path?: string | null;
187
  resolved: boolean;
188
};
189
190
export type ProposalFile = {
191
  added: number;
192
  from?: string | null;
193
  kind: string;
194
  path: string;
195
  removed: number;
196
};
197
198
export type Notification = {
199
  actor: string;
200
  at_ms: number;
201
  id: number;
202
  kind: string;
203
  read: boolean;
204
  title: string;
205
  url: string;
206
};
207
208
export type Inbox = {
209
  items: Notification[];
210
  unread: number;
211
};
212
213
export type Review = {
214
  author: string;
215
  body: string;
216
  created_ms: number;
217
  id: number;
218
  sealed: boolean;
219
  verdict: string;
220
  via?: string;
221
};
222
223
export type TreeEntry = {
224
  conflicted: boolean;
225
  exec: boolean;
226
  kind: string;
227
  name: string;
228
  path: string;
229
  size?: number | null;
230
};
231
232
export type BlameLine = {
233
  author: string;
234
  change: string;
235
  index: number;
236
  line: number;
237
  text: string;
238
  when_ms: number;
239
};
240
241
export type FileChange = {
242
  added: number;
243
  from?: string | null;
244
  kind: string;
245
  path: string;
246
  removed: number;
247
};
248
249
export type ChangeDetail = {
250
  body: string;
251
  change: ChangeSummary;
252
  dependents: string[];
253
  files: FileChange[];
254
  in_bookmarks: string[];
255
  in_tags: string[];
256
};
257
258
export type History = {
259
  changes: ChangeSummary[];
260
  heads: string[];
261
  offset: number;
262
  reference: string;
263
  total: number;
264
};
265
266
export type Conflict = {
267
  bookmark: string;
268
  contributors: string[];
269
  kind: string;
270
  path: string;
271
};
272
273
export type Push = {
274
  at_ms: number;
275
  changes: number;
276
  heads: number;
277
  new_state: string;
278
  ok: boolean;
279
  old_state: string;
280
  pusher: string;
281
  reason: string;
282
  reference: string;
283
};
284
285
export type Policy = {
286
  expires_ms: number;
287
  root_threshold: number;
288
  roots: string[];
289
  rules: Rule[];
290
  serial: number;
291
};
292
293
export type Rule = {
294
  allow_conflicts: boolean;
295
  keys: string[];
296
  pattern: string;
297
  require: string;
298
  threshold: number;
299
};
300
301
export type Trust = {
302
  hub_key: string;
303
  invalid: string[];
304
  policy?: Policy | unknown;
305
  sealed: number;
306
  signed: number;
307
  unsigned: number;
308
};
309
310
export type Hook = {
311
  active: boolean;
312
  created_ms: number;
313
  events: string;
314
  id: number;
315
  url: string;
316
};
317
318
export type NewHook = {
319
  events?: string;
320
  secret: string;
321
  url: string;
322
};
323
324
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
325
326
export type Check = {
327
  finished_ms?: number | null;
328
  name: string;
329
  reporter: string;
330
  seal?: string | null;
331
  started_ms: number;
332
  state: string;
333
  status: CheckStatus;
334
  summary: string;
335
  url: string;
336
};
337
338
export type NewCheck = {
339
  name: string;
340
  seal?: string | null;
341
  state: string;
342
  status: CheckStatus;
343
  summary?: string;
344
  url?: string;
345
};
346
347
export type User = {
348
  created_ms: number;
349
  display_name: string;
350
  is_admin: boolean;
351
  keys: string[];
352
  username: string;
353
};
354
355
export type Organisation = {
356
  description: string;
357
  display_name: string;
358
  members: string[];
359
  name: string;
360
};
361
362
export type NewRepository = {
363
  description?: string;
364
  name: string;
365
  owner: string;
366
  visibility?: Visibility;
367
};
368
369
export type NewIssue = {
370
  assignees?: string[];
371
  body?: string;
372
  labels?: string[];
373
  milestone?: string | null;
374
  title: string;
375
};
376
377
export type IssueEdit = {
378
  assignees?: string[] | null;
379
  body?: string | null;
380
  labels?: string[] | null;
381
  milestone?: string | null;
382
  title?: string | null;
383
};
384
385
export type ReleaseEdit = {
386
  notes?: string | null;
387
  prerelease?: boolean | null;
388
  title?: string | null;
389
};
390
391
export type ProposalEdit = {
392
  body?: string | null;
393
  labels?: string[] | null;
394
  state?: string | null;
395
  title?: string | null;
396
};
397
398
export type NewLabel = {
399
  colour?: string | null;
400
  description?: string;
401
  name: string;
402
};
403
404
export type RequiredChecks = {
405
  names: string[];
406
};
407
408
export type Project = {
409
  closed: boolean;
410
  description: string;
411
  number: number;
412
  owner: string;
413
  public: boolean;
414
  title: string;
415
  updated_ms: number;
416
  url: string;
417
};
418
419
export type ProjectCard = {
420
  id: number;
421
  kind: string;
422
  reference: string;
423
  state: string;
424
  title: string;
425
};
426
427
export type ProjectColumn = {
428
  cards: ProjectCard[];
429
  id: number;
430
  name: string;
431
};
432
433
export type Board = {
434
  columns: ProjectColumn[];
435
  project: Project;
436
};
437
438
export type NewProject = {
439
  description?: string;
440
  private?: boolean;
441
  title: string;
442
};
443
444
export type ProjectEdit = {
445
  closed?: boolean | null;
446
  description?: string | null;
447
  owner?: string | null;
448
  private?: boolean | null;
449
  title?: string | null;
450
};
451
452
export type NewCard = {
453
  column?: string | null;
454
  note?: string;
455
  reference?: string;
456
};
457
458
export type CardMove = {
459
  column: string;
460
};
461
462
export type NewComment = {
463
  body: string;
464
  line?: number | null;
465
  path?: string | null;
466
};
467
468
export type NewProposal = {
469
  body?: string;
470
  draft?: boolean;
471
  source: string;
472
  target: string;
473
  title: string;
474
};
475
476
export type NewReview = {
477
  body?: string;
478
  verdict: string;
479
};
480
481
export type IssueStateChange = {
482
  reason?: string;
483
  state: string;
484
};
485
486
export type WebhookEnvelope = {
487
  actor: string;
488
  at_ms: number;
489
  data: unknown;
490
  delivery: string;
491
  event: string;
492
  repository?: Repository | unknown;
493
};
494
495
export type ProposalEvent = {
496
  check?: Check | unknown;
497
  kind: string;
498
  number: number;
499
};
500
501
export type AssetBuild = {
502
  artifact: string;
503
  job: string;
504
  receipt?: string | null;
505
  receipt_url?: string | null;
506
  run: number;
507
  run_url: string;
508
  signer?: string | null;
509
};
510
511
export type ReleaseAsset = {
512
  built_by?: AssetBuild | null;
513
  content_type: string;
514
  downloads: number;
515
  hash: string;
516
  name: string;
517
  size: number;
518
  url: string;
519
};
520
521
export type Release = {
522
  archives: string[];
523
  assets: ReleaseAsset[];
524
  author: string;
525
  created_ms: number;
526
  heads: string[];
527
  latest: boolean;
528
  notes: string;
529
  prerelease: boolean;
530
  signer?: string | null;
531
  tag: string;
532
  title: string;
533
  url: string;
534
};
535
536
export type FlowJob = {
537
  depends_on: string[];
538
  error: string;
539
  exit_code?: number | null;
540
  finished_ms?: number | null;
541
  log_lines: number;
542
  name: string;
543
  placed?: string;
544
  runner: string;
545
  started_ms?: number | null;
546
  status: string;
547
  waiting?: string;
548
};
549
550
export type FlowRun = {
551
  actor: string;
552
  bookmark: string;
553
  created_ms: number;
554
  error: string;
555
  finished_ms?: number | null;
556
  heads: string[];
557
  jobs?: FlowJob[];
558
  number: number;
559
  pipeline_hash: string;
560
  queue_position?: number | null;
561
  state: string;
562
  status: string;
563
  trigger: string;
564
  url: string;
565
};
566
567
export type FlowLogLine = {
568
  seq: number;
569
  stream: string;
570
  t: number;
571
  text: string;
572
};
573
574
export type NewRelease = {
575
  notes?: string | null;
576
  prerelease?: boolean;
577
  tag: string;
578
  title: string;
579
};
580