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