OXYGENHUB
◆ v0.9.22 oxygenhub / crates / hub-api / ts / index.d.ts
13.4 KiB · last changed OxygenHub 0.9.17: the TypeScript types gain the dashboard's proposals, the starter and test reports (refs #349) 6 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 DiffusionHalf = {
18
  title: string;
19
  tone: string;
20
  word: string;
21
};
22
23
export type DiffusionPin = {
24
  behind?: number | null;
25
  bookmark: string;
26
  bump?: number | null;
27
  consumer: string;
28
  consumer_state: DiffusionHalf;
29
  follow: string;
30
  path: string;
31
  run?: number | null;
32
  run_status?: string | null;
33
  upstream: string;
34
  upstream_state: DiffusionHalf;
35
};
36
37
export type Diffusion = {
38
  diffuses_to: DiffusionPin[];
39
  takes_from: DiffusionPin[];
40
};
41
42
export type Bookmark = {
43
  changes: number;
44
  default: boolean;
45
  heads: string[];
46
  name: string;
47
};
48
49
export type Tag = {
50
  heads: string[];
51
  message: string;
52
  name: string;
53
  signer?: string | null;
54
};
55
56
export type Author = {
57
  account?: string | null;
58
  email: string;
59
  key: string;
60
  name: string;
61
  note?: string | null;
62
};
63
64
export type Signature = {
65
  status: "unsigned";
66
} | {
67
  key: string;
68
  revoked: boolean;
69
  sealed: boolean;
70
  status: "valid";
71
} | {
72
  reason: string;
73
  status: "invalid";
74
};
75
76
export type Via = {
77
  expires_ms?: number | null;
78
  key: string;
79
  name: string;
80
  revoked: boolean;
81
  scope: string;
82
};
83
84
export type ChangeSummary = {
85
  author: Author;
86
  deps: string[];
87
  hash: string;
88
  head: boolean;
89
  message: string;
90
  signature: Signature;
91
  via?: Via | null;
92
  when_ms: number;
93
};
94
95
export type Problem = {
96
  detail: string;
97
  status: number;
98
  title: string;
99
};
100
101
export type Approval = {
102
  account: string;
103
  key?: string | null;
104
  sealed: boolean;
105
};
106
107
export type Label = {
108
  colour: string;
109
  description: string;
110
  name: string;
111
};
112
113
export type Landed = {
114
  by: string;
115
  via: string;
116
  when_ms: number;
117
};
118
119
export type ProposalSource = {
120
  bookmark: string;
121
  kind: "bookmark";
122
} | {
123
  bookmark: string;
124
  kind: "fork";
125
  name: string;
126
  owner: string;
127
} | {
128
  hashes: string[];
129
  kind: "changes";
130
};
131
132
export type ProposalState = "draft" | "open" | "landed" | "closed";
133
134
export type Proposal = {
135
  approvals: Approval[];
136
  author: string;
137
  auto_land?: string | null;
138
  blockers: string[];
139
  body: string;
140
  changes: ChangeSummary[];
141
  conflicted: boolean;
142
  created_ms: number;
143
  labels?: Label[];
144
  landable: boolean;
145
  landed?: Landed | null;
146
  number: number;
147
  projected_heads: string[];
148
  projected_state?: string | null;
149
  repository_url: string;
150
  requested_reviewers?: string[];
151
  source: ProposalSource;
152
  source_url?: string | null;
153
  state: ProposalState;
154
  target: string;
155
  title: string;
156
  updated_ms: number;
157
  url: string;
158
};
159
160
export type Issue = {
161
  assignees: string[];
162
  author: string;
163
  body: string;
164
  closed_ms?: number | null;
165
  comments: number;
166
  created_ms: number;
167
  labels: Label[];
168
  locked: boolean;
169
  milestone?: string | null;
170
  number: number;
171
  pinned: boolean;
172
  reason: string;
173
  state: string;
174
  title: string;
175
  updated_ms: number;
176
  url: string;
177
};
178
179
export type Milestone = {
180
  closed: number;
181
  description: string;
182
  due_ms?: number | null;
183
  open: number;
184
  state: string;
185
  title: string;
186
};
187
188
export type NewMilestone = {
189
  description?: string;
190
  due?: string | null;
191
  title: string;
192
};
193
194
export type MilestoneEdit = {
195
  description?: string | null;
196
  due?: string | null;
197
  state?: string | null;
198
  title?: string | null;
199
};
200
201
export type Atom = {
202
  change: string;
203
  index: number;
204
};
205
206
export type Comment = {
207
  anchor?: Atom | null;
208
  author: string;
209
  body: string;
210
  created_ms: number;
211
  id: number;
212
  line?: number | null;
213
  path?: string | null;
214
  resolved: boolean;
215
};
216
217
export type ProposalFile = {
218
  added: number;
219
  from?: string | null;
220
  kind: string;
221
  path: string;
222
  removed: number;
223
};
224
225
export type Notification = {
226
  actor: string;
227
  at_ms: number;
228
  id: number;
229
  kind: string;
230
  label?: string | null;
231
  read: boolean;
232
  reason?: string;
233
  repository?: string | null;
234
  thread?: string;
235
  title: string;
236
  url: string;
237
};
238
239
export type Inbox = {
240
  items: Notification[];
241
  unread: number;
242
};
243
244
export type Review = {
245
  author: string;
246
  body: string;
247
  created_ms: number;
248
  id: number;
249
  sealed: boolean;
250
  verdict: string;
251
  via?: string;
252
};
253
254
export type TreeEntry = {
255
  conflicted: boolean;
256
  exec: boolean;
257
  kind: string;
258
  name: string;
259
  path: string;
260
  size?: number | null;
261
};
262
263
export type BlameLine = {
264
  author: string;
265
  change: string;
266
  index: number;
267
  line: number;
268
  text: string;
269
  when_ms: number;
270
};
271
272
export type DiffLine = {
273
  kind: string;
274
  new?: number | null;
275
  old?: number | null;
276
  text?: string;
277
};
278
279
export type FileChange = {
280
  added: number;
281
  from?: string | null;
282
  kind: string;
283
  lines?: DiffLine[];
284
  path: string;
285
  removed: number;
286
  truncated?: boolean;
287
};
288
289
export type ChangeDetail = {
290
  body: string;
291
  change: ChangeSummary;
292
  dependents: string[];
293
  files: FileChange[];
294
  in_bookmarks: string[];
295
  in_tags: string[];
296
};
297
298
export type History = {
299
  changes: ChangeSummary[];
300
  heads: string[];
301
  offset: number;
302
  reference: string;
303
  total: number;
304
};
305
306
export type Conflict = {
307
  bookmark: string;
308
  contributors: string[];
309
  kind: string;
310
  path: string;
311
};
312
313
export type Push = {
314
  at_ms: number;
315
  changes: number;
316
  heads: number;
317
  new_state: string;
318
  ok: boolean;
319
  old_state: string;
320
  pusher: string;
321
  reason: string;
322
  reference: string;
323
};
324
325
export type Policy = {
326
  expires_ms: number;
327
  root_threshold: number;
328
  roots: string[];
329
  rules: Rule[];
330
  serial: number;
331
};
332
333
export type Rule = {
334
  allow_conflicts: boolean;
335
  keys: string[];
336
  pattern: string;
337
  require: string;
338
  threshold: number;
339
};
340
341
export type Trust = {
342
  hub_key: string;
343
  invalid: string[];
344
  policy?: Policy | null;
345
  sealed: number;
346
  signed: number;
347
  unsigned: number;
348
};
349
350
export type Hook = {
351
  active: boolean;
352
  created_ms: number;
353
  events: string;
354
  id: number;
355
  url: string;
356
};
357
358
export type NewHook = {
359
  events?: string;
360
  secret: string;
361
  url: string;
362
};
363
364
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
365
366
export type Check = {
367
  finished_ms?: number | null;
368
  name: string;
369
  reporter: string;
370
  seal?: string | null;
371
  started_ms: number;
372
  state: string;
373
  status: CheckStatus;
374
  summary: string;
375
  url: string;
376
};
377
378
export type NewCheck = {
379
  name: string;
380
  seal?: string | null;
381
  state: string;
382
  status: CheckStatus;
383
  summary?: string;
384
  url?: string;
385
};
386
387
export type User = {
388
  created_ms: number;
389
  display_name: string;
390
  is_admin: boolean;
391
  keys: string[];
392
  username: string;
393
};
394
395
export type Organisation = {
396
  description: string;
397
  display_name: string;
398
  members: string[];
399
  name: string;
400
};
401
402
export type NewRepository = {
403
  description?: string;
404
  name: string;
405
  owner: string;
406
  visibility?: Visibility;
407
};
408
409
export type NewIssue = {
410
  assignees?: string[];
411
  body?: string;
412
  labels?: string[];
413
  milestone?: string | null;
414
  title: string;
415
};
416
417
export type IssueEdit = {
418
  assignees?: string[] | null;
419
  body?: string | null;
420
  labels?: string[] | null;
421
  milestone?: string | null;
422
  title?: string | null;
423
};
424
425
export type ReleaseEdit = {
426
  notes?: string | null;
427
  prerelease?: boolean | null;
428
  title?: string | null;
429
};
430
431
export type ProposalEdit = {
432
  body?: string | null;
433
  draft?: boolean | null;
434
  labels?: string[] | null;
435
  state?: string | null;
436
  title?: string | null;
437
};
438
439
export type NewLabel = {
440
  colour?: string | null;
441
  description?: string;
442
  name: string;
443
};
444
445
export type RequiredChecks = {
446
  names: string[];
447
};
448
449
export type Project = {
450
  closed: boolean;
451
  description: string;
452
  number: number;
453
  owner: string;
454
  public: boolean;
455
  title: string;
456
  updated_ms: number;
457
  url: string;
458
};
459
460
export type ProjectCard = {
461
  archived_ms?: number | null;
462
  assignees?: string[];
463
  id: number;
464
  kind: string;
465
  labels?: string[];
466
  reference: string;
467
  state: string;
468
  title: string;
469
};
470
471
export type ProjectColumn = {
472
  cards: ProjectCard[];
473
  id: number;
474
  name: string;
475
};
476
477
export type Board = {
478
  columns: ProjectColumn[];
479
  project: Project;
480
};
481
482
export type NewProject = {
483
  description?: string;
484
  private?: boolean;
485
  title: string;
486
};
487
488
export type ProjectEdit = {
489
  closed?: boolean | null;
490
  description?: string | null;
491
  owner?: string | null;
492
  private?: boolean | null;
493
  title?: string | null;
494
};
495
496
export type NewCard = {
497
  column?: string | null;
498
  note?: string;
499
  reference?: string;
500
};
501
502
export type CardMove = {
503
  column: string;
504
};
505
506
export type NewComment = {
507
  body: string;
508
  line?: number | null;
509
  path?: string | null;
510
};
511
512
export type NewProposal = {
513
  body?: string;
514
  draft?: boolean;
515
  source: string;
516
  target: string;
517
  title: string;
518
};
519
520
export type NewReview = {
521
  body?: string;
522
  verdict: string;
523
};
524
525
export type IssueStateChange = {
526
  reason?: string;
527
  state: string;
528
};
529
530
export type WebhookEnvelope = {
531
  actor: string;
532
  at_ms: number;
533
  data: unknown;
534
  delivery: string;
535
  event: string;
536
  repository?: Repository | null;
537
};
538
539
export type ProposalEvent = {
540
  check?: Check | null;
541
  kind: string;
542
  number: number;
543
};
544
545
export type AssetBuild = {
546
  artifact: string;
547
  job: string;
548
  provenance_url?: string | null;
549
  receipt?: string | null;
550
  receipt_url?: string | null;
551
  run: number;
552
  run_url: string;
553
  signer?: string | null;
554
};
555
556
export type ReleaseAsset = {
557
  built_by?: AssetBuild | null;
558
  content_type: string;
559
  downloads: number;
560
  hash: string;
561
  name: string;
562
  size: number;
563
  url: string;
564
};
565
566
export type Release = {
567
  archives: string[];
568
  assets: ReleaseAsset[];
569
  author: string;
570
  created_ms: number;
571
  heads: string[];
572
  latest: boolean;
573
  notes: string;
574
  prerelease: boolean;
575
  signer?: string | null;
576
  tag: string;
577
  title: string;
578
  url: string;
579
};
580
581
export type FlowJob = {
582
  approval?: string;
583
  depends_on: string[];
584
  error: string;
585
  exit_code?: number | null;
586
  finished_ms?: number | null;
587
  log_lines: number;
588
  name: string;
589
  peak_disk_mib?: number | null;
590
  peak_memory_mib?: number | null;
591
  phases?: FlowPhase[];
592
  placed?: string;
593
  queued_ms?: number | null;
594
  ready_ms?: number | null;
595
  runner: string;
596
  started_ms?: number | null;
597
  status: string;
598
  waiting?: string;
599
};
600
601
export type FlowPhase = {
602
  ms: number;
603
  name: string;
604
};
605
606
export type FlowRun = {
607
  actor: string;
608
  bookmark: string;
609
  created_ms: number;
610
  error: string;
611
  finished_ms?: number | null;
612
  heads: string[];
613
  jobs?: FlowJob[];
614
  number: number;
615
  pipeline_hash: string;
616
  queue_position?: number | null;
617
  state: string;
618
  status: string;
619
  trigger: string;
620
  url: string;
621
};
622
623
export type FlowLogLine = {
624
  seq: number;
625
  stream: string;
626
  t: number;
627
  text: string;
628
};
629
630
export type ReportFile = {
631
  path: string;
632
  size: number;
633
};
634
635
export type ReportMetric = {
636
  better: string;
637
  fail_above?: number | null;
638
  fail_below?: number | null;
639
  key: string;
640
  unit: string;
641
  value: number;
642
};
643
644
export type Report = {
645
  bookmark: string;
646
  bytes: number;
647
  context: unknown;
648
  created_ms: number;
649
  files: number;
650
  files_expired_ms?: number | null;
651
  id: number;
652
  job: string;
653
  kind: string;
654
  manifest?: ReportFile[];
655
  metrics: ReportMetric[];
656
  name: string;
657
  run?: number | null;
658
  state: string;
659
  summary: string;
660
  title: string;
661
  url: string;
662
};
663
664
export type NewRelease = {
665
  notes?: string | null;
666
  prerelease?: boolean;
667
  tag: string;
668
  title: string;
669
};
670
671
export type DropFile = {
672
  content?: string | null;
673
  name: string;
674
  raw_url: string;
675
  size: number;
676
};
677
678
export type Drop = {
679
  clone_url: string;
680
  created_ms: number;
681
  description: string;
682
  embed_url?: string;
683
  files: DropFile[];
684
  forked_from?: string | null;
685
  id: string;
686
  owner: string;
687
  starred?: boolean;
688
  stars?: number;
689
  title: string;
690
  updated_ms: number;
691
  url: string;
692
  visibility: string;
693
};
694
695
export type DropComment = {
696
  author: string;
697
  body: string;
698
  created_ms: number;
699
  id: number;
700
};
701
702
export type NewDropComment = {
703
  body: string;
704
};
705
706
export type DropStars = {
707
  starred: boolean;
708
  stars: number;
709
};
710
711
export type NewDropFile = {
712
  content: string;
713
  name: string;
714
};
715
716
export type NewDrop = {
717
  description?: string;
718
  files: NewDropFile[];
719
  secret?: boolean;
720
  title?: string;
721
};
722
723
export type DropFileEdit = {
724
  content?: string | null;
725
  name: string;
726
};
727
728
export type DropEdit = {
729
  description?: string | null;
730
  files?: DropFileEdit[];
731
  message?: string | null;
732
  secret?: boolean | null;
733
  title?: string | null;
734
};
735
736
export type ProposalBrief = {
737
  author: string;
738
  conflicted: boolean;
739
  number: number;
740
  repository: string;
741
  state: ProposalState;
742
  title: string;
743
  updated_ms: number;
744
  url: string;
745
};
746
747
export type UserProposals = {
748
  authored: ProposalBrief[];
749
  landable?: ProposalBrief[];
750
  review: ProposalBrief[];
751
};
752
753
export type StarterAssistant = {
754
  from: string;
755
  model: string;
756
  name: string;
757
};
758
759
export type StarterAssistants = {
760
  assistants: StarterAssistant[];
761
};
762
763
export type StarterStatus = {
764
  assistant?: string;
765
  change?: string;
766
  error?: string;
767
  files?: string[];
768
  status: string;
769
};
770
771
export type StarterRequest = {
772
  assistant?: string | null;
773
  description: string;
774
};
775
776
export type TestReport = {
777
  bookmark: string;
778
  created_ms: number;
779
  errors: number;
780
  failed: number;
781
  id: number;
782
  job: string;
783
  passed: number;
784
  run: number;
785
  skipped: number;
786
  state: string;
787
  tests: number;
788
  time_ms: number;
789
  url: string;
790
};
791
792
export type TestCase = {
793
  classname: string;
794
  message: string;
795
  name: string;
796
  output: string;
797
  status: string;
798
  suite: string;
799
  time_ms: number;
800
};
801
802
export type TestReportDetail = {
803
  cases: TestCase[];
804
  report: TestReport;
805
};
806