OXYGENHUB
# f4e138301198 oxygenhub / crates / hub-api / ts / index.d.ts
10.9 KiB · last changed Drops: per-user gists, each a small hidden Oxygen repository (#279) 16 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 | unknown;
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
  read: boolean;
231
  title: string;
232
  url: string;
233
};
234
235
export type Inbox = {
236
  items: Notification[];
237
  unread: number;
238
};
239
240
export type Review = {
241
  author: string;
242
  body: string;
243
  created_ms: number;
244
  id: number;
245
  sealed: boolean;
246
  verdict: string;
247
  via?: string;
248
};
249
250
export type TreeEntry = {
251
  conflicted: boolean;
252
  exec: boolean;
253
  kind: string;
254
  name: string;
255
  path: string;
256
  size?: number | null;
257
};
258
259
export type BlameLine = {
260
  author: string;
261
  change: string;
262
  index: number;
263
  line: number;
264
  text: string;
265
  when_ms: number;
266
};
267
268
export type FileChange = {
269
  added: number;
270
  from?: string | null;
271
  kind: string;
272
  path: string;
273
  removed: number;
274
};
275
276
export type ChangeDetail = {
277
  body: string;
278
  change: ChangeSummary;
279
  dependents: string[];
280
  files: FileChange[];
281
  in_bookmarks: string[];
282
  in_tags: string[];
283
};
284
285
export type History = {
286
  changes: ChangeSummary[];
287
  heads: string[];
288
  offset: number;
289
  reference: string;
290
  total: number;
291
};
292
293
export type Conflict = {
294
  bookmark: string;
295
  contributors: string[];
296
  kind: string;
297
  path: string;
298
};
299
300
export type Push = {
301
  at_ms: number;
302
  changes: number;
303
  heads: number;
304
  new_state: string;
305
  ok: boolean;
306
  old_state: string;
307
  pusher: string;
308
  reason: string;
309
  reference: string;
310
};
311
312
export type Policy = {
313
  expires_ms: number;
314
  root_threshold: number;
315
  roots: string[];
316
  rules: Rule[];
317
  serial: number;
318
};
319
320
export type Rule = {
321
  allow_conflicts: boolean;
322
  keys: string[];
323
  pattern: string;
324
  require: string;
325
  threshold: number;
326
};
327
328
export type Trust = {
329
  hub_key: string;
330
  invalid: string[];
331
  policy?: Policy | unknown;
332
  sealed: number;
333
  signed: number;
334
  unsigned: number;
335
};
336
337
export type Hook = {
338
  active: boolean;
339
  created_ms: number;
340
  events: string;
341
  id: number;
342
  url: string;
343
};
344
345
export type NewHook = {
346
  events?: string;
347
  secret: string;
348
  url: string;
349
};
350
351
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
352
353
export type Check = {
354
  finished_ms?: number | null;
355
  name: string;
356
  reporter: string;
357
  seal?: string | null;
358
  started_ms: number;
359
  state: string;
360
  status: CheckStatus;
361
  summary: string;
362
  url: string;
363
};
364
365
export type NewCheck = {
366
  name: string;
367
  seal?: string | null;
368
  state: string;
369
  status: CheckStatus;
370
  summary?: string;
371
  url?: string;
372
};
373
374
export type User = {
375
  created_ms: number;
376
  display_name: string;
377
  is_admin: boolean;
378
  keys: string[];
379
  username: string;
380
};
381
382
export type Organisation = {
383
  description: string;
384
  display_name: string;
385
  members: string[];
386
  name: string;
387
};
388
389
export type NewRepository = {
390
  description?: string;
391
  name: string;
392
  owner: string;
393
  visibility?: Visibility;
394
};
395
396
export type NewIssue = {
397
  assignees?: string[];
398
  body?: string;
399
  labels?: string[];
400
  milestone?: string | null;
401
  title: string;
402
};
403
404
export type IssueEdit = {
405
  assignees?: string[] | null;
406
  body?: string | null;
407
  labels?: string[] | null;
408
  milestone?: string | null;
409
  title?: string | null;
410
};
411
412
export type ReleaseEdit = {
413
  notes?: string | null;
414
  prerelease?: boolean | null;
415
  title?: string | null;
416
};
417
418
export type ProposalEdit = {
419
  body?: string | null;
420
  labels?: string[] | null;
421
  state?: string | null;
422
  title?: string | null;
423
};
424
425
export type NewLabel = {
426
  colour?: string | null;
427
  description?: string;
428
  name: string;
429
};
430
431
export type RequiredChecks = {
432
  names: string[];
433
};
434
435
export type Project = {
436
  closed: boolean;
437
  description: string;
438
  number: number;
439
  owner: string;
440
  public: boolean;
441
  title: string;
442
  updated_ms: number;
443
  url: string;
444
};
445
446
export type ProjectCard = {
447
  id: number;
448
  kind: string;
449
  reference: string;
450
  state: string;
451
  title: string;
452
};
453
454
export type ProjectColumn = {
455
  cards: ProjectCard[];
456
  id: number;
457
  name: string;
458
};
459
460
export type Board = {
461
  columns: ProjectColumn[];
462
  project: Project;
463
};
464
465
export type NewProject = {
466
  description?: string;
467
  private?: boolean;
468
  title: string;
469
};
470
471
export type ProjectEdit = {
472
  closed?: boolean | null;
473
  description?: string | null;
474
  owner?: string | null;
475
  private?: boolean | null;
476
  title?: string | null;
477
};
478
479
export type NewCard = {
480
  column?: string | null;
481
  note?: string;
482
  reference?: string;
483
};
484
485
export type CardMove = {
486
  column: string;
487
};
488
489
export type NewComment = {
490
  body: string;
491
  line?: number | null;
492
  path?: string | null;
493
};
494
495
export type NewProposal = {
496
  body?: string;
497
  draft?: boolean;
498
  source: string;
499
  target: string;
500
  title: string;
501
};
502
503
export type NewReview = {
504
  body?: string;
505
  verdict: string;
506
};
507
508
export type IssueStateChange = {
509
  reason?: string;
510
  state: string;
511
};
512
513
export type WebhookEnvelope = {
514
  actor: string;
515
  at_ms: number;
516
  data: unknown;
517
  delivery: string;
518
  event: string;
519
  repository?: Repository | unknown;
520
};
521
522
export type ProposalEvent = {
523
  check?: Check | unknown;
524
  kind: string;
525
  number: number;
526
};
527
528
export type AssetBuild = {
529
  artifact: string;
530
  job: string;
531
  provenance_url?: string | null;
532
  receipt?: string | null;
533
  receipt_url?: string | null;
534
  run: number;
535
  run_url: string;
536
  signer?: string | null;
537
};
538
539
export type ReleaseAsset = {
540
  built_by?: AssetBuild | null;
541
  content_type: string;
542
  downloads: number;
543
  hash: string;
544
  name: string;
545
  size: number;
546
  url: string;
547
};
548
549
export type Release = {
550
  archives: string[];
551
  assets: ReleaseAsset[];
552
  author: string;
553
  created_ms: number;
554
  heads: string[];
555
  latest: boolean;
556
  notes: string;
557
  prerelease: boolean;
558
  signer?: string | null;
559
  tag: string;
560
  title: string;
561
  url: string;
562
};
563
564
export type FlowJob = {
565
  depends_on: string[];
566
  error: string;
567
  exit_code?: number | null;
568
  finished_ms?: number | null;
569
  log_lines: number;
570
  name: string;
571
  placed?: string;
572
  runner: string;
573
  started_ms?: number | null;
574
  status: string;
575
  waiting?: string;
576
};
577
578
export type FlowRun = {
579
  actor: string;
580
  bookmark: string;
581
  created_ms: number;
582
  error: string;
583
  finished_ms?: number | null;
584
  heads: string[];
585
  jobs?: FlowJob[];
586
  number: number;
587
  pipeline_hash: string;
588
  queue_position?: number | null;
589
  state: string;
590
  status: string;
591
  trigger: string;
592
  url: string;
593
};
594
595
export type FlowLogLine = {
596
  seq: number;
597
  stream: string;
598
  t: number;
599
  text: string;
600
};
601
602
export type NewRelease = {
603
  notes?: string | null;
604
  prerelease?: boolean;
605
  tag: string;
606
  title: string;
607
};
608
609
export type DropFile = {
610
  content?: string | null;
611
  name: string;
612
  raw_url: string;
613
  size: number;
614
};
615
616
export type Drop = {
617
  clone_url: string;
618
  created_ms: number;
619
  description: string;
620
  files: DropFile[];
621
  id: string;
622
  owner: string;
623
  title: string;
624
  updated_ms: number;
625
  url: string;
626
  visibility: string;
627
};
628
629
export type NewDropFile = {
630
  content: string;
631
  name: string;
632
};
633
634
export type NewDrop = {
635
  description?: string;
636
  files: NewDropFile[];
637
  secret?: boolean;
638
  title?: string;
639
};
640
641
export type DropFileEdit = {
642
  content?: string | null;
643
  name: string;
644
};
645
646
export type DropEdit = {
647
  description?: string | null;
648
  files?: DropFileEdit[];
649
  message?: string | null;
650
  secret?: boolean | null;
651
  title?: string | null;
652
};
653