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