OXYGENHUB
# bf1ab3458db1 oxygenhub / crates / hub-api / ts / index.d.ts
7.2 KiB · last changed hub-api: the Flow types in the generated TypeScript 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
  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 ChangeSummary = {
52
  author: Author;
53
  deps: string[];
54
  hash: string;
55
  head: boolean;
56
  message: string;
57
  signature: Signature;
58
  when_ms: number;
59
};
60
61
export type Problem = {
62
  detail: string;
63
  status: number;
64
  title: string;
65
};
66
67
export type Approval = {
68
  account: string;
69
  key?: string | null;
70
  sealed: boolean;
71
};
72
73
export type ProposalSource = {
74
  bookmark: string;
75
  kind: "bookmark";
76
} | {
77
  bookmark: string;
78
  kind: "fork";
79
  name: string;
80
  owner: string;
81
} | {
82
  hashes: string[];
83
  kind: "changes";
84
};
85
86
export type ProposalState = "draft" | "open" | "landed" | "closed";
87
88
export type Proposal = {
89
  approvals: Approval[];
90
  author: string;
91
  blockers: string[];
92
  body: string;
93
  changes: ChangeSummary[];
94
  conflicted: boolean;
95
  created_ms: number;
96
  landable: boolean;
97
  number: number;
98
  projected_heads: string[];
99
  projected_state?: string | null;
100
  repository_url: string;
101
  source: ProposalSource;
102
  source_url?: string | null;
103
  state: ProposalState;
104
  target: string;
105
  title: string;
106
  updated_ms: number;
107
  url: string;
108
};
109
110
export type Label = {
111
  colour: string;
112
  description: string;
113
  name: string;
114
};
115
116
export type Issue = {
117
  assignees: string[];
118
  author: string;
119
  body: string;
120
  closed_ms?: number | null;
121
  comments: number;
122
  created_ms: number;
123
  labels: Label[];
124
  locked: boolean;
125
  milestone?: string | null;
126
  number: number;
127
  pinned: boolean;
128
  reason: string;
129
  state: string;
130
  title: string;
131
  updated_ms: number;
132
  url: string;
133
};
134
135
export type Milestone = {
136
  closed: number;
137
  description: string;
138
  due_ms?: number | null;
139
  open: number;
140
  state: string;
141
  title: string;
142
};
143
144
export type Atom = {
145
  change: string;
146
  index: number;
147
};
148
149
export type Comment = {
150
  anchor?: Atom | unknown;
151
  author: string;
152
  body: string;
153
  created_ms: number;
154
  id: number;
155
  path?: string | null;
156
  resolved: boolean;
157
};
158
159
export type Review = {
160
  author: string;
161
  body: string;
162
  created_ms: number;
163
  id: number;
164
  sealed: boolean;
165
  verdict: string;
166
};
167
168
export type TreeEntry = {
169
  conflicted: boolean;
170
  exec: boolean;
171
  kind: string;
172
  name: string;
173
  path: string;
174
  size?: number | null;
175
};
176
177
export type BlameLine = {
178
  author: string;
179
  change: string;
180
  index: number;
181
  line: number;
182
  text: string;
183
  when_ms: number;
184
};
185
186
export type FileChange = {
187
  added: number;
188
  from?: string | null;
189
  kind: string;
190
  path: string;
191
  removed: number;
192
};
193
194
export type ChangeDetail = {
195
  body: string;
196
  change: ChangeSummary;
197
  dependents: string[];
198
  files: FileChange[];
199
  in_bookmarks: string[];
200
  in_tags: string[];
201
};
202
203
export type History = {
204
  changes: ChangeSummary[];
205
  heads: string[];
206
  offset: number;
207
  reference: string;
208
  total: number;
209
};
210
211
export type Conflict = {
212
  bookmark: string;
213
  contributors: string[];
214
  kind: string;
215
  path: string;
216
};
217
218
export type Push = {
219
  at_ms: number;
220
  changes: number;
221
  heads: number;
222
  new_state: string;
223
  ok: boolean;
224
  old_state: string;
225
  pusher: string;
226
  reason: string;
227
  reference: string;
228
};
229
230
export type Policy = {
231
  expires_ms: number;
232
  root_threshold: number;
233
  roots: string[];
234
  rules: Rule[];
235
  serial: number;
236
};
237
238
export type Rule = {
239
  allow_conflicts: boolean;
240
  keys: string[];
241
  pattern: string;
242
  require: string;
243
  threshold: number;
244
};
245
246
export type Trust = {
247
  hub_key: string;
248
  invalid: string[];
249
  policy?: Policy | unknown;
250
  sealed: number;
251
  signed: number;
252
  unsigned: number;
253
};
254
255
export type Hook = {
256
  active: boolean;
257
  created_ms: number;
258
  events: string;
259
  id: number;
260
  url: string;
261
};
262
263
export type NewHook = {
264
  events?: string;
265
  secret: string;
266
  url: string;
267
};
268
269
export type CheckStatus = "queued" | "running" | "passed" | "failed" | "cancelled" | "skipped";
270
271
export type Check = {
272
  finished_ms?: number | null;
273
  name: string;
274
  reporter: string;
275
  seal?: string | null;
276
  started_ms: number;
277
  state: string;
278
  status: CheckStatus;
279
  summary: string;
280
  url: string;
281
};
282
283
export type NewCheck = {
284
  name: string;
285
  seal?: string | null;
286
  state: string;
287
  status: CheckStatus;
288
  summary?: string;
289
  url?: string;
290
};
291
292
export type User = {
293
  created_ms: number;
294
  display_name: string;
295
  is_admin: boolean;
296
  keys: string[];
297
  username: string;
298
};
299
300
export type Organisation = {
301
  description: string;
302
  display_name: string;
303
  members: string[];
304
  name: string;
305
};
306
307
export type NewRepository = {
308
  description?: string;
309
  name: string;
310
  owner: string;
311
  visibility?: Visibility;
312
};
313
314
export type NewIssue = {
315
  body?: string;
316
  title: string;
317
};
318
319
export type NewComment = {
320
  body: string;
321
  line?: number | null;
322
  path?: string | null;
323
};
324
325
export type NewProposal = {
326
  body?: string;
327
  draft?: boolean;
328
  source: string;
329
  target: string;
330
  title: string;
331
};
332
333
export type NewReview = {
334
  body?: string;
335
  verdict: string;
336
};
337
338
export type IssueStateChange = {
339
  reason?: string;
340
  state: string;
341
};
342
343
export type WebhookEnvelope = {
344
  actor: string;
345
  at_ms: number;
346
  data: unknown;
347
  delivery: string;
348
  event: string;
349
  repository?: Repository | unknown;
350
};
351
352
export type ProposalEvent = {
353
  check?: Check | unknown;
354
  kind: string;
355
  number: number;
356
};
357
358
export type AssetBuild = {
359
  artifact: string;
360
  job: string;
361
  receipt?: string | null;
362
  receipt_url?: string | null;
363
  run: number;
364
  run_url: string;
365
  signer?: string | null;
366
};
367
368
export type ReleaseAsset = {
369
  built_by?: AssetBuild | null;
370
  content_type: string;
371
  downloads: number;
372
  hash: string;
373
  name: string;
374
  size: number;
375
  url: string;
376
};
377
378
export type Release = {
379
  archives: string[];
380
  assets: ReleaseAsset[];
381
  author: string;
382
  created_ms: number;
383
  heads: string[];
384
  latest: boolean;
385
  notes: string;
386
  prerelease: boolean;
387
  signer?: string | null;
388
  tag: string;
389
  title: string;
390
  url: string;
391
};
392
393
export type FlowJob = {
394
  depends_on: string[];
395
  error: string;
396
  exit_code?: number | null;
397
  finished_ms?: number | null;
398
  log_lines: number;
399
  name: string;
400
  runner: string;
401
  started_ms?: number | null;
402
  status: string;
403
};
404
405
export type FlowRun = {
406
  actor: string;
407
  bookmark: string;
408
  created_ms: number;
409
  error: string;
410
  finished_ms?: number | null;
411
  heads: string[];
412
  jobs?: FlowJob[];
413
  number: number;
414
  pipeline_hash: string;
415
  queue_position?: number | null;
416
  state: string;
417
  status: string;
418
  trigger: string;
419
  url: string;
420
};
421
422
export type FlowLogLine = {
423
  seq: number;
424
  stream: string;
425
  t: number;
426
  text: string;
427
};
428
429
export type NewRelease = {
430
  notes?: string | null;
431
  prerelease?: boolean;
432
  tag: string;
433
  title: string;
434
};
435