| 1 |
# This schema definition is available in the public domain, or under the terms |
| 2 |
# of CC-0, at your choice. |
| 3 |
scalar Cursor |
| 4 |
scalar Time |
| 5 |
scalar URL |
| 6 |
scalar Upload |
| 7 |
|
| 8 |
"Used to provide a human-friendly description of an access scope" |
| 9 |
directive @scopehelp(details: String!) on ENUM_VALUE |
| 10 |
|
| 11 |
""" |
| 12 |
This is used to decorate fields which are only accessible with a personal |
| 13 |
access token, and are not available to clients using OAuth 2.0 access tokens. |
| 14 |
""" |
| 15 |
directive @private on FIELD_DEFINITION |
| 16 |
|
| 17 |
""" |
| 18 |
This is used to decorate fields which are for internal use, and are not |
| 19 |
available to normal API users. |
| 20 |
""" |
| 21 |
directive @internal on FIELD_DEFINITION |
| 22 |
|
| 23 |
enum AccessScope { |
| 24 |
PROFILE @scopehelp(details: "profile information") |
| 25 |
TRACKERS @scopehelp(details: "trackers") |
| 26 |
TICKETS @scopehelp(details: "tickets") |
| 27 |
ACLS @scopehelp(details: "access control lists") |
| 28 |
EVENTS @scopehelp(details: "events") |
| 29 |
SUBSCRIPTIONS @scopehelp(details: "tracker & ticket subscriptions") |
| 30 |
} |
| 31 |
|
| 32 |
enum AccessKind { |
| 33 |
RO @scopehelp(details: "read") |
| 34 |
RW @scopehelp(details: "read and write") |
| 35 |
} |
| 36 |
|
| 37 |
""" |
| 38 |
Decorates fields for which access requires a particular OAuth 2.0 scope with |
| 39 |
read or write access. |
| 40 |
""" |
| 41 |
directive @access(scope: AccessScope!, kind: AccessKind!) on FIELD_DEFINITION |
| 42 |
|
| 43 |
# https://semver.org |
| 44 |
type Version { |
| 45 |
major: Int! |
| 46 |
minor: Int! |
| 47 |
patch: Int! |
| 48 |
buildVersion: String! |
| 49 |
buildDate: String! |
| 50 |
|
| 51 |
""" |
| 52 |
If this API version is scheduled for deprecation, this is the date on which |
| 53 |
it will stop working; or null if this API version is not scheduled for |
| 54 |
deprecation. |
| 55 |
""" |
| 56 |
deprecationDate: Time |
| 57 |
} |
| 58 |
|
| 59 |
interface Entity { |
| 60 |
canonicalName: String! |
| 61 |
} |
| 62 |
|
| 63 |
type User implements Entity { |
| 64 |
id: Int! |
| 65 |
created: Time! |
| 66 |
updated: Time! |
| 67 |
canonicalName: String! |
| 68 |
username: String! |
| 69 |
email: String! |
| 70 |
url: String |
| 71 |
location: String |
| 72 |
bio: String |
| 73 |
|
| 74 |
"Returns a specific tracker." |
| 75 |
tracker(name: String!): Tracker @access(scope: TRACKERS, kind: RO) |
| 76 |
|
| 77 |
trackers(cursor: Cursor): TrackerCursor! @access(scope: TRACKERS, kind: RO) |
| 78 |
} |
| 79 |
|
| 80 |
type EmailAddress implements Entity { |
| 81 |
canonicalName: String! |
| 82 |
|
| 83 |
""" |
| 84 |
"[email protected]" of "Jane Doe <[email protected]>" |
| 85 |
""" |
| 86 |
mailbox: String! |
| 87 |
""" |
| 88 |
"Jane Doe" of "Jane Doe <[email protected]>" |
| 89 |
""" |
| 90 |
name: String |
| 91 |
} |
| 92 |
|
| 93 |
type ExternalUser implements Entity { |
| 94 |
canonicalName: String! |
| 95 |
|
| 96 |
""" |
| 97 |
<service>:<service specific details...> |
| 98 |
e.g. github:ddevault |
| 99 |
""" |
| 100 |
externalId: String! |
| 101 |
"The canonical external URL for this user, e.g. https://github.com/ddevault" |
| 102 |
externalUrl: String |
| 103 |
} |
| 104 |
|
| 105 |
enum Visibility { |
| 106 |
PUBLIC |
| 107 |
UNLISTED |
| 108 |
PRIVATE |
| 109 |
} |
| 110 |
|
| 111 |
type Tracker { |
| 112 |
id: Int! |
| 113 |
rid: ID! |
| 114 |
created: Time! |
| 115 |
updated: Time! |
| 116 |
owner: Entity! @access(scope: PROFILE, kind: RO) |
| 117 |
name: String! |
| 118 |
description: String |
| 119 |
visibility: Visibility! |
| 120 |
|
| 121 |
ticket(id: Int!): Ticket @access(scope: TICKETS, kind: RO) |
| 122 |
tickets(cursor: Cursor): TicketCursor! @access(scope: TICKETS, kind: RO) |
| 123 |
label(name: String!): Label |
| 124 |
labels(cursor: Cursor): LabelCursor! |
| 125 |
|
| 126 |
""" |
| 127 |
If the authenticated user is subscribed to this tracker, this is that |
| 128 |
subscription. |
| 129 |
""" |
| 130 |
subscription: TrackerSubscription @access(scope: SUBSCRIPTIONS, kind: RO) |
| 131 |
|
| 132 |
""" |
| 133 |
The access control list entry (or the default ACL) which describes the |
| 134 |
authenticated user's permissions with respect to this tracker. |
| 135 |
""" |
| 136 |
acl: ACL |
| 137 |
|
| 138 |
# Only available to the tracker owner: |
| 139 |
defaultACL: DefaultACL! |
| 140 |
acls(cursor: Cursor): ACLCursor! @access(scope: ACLS, kind: RO) |
| 141 |
|
| 142 |
""" |
| 143 |
Returns a URL from which the tracker owner may download a gzipped JSON |
| 144 |
archive of the tracker. |
| 145 |
""" |
| 146 |
export: URL! |
| 147 |
|
| 148 |
""" |
| 149 |
Returns a list of tracker webhook subscriptions. For clients |
| 150 |
authenticated with a personal access token, this returns all webhooks |
| 151 |
configured by all GraphQL clients for your account. For clients |
| 152 |
authenticated with an OAuth 2.0 access token, this returns only webhooks |
| 153 |
registered for your client. |
| 154 |
""" |
| 155 |
webhooks(cursor: Cursor): WebhookSubscriptionCursor! |
| 156 |
|
| 157 |
"Returns details of a tracker webhook subscription by its ID." |
| 158 |
webhook(id: Int!): WebhookSubscription |
| 159 |
} |
| 160 |
|
| 161 |
type OAuthClient { |
| 162 |
uuid: String! |
| 163 |
} |
| 164 |
|
| 165 |
enum WebhookEvent { |
| 166 |
TRACKER_CREATED |
| 167 |
TRACKER_UPDATE |
| 168 |
TRACKER_DELETED |
| 169 |
TICKET_CREATED |
| 170 |
TICKET_UPDATE |
| 171 |
TICKET_DELETED |
| 172 |
LABEL_CREATED |
| 173 |
LABEL_UPDATE |
| 174 |
LABEL_DELETED |
| 175 |
EVENT_CREATED |
| 176 |
} |
| 177 |
|
| 178 |
interface WebhookSubscription { |
| 179 |
id: Int! |
| 180 |
events: [WebhookEvent!]! |
| 181 |
query: String! |
| 182 |
url: String! |
| 183 |
|
| 184 |
""" |
| 185 |
If this webhook was registered by an authorized OAuth 2.0 client, this |
| 186 |
field is non-null. |
| 187 |
""" |
| 188 |
client: OAuthClient @private |
| 189 |
|
| 190 |
"All deliveries which have been sent to this webhook." |
| 191 |
deliveries(cursor: Cursor): WebhookDeliveryCursor! |
| 192 |
|
| 193 |
"Returns a sample payload for this subscription, for testing purposes" |
| 194 |
sample(event: WebhookEvent!): String! |
| 195 |
} |
| 196 |
|
| 197 |
type UserWebhookSubscription implements WebhookSubscription { |
| 198 |
id: Int! |
| 199 |
events: [WebhookEvent!]! |
| 200 |
query: String! |
| 201 |
url: String! |
| 202 |
client: OAuthClient @private |
| 203 |
deliveries(cursor: Cursor): WebhookDeliveryCursor! |
| 204 |
sample(event: WebhookEvent!): String! |
| 205 |
} |
| 206 |
|
| 207 |
type TrackerWebhookSubscription implements WebhookSubscription { |
| 208 |
id: Int! |
| 209 |
events: [WebhookEvent!]! |
| 210 |
query: String! |
| 211 |
url: String! |
| 212 |
client: OAuthClient @private |
| 213 |
deliveries(cursor: Cursor): WebhookDeliveryCursor! |
| 214 |
sample(event: WebhookEvent!): String! |
| 215 |
|
| 216 |
tracker: Tracker! |
| 217 |
} |
| 218 |
|
| 219 |
type TicketWebhookSubscription implements WebhookSubscription { |
| 220 |
id: Int! |
| 221 |
events: [WebhookEvent!]! |
| 222 |
query: String! |
| 223 |
url: String! |
| 224 |
client: OAuthClient @private |
| 225 |
deliveries(cursor: Cursor): WebhookDeliveryCursor! |
| 226 |
sample(event: WebhookEvent!): String! |
| 227 |
|
| 228 |
ticket: Ticket! |
| 229 |
} |
| 230 |
|
| 231 |
type WebhookDelivery { |
| 232 |
uuid: String! |
| 233 |
date: Time! |
| 234 |
event: WebhookEvent! |
| 235 |
subscription: WebhookSubscription! |
| 236 |
requestBody: String! |
| 237 |
|
| 238 |
""" |
| 239 |
These details are provided only after a response is received from the |
| 240 |
remote server. If a response is sent whose Content-Type is not text/*, or |
| 241 |
cannot be decoded as UTF-8, the response body will be null. It will be |
| 242 |
truncated after 64 KiB. |
| 243 |
""" |
| 244 |
responseBody: String |
| 245 |
responseHeaders: String |
| 246 |
responseStatus: Int |
| 247 |
} |
| 248 |
|
| 249 |
interface WebhookPayload { |
| 250 |
uuid: String! |
| 251 |
event: WebhookEvent! |
| 252 |
date: Time! |
| 253 |
} |
| 254 |
|
| 255 |
type TrackerEvent implements WebhookPayload { |
| 256 |
uuid: String! |
| 257 |
event: WebhookEvent! |
| 258 |
date: Time! |
| 259 |
|
| 260 |
tracker: Tracker! |
| 261 |
} |
| 262 |
|
| 263 |
type TicketEvent implements WebhookPayload { |
| 264 |
uuid: String! |
| 265 |
event: WebhookEvent! |
| 266 |
date: Time! |
| 267 |
|
| 268 |
ticket: Ticket! |
| 269 |
} |
| 270 |
|
| 271 |
type TicketDeletedEvent implements WebhookPayload { |
| 272 |
uuid: String! |
| 273 |
event: WebhookEvent! |
| 274 |
date: Time! |
| 275 |
|
| 276 |
trackerId: Int! |
| 277 |
ticketId: Int! |
| 278 |
} |
| 279 |
|
| 280 |
type EventCreated implements WebhookPayload { |
| 281 |
uuid: String! |
| 282 |
event: WebhookEvent! |
| 283 |
date: Time! |
| 284 |
|
| 285 |
newEvent: Event! |
| 286 |
} |
| 287 |
|
| 288 |
type LabelEvent implements WebhookPayload { |
| 289 |
uuid: String! |
| 290 |
event: WebhookEvent! |
| 291 |
date: Time! |
| 292 |
|
| 293 |
label: Label! |
| 294 |
} |
| 295 |
|
| 296 |
enum TicketStatus { |
| 297 |
REPORTED |
| 298 |
CONFIRMED |
| 299 |
IN_PROGRESS |
| 300 |
PENDING |
| 301 |
RESOLVED |
| 302 |
} |
| 303 |
|
| 304 |
enum TicketResolution { |
| 305 |
UNRESOLVED |
| 306 |
CLOSED |
| 307 |
FIXED |
| 308 |
IMPLEMENTED |
| 309 |
WONT_FIX |
| 310 |
BY_DESIGN |
| 311 |
INVALID |
| 312 |
DUPLICATE |
| 313 |
NOT_OUR_BUG |
| 314 |
} |
| 315 |
|
| 316 |
enum Authenticity { |
| 317 |
""" |
| 318 |
The server vouches for this information as entered verbatim by the |
| 319 |
attributed entity. |
| 320 |
""" |
| 321 |
AUTHENTIC |
| 322 |
""" |
| 323 |
The server does not vouch for this information as entered by the attributed |
| 324 |
entity, no authentication was provided. |
| 325 |
""" |
| 326 |
UNAUTHENTICATED |
| 327 |
""" |
| 328 |
The server has evidence that the information has likely been manipulated by |
| 329 |
a third party. |
| 330 |
""" |
| 331 |
TAMPERED |
| 332 |
} |
| 333 |
|
| 334 |
type Ticket { |
| 335 |
""" |
| 336 |
The ticket ID is unique within each tracker, but is not globally unique. |
| 337 |
The first ticket opened on a given tracker will have ID 1, then 2, and so |
| 338 |
on. |
| 339 |
""" |
| 340 |
id: Int! |
| 341 |
|
| 342 |
created: Time! |
| 343 |
updated: Time! |
| 344 |
submitter: Entity! @access(scope: PROFILE, kind: RO) |
| 345 |
tracker: Tracker! @access(scope: TRACKERS, kind: RO) |
| 346 |
|
| 347 |
""" |
| 348 |
Canonical ticket reference string; may be used in comments to identify the |
| 349 |
ticket from anywhere. |
| 350 |
""" |
| 351 |
ref: String! |
| 352 |
|
| 353 |
subject: String! |
| 354 |
body: String |
| 355 |
status: TicketStatus! |
| 356 |
resolution: TicketResolution! |
| 357 |
authenticity: Authenticity! |
| 358 |
|
| 359 |
labels: [Label!]! |
| 360 |
assignees: [Entity!]! @access(scope: PROFILE, kind: RO) |
| 361 |
events(cursor: Cursor): EventCursor! @access(scope: EVENTS, kind: RO) |
| 362 |
|
| 363 |
""" |
| 364 |
If the authenticated user is subscribed to this ticket, this is that |
| 365 |
subscription. |
| 366 |
""" |
| 367 |
subscription: TicketSubscription @access(scope: SUBSCRIPTIONS, kind: RO) |
| 368 |
|
| 369 |
""" |
| 370 |
Returns a list of ticket webhook subscriptions. For clients |
| 371 |
authenticated with a personal access token, this returns all webhooks |
| 372 |
configured by all GraphQL clients for your account. For clients |
| 373 |
authenticated with an OAuth 2.0 access token, this returns only webhooks |
| 374 |
registered for your client. |
| 375 |
""" |
| 376 |
webhooks(cursor: Cursor): WebhookSubscriptionCursor! |
| 377 |
|
| 378 |
"Returns details of a ticket webhook subscription by its ID." |
| 379 |
webhook(id: Int!): WebhookSubscription |
| 380 |
} |
| 381 |
|
| 382 |
interface ACL { |
| 383 |
"Permission to view tickets" |
| 384 |
browse: Boolean! |
| 385 |
"Permission to submit tickets" |
| 386 |
submit: Boolean! |
| 387 |
"Permission to comment on tickets" |
| 388 |
comment: Boolean! |
| 389 |
"Permission to edit tickets" |
| 390 |
edit: Boolean! |
| 391 |
"Permission to resolve, re-open, transfer, or label tickets" |
| 392 |
triage: Boolean! |
| 393 |
} |
| 394 |
|
| 395 |
""" |
| 396 |
These ACLs are configured for specific entities, and may be used to expand or |
| 397 |
constrain the rights of a participant. |
| 398 |
""" |
| 399 |
type TrackerACL implements ACL { |
| 400 |
id: Int! |
| 401 |
created: Time! |
| 402 |
tracker: Tracker! @access(scope: TRACKERS, kind: RO) |
| 403 |
entity: Entity! @access(scope: PROFILE, kind: RO) |
| 404 |
|
| 405 |
browse: Boolean! |
| 406 |
submit: Boolean! |
| 407 |
comment: Boolean! |
| 408 |
edit: Boolean! |
| 409 |
triage: Boolean! |
| 410 |
} |
| 411 |
|
| 412 |
""" |
| 413 |
These ACL policies are applied non-specifically, e.g. the default ACL for all |
| 414 |
authenticated users. |
| 415 |
""" |
| 416 |
type DefaultACL implements ACL { |
| 417 |
browse: Boolean! |
| 418 |
submit: Boolean! |
| 419 |
comment: Boolean! |
| 420 |
edit: Boolean! |
| 421 |
triage: Boolean! |
| 422 |
} |
| 423 |
|
| 424 |
type Label { |
| 425 |
id: Int! |
| 426 |
created: Time! |
| 427 |
name: String! |
| 428 |
tracker: Tracker! @access(scope: TRACKERS, kind: RO) |
| 429 |
|
| 430 |
"In CSS hexadecimal format" |
| 431 |
backgroundColor: String! |
| 432 |
foregroundColor: String! |
| 433 |
|
| 434 |
tickets(cursor: Cursor): TicketCursor! @access(scope: TICKETS, kind: RO) |
| 435 |
} |
| 436 |
|
| 437 |
enum EventType { |
| 438 |
CREATED |
| 439 |
COMMENT |
| 440 |
STATUS_CHANGE |
| 441 |
LABEL_ADDED |
| 442 |
LABEL_REMOVED |
| 443 |
ASSIGNED_USER |
| 444 |
UNASSIGNED_USER |
| 445 |
USER_MENTIONED |
| 446 |
TICKET_MENTIONED |
| 447 |
} |
| 448 |
|
| 449 |
""" |
| 450 |
Represents an event which affects a ticket. Multiple changes can occur in a |
| 451 |
single event, and are enumerated in the "changes" field. |
| 452 |
""" |
| 453 |
type Event { |
| 454 |
id: Int! |
| 455 |
created: Time! |
| 456 |
changes: [EventDetail!]! |
| 457 |
|
| 458 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 459 |
} |
| 460 |
|
| 461 |
interface EventDetail { |
| 462 |
eventType: EventType! |
| 463 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 464 |
} |
| 465 |
|
| 466 |
type Created implements EventDetail { |
| 467 |
eventType: EventType! |
| 468 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 469 |
author: Entity! @access(scope: PROFILE, kind: RO) |
| 470 |
} |
| 471 |
|
| 472 |
type Assignment implements EventDetail { |
| 473 |
eventType: EventType! |
| 474 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 475 |
|
| 476 |
assigner: Entity! @access(scope: PROFILE, kind: RO) |
| 477 |
assignee: Entity! @access(scope: PROFILE, kind: RO) |
| 478 |
} |
| 479 |
|
| 480 |
type Comment implements EventDetail { |
| 481 |
eventType: EventType! |
| 482 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 483 |
author: Entity! @access(scope: PROFILE, kind: RO) |
| 484 |
|
| 485 |
text: String! |
| 486 |
authenticity: Authenticity! |
| 487 |
|
| 488 |
"If this comment has been edited, this field points to the new revision." |
| 489 |
supersededBy: Comment |
| 490 |
} |
| 491 |
|
| 492 |
type LabelUpdate implements EventDetail { |
| 493 |
eventType: EventType! |
| 494 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 495 |
labeler: Entity! @access(scope: PROFILE, kind: RO) |
| 496 |
label: Label! |
| 497 |
} |
| 498 |
|
| 499 |
type StatusChange implements EventDetail { |
| 500 |
eventType: EventType! |
| 501 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 502 |
editor: Entity! @access(scope: PROFILE, kind: RO) |
| 503 |
|
| 504 |
oldStatus: TicketStatus! |
| 505 |
newStatus: TicketStatus! |
| 506 |
oldResolution: TicketResolution! |
| 507 |
newResolution: TicketResolution! |
| 508 |
} |
| 509 |
|
| 510 |
type UserMention implements EventDetail { |
| 511 |
eventType: EventType! |
| 512 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 513 |
author: Entity! @access(scope: PROFILE, kind: RO) |
| 514 |
mentioned: Entity! @access(scope: PROFILE, kind: RO) |
| 515 |
} |
| 516 |
|
| 517 |
type TicketMention implements EventDetail { |
| 518 |
eventType: EventType! |
| 519 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 520 |
author: Entity! @access(scope: PROFILE, kind: RO) |
| 521 |
mentioned: Ticket! @access(scope: TICKETS, kind: RO) |
| 522 |
} |
| 523 |
|
| 524 |
interface ActivitySubscription { |
| 525 |
id: Int! |
| 526 |
created: Time! |
| 527 |
} |
| 528 |
|
| 529 |
""" |
| 530 |
A tracker subscription will notify a participant of all activity for a |
| 531 |
tracker, including all new tickets and their events. |
| 532 |
""" |
| 533 |
type TrackerSubscription implements ActivitySubscription { |
| 534 |
id: Int! |
| 535 |
created: Time! |
| 536 |
tracker: Tracker! @access(scope: TRACKERS, kind: RO) |
| 537 |
} |
| 538 |
|
| 539 |
""" |
| 540 |
A ticket subscription will notify a participant when activity occurs on a |
| 541 |
ticket. |
| 542 |
""" |
| 543 |
type TicketSubscription implements ActivitySubscription { |
| 544 |
id: Int! |
| 545 |
created: Time! |
| 546 |
ticket: Ticket! @access(scope: TICKETS, kind: RO) |
| 547 |
} |
| 548 |
|
| 549 |
""" |
| 550 |
A cursor for enumerating trackers |
| 551 |
|
| 552 |
If there are additional results available, the cursor object may be passed |
| 553 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 554 |
there are no remaining results to return. |
| 555 |
""" |
| 556 |
type TrackerCursor { |
| 557 |
results: [Tracker!]! |
| 558 |
cursor: Cursor |
| 559 |
} |
| 560 |
|
| 561 |
""" |
| 562 |
A cursor for enumerating tickets |
| 563 |
|
| 564 |
If there are additional results available, the cursor object may be passed |
| 565 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 566 |
there are no remaining results to return. |
| 567 |
""" |
| 568 |
type TicketCursor { |
| 569 |
results: [Ticket!]! |
| 570 |
cursor: Cursor |
| 571 |
} |
| 572 |
|
| 573 |
""" |
| 574 |
A cursor for enumerating labels |
| 575 |
|
| 576 |
If there are additional results available, the cursor object may be passed |
| 577 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 578 |
there are no remaining results to return. |
| 579 |
""" |
| 580 |
type LabelCursor { |
| 581 |
results: [Label!]! |
| 582 |
cursor: Cursor |
| 583 |
} |
| 584 |
|
| 585 |
""" |
| 586 |
A cursor for enumerating access control list entries |
| 587 |
|
| 588 |
If there are additional results available, the cursor object may be passed |
| 589 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 590 |
there are no remaining results to return. |
| 591 |
""" |
| 592 |
type ACLCursor { |
| 593 |
results: [TrackerACL!]! |
| 594 |
cursor: Cursor |
| 595 |
} |
| 596 |
|
| 597 |
""" |
| 598 |
A cursor for enumerating events |
| 599 |
|
| 600 |
If there are additional results available, the cursor object may be passed |
| 601 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 602 |
there are no remaining results to return. |
| 603 |
""" |
| 604 |
type EventCursor { |
| 605 |
results: [Event!]! |
| 606 |
cursor: Cursor |
| 607 |
} |
| 608 |
|
| 609 |
""" |
| 610 |
A cursor for enumerating subscriptions |
| 611 |
|
| 612 |
If there are additional results available, the cursor object may be passed |
| 613 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 614 |
there are no remaining results to return. |
| 615 |
""" |
| 616 |
type ActivitySubscriptionCursor { |
| 617 |
results: [ActivitySubscription!]! |
| 618 |
cursor: Cursor |
| 619 |
} |
| 620 |
|
| 621 |
""" |
| 622 |
A cursor for enumerating a list of webhook deliveries |
| 623 |
|
| 624 |
If there are additional results available, the cursor object may be passed |
| 625 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 626 |
there are no remaining results to return. |
| 627 |
""" |
| 628 |
type WebhookDeliveryCursor { |
| 629 |
results: [WebhookDelivery!]! |
| 630 |
cursor: Cursor |
| 631 |
} |
| 632 |
|
| 633 |
""" |
| 634 |
A cursor for enumerating a list of webhook subscriptions |
| 635 |
|
| 636 |
If there are additional results available, the cursor object may be passed |
| 637 |
back into the same endpoint to retrieve another page. If the cursor is null, |
| 638 |
there are no remaining results to return. |
| 639 |
""" |
| 640 |
type WebhookSubscriptionCursor { |
| 641 |
results: [WebhookSubscription!]! |
| 642 |
cursor: Cursor |
| 643 |
} |
| 644 |
|
| 645 |
type Preferences { |
| 646 |
notifySelf: Boolean! |
| 647 |
} |
| 648 |
|
| 649 |
type Query { |
| 650 |
"Returns API version information." |
| 651 |
version: Version! |
| 652 |
|
| 653 |
"Returns the authenticated user." |
| 654 |
me: User! @access(scope: PROFILE, kind: RO) |
| 655 |
|
| 656 |
"Returns a specific user." |
| 657 |
user(username: String!): User @access(scope: PROFILE, kind: RO) |
| 658 |
|
| 659 |
"Looks up a tracker based on its resource ID." |
| 660 |
tracker(rid: ID!): Tracker @access(scope: TRACKERS, kind: RO) |
| 661 |
|
| 662 |
""" |
| 663 |
Returns trackers that the authenticated user has access to. |
| 664 |
|
| 665 |
NOTE: in this version of the API, only trackers owned by the authenticated |
| 666 |
user are returned, but in the future the default behavior will be to return |
| 667 |
all trackers that the user either (1) has been given explicit access to via |
| 668 |
ACLs or (2) has implicit access to either by ownership or group membership. |
| 669 |
""" |
| 670 |
trackers(cursor: Cursor): TrackerCursor @access(scope: TRACKERS, kind: RO) |
| 671 |
|
| 672 |
""" |
| 673 |
List of events which the authenticated user is subscribed to or implicated |
| 674 |
in, ordered by the event date (recent events first). |
| 675 |
""" |
| 676 |
events(cursor: Cursor): EventCursor @access(scope: EVENTS, kind: RO) |
| 677 |
|
| 678 |
"List of subscriptions of the authenticated user." |
| 679 |
subscriptions(cursor: Cursor): ActivitySubscriptionCursor @access(scope: SUBSCRIPTIONS, kind: RO) |
| 680 |
|
| 681 |
""" |
| 682 |
Returns a list of user webhook subscriptions. For clients |
| 683 |
authenticated with a personal access token, this returns all webhooks |
| 684 |
configured by all GraphQL clients for your account. For clients |
| 685 |
authenticated with an OAuth 2.0 access token, this returns only webhooks |
| 686 |
registered for your client. |
| 687 |
""" |
| 688 |
userWebhooks(cursor: Cursor): WebhookSubscriptionCursor! |
| 689 |
|
| 690 |
"Returns details of a user webhook subscription by its ID." |
| 691 |
userWebhook(id: Int!): WebhookSubscription |
| 692 |
|
| 693 |
""" |
| 694 |
Returns information about the webhook currently being processed. This is |
| 695 |
not valid during normal queries over HTTP, and will return an error if used |
| 696 |
outside of a webhook context. |
| 697 |
""" |
| 698 |
webhook: WebhookPayload! |
| 699 |
|
| 700 |
""" |
| 701 |
Returns the preferences associated with this user account. |
| 702 |
""" |
| 703 |
preferences: Preferences! @access(scope: PROFILE, kind: RO) |
| 704 |
} |
| 705 |
|
| 706 |
"You may omit any fields to leave them unchanged." |
| 707 |
input TrackerInput { |
| 708 |
name: String |
| 709 |
description: String |
| 710 |
visibility: Visibility |
| 711 |
} |
| 712 |
|
| 713 |
"You may omit any fields to leave them unchanged." |
| 714 |
input UpdateLabelInput { |
| 715 |
name: String |
| 716 |
foregroundColor: String |
| 717 |
backgroundColor: String |
| 718 |
} |
| 719 |
|
| 720 |
input ACLInput { |
| 721 |
"Permission to view tickets" |
| 722 |
browse: Boolean! |
| 723 |
"Permission to submit tickets" |
| 724 |
submit: Boolean! |
| 725 |
"Permission to comment on tickets" |
| 726 |
comment: Boolean! |
| 727 |
"Permission to edit tickets" |
| 728 |
edit: Boolean! |
| 729 |
"Permission to resolve, re-open, transfer, or label tickets" |
| 730 |
triage: Boolean! |
| 731 |
} |
| 732 |
|
| 733 |
""" |
| 734 |
This is used for importing tickets from third-party services, and may only be |
| 735 |
used by the tracker owner. It causes a ticket submission, update, or comment |
| 736 |
to be attributed to an external user and appear as if it were submitted at a |
| 737 |
specific time. |
| 738 |
""" |
| 739 |
input ImportInput { |
| 740 |
created: Time! |
| 741 |
""" |
| 742 |
External user ID. By convention this should be "service:username", e.g. |
| 743 |
"codeberg:ddevault". |
| 744 |
""" |
| 745 |
externalId: String! |
| 746 |
""" |
| 747 |
A URL at which the user's external profile may be found, e.g. |
| 748 |
"https://codeberg.org/ddevault". |
| 749 |
""" |
| 750 |
externalUrl: String! |
| 751 |
} |
| 752 |
|
| 753 |
input SubmitTicketInput { |
| 754 |
subject: String! |
| 755 |
body: String |
| 756 |
|
| 757 |
# These fields are meant for use when importing tickets from third-party |
| 758 |
# services, and may only be used by the tracker owner. |
| 759 |
# TODO: Use ImportInput here |
| 760 |
created: Time |
| 761 |
externalId: String |
| 762 |
externalUrl: String |
| 763 |
} |
| 764 |
|
| 765 |
# For internal use only. |
| 766 |
input SubmitTicketEmailInput { |
| 767 |
subject: String! |
| 768 |
body: String |
| 769 |
senderId: Int! |
| 770 |
messageId: String! |
| 771 |
} |
| 772 |
|
| 773 |
# For internal use only. |
| 774 |
enum EmailCmd { |
| 775 |
RESOLVE |
| 776 |
REOPEN |
| 777 |
LABEL |
| 778 |
UNLABEL |
| 779 |
} |
| 780 |
|
| 781 |
# For internal use only. |
| 782 |
input SubmitCommentEmailInput { |
| 783 |
text: String! |
| 784 |
senderId: Int! |
| 785 |
cmd: EmailCmd |
| 786 |
resolution: TicketResolution |
| 787 |
labelIds: [Int!] |
| 788 |
messageId: String! |
| 789 |
} |
| 790 |
|
| 791 |
""" |
| 792 |
You may omit any fields to leave them unchanged. To remove the ticket body, |
| 793 |
set it to null. |
| 794 |
""" |
| 795 |
input UpdateTicketInput { |
| 796 |
subject: String |
| 797 |
body: String |
| 798 |
|
| 799 |
"For use by the tracker owner only" |
| 800 |
import: ImportInput |
| 801 |
} |
| 802 |
|
| 803 |
""" |
| 804 |
You may omit the status or resolution fields to leave them unchanged (or if |
| 805 |
you do not have permission to change them). "resolution" is required if |
| 806 |
status is RESOLVED. |
| 807 |
""" |
| 808 |
input SubmitCommentInput { |
| 809 |
text: String! |
| 810 |
status: TicketStatus |
| 811 |
resolution: TicketResolution |
| 812 |
|
| 813 |
"For use by the tracker owner only" |
| 814 |
import: ImportInput |
| 815 |
} |
| 816 |
|
| 817 |
""" |
| 818 |
"resolution" is required if status is RESOLVED. |
| 819 |
""" |
| 820 |
input UpdateStatusInput { |
| 821 |
status: TicketStatus! |
| 822 |
resolution: TicketResolution |
| 823 |
|
| 824 |
"For use by the tracker owner only" |
| 825 |
import: ImportInput |
| 826 |
} |
| 827 |
|
| 828 |
input UserWebhookInput { |
| 829 |
url: String! |
| 830 |
events: [WebhookEvent!]! |
| 831 |
query: String! |
| 832 |
} |
| 833 |
|
| 834 |
input TrackerWebhookInput { |
| 835 |
url: String! |
| 836 |
events: [WebhookEvent!]! |
| 837 |
query: String! |
| 838 |
} |
| 839 |
|
| 840 |
input TicketWebhookInput { |
| 841 |
url: String! |
| 842 |
events: [WebhookEvent!]! |
| 843 |
query: String! |
| 844 |
} |
| 845 |
|
| 846 |
input PreferencesInput { |
| 847 |
notifySelf: Boolean! |
| 848 |
} |
| 849 |
|
| 850 |
type Mutation { |
| 851 |
""" |
| 852 |
Creates a new bug tracker. If specified, the 'import' field specifies a |
| 853 |
gzipped dump of a tracker to populate tickets from; see Tracker.export. |
| 854 |
""" |
| 855 |
createTracker( |
| 856 |
name: String!, |
| 857 |
description: String, |
| 858 |
visibility: Visibility!, |
| 859 |
importUpload: Upload): Tracker! @access(scope: TRACKERS, kind: RW) |
| 860 |
|
| 861 |
"Updates an existing bug tracker" |
| 862 |
updateTracker( |
| 863 |
id: Int!, |
| 864 |
input: TrackerInput!): Tracker! @access(scope: TRACKERS, kind: RW) |
| 865 |
|
| 866 |
"Deletes a bug tracker" |
| 867 |
deleteTracker(id: Int!): Tracker! @access(scope: TRACKERS, kind: RW) |
| 868 |
|
| 869 |
"Adds or updates the ACL for a specific user on a bug tracker" |
| 870 |
updateUserACL( |
| 871 |
trackerId: Int!, |
| 872 |
userId: Int!, |
| 873 |
input: ACLInput!): TrackerACL! @access(scope: ACLS, kind: RW) |
| 874 |
|
| 875 |
# "Adds or updates the ACL for an email address on a bug tracker" |
| 876 |
# TODO: This requires internal changes |
| 877 |
#updateSenderACL( |
| 878 |
# trackerId: Int!, |
| 879 |
# address: String!, |
| 880 |
# input: ACLInput!): TrackerACL! @access(scope: ACLS, kind: RW) |
| 881 |
|
| 882 |
""" |
| 883 |
Updates the default ACL for a bug tracker, which applies to users and |
| 884 |
senders for whom a more specific ACL does not exist. |
| 885 |
""" |
| 886 |
updateTrackerACL( |
| 887 |
trackerId: Int!, |
| 888 |
input: ACLInput!): DefaultACL! @access(scope: ACLS, kind: RW) |
| 889 |
|
| 890 |
""" |
| 891 |
Removes a tracker ACL. Following this change, the default tracker ACL will |
| 892 |
apply to this user. |
| 893 |
""" |
| 894 |
deleteACL(id: Int!): TrackerACL! @access(scope: ACLS, kind: RW) |
| 895 |
|
| 896 |
"Subscribes to all email notifications for a tracker" |
| 897 |
trackerSubscribe( |
| 898 |
trackerId: Int!): TrackerSubscription! @access(scope: SUBSCRIPTIONS, kind: RW) |
| 899 |
|
| 900 |
""" |
| 901 |
Unsubscribes from email notifications for a tracker. If "tickets" is true, |
| 902 |
also unsubscribe from all tickets on this tracker. |
| 903 |
""" |
| 904 |
trackerUnsubscribe( |
| 905 |
trackerId: Int!, |
| 906 |
tickets: Boolean!): TrackerSubscription! @access(scope: SUBSCRIPTIONS, kind: RW) |
| 907 |
|
| 908 |
"Subscribes to all email notifications for a ticket" |
| 909 |
ticketSubscribe( |
| 910 |
trackerId: Int!, |
| 911 |
ticketId: Int!): TicketSubscription! @access(scope: SUBSCRIPTIONS, kind: RW) |
| 912 |
|
| 913 |
"Unsubscribes from email notifications for a ticket" |
| 914 |
ticketUnsubscribe( |
| 915 |
trackerId: Int!, |
| 916 |
ticketId: Int!): TicketSubscription! @access(scope: SUBSCRIPTIONS, kind: RW) |
| 917 |
|
| 918 |
""" |
| 919 |
Creates a new ticket label for a tracker. The colors must be in CSS |
| 920 |
hexadecimal RGB format "#RRGGBB", i.e. "#000000" for black and "#FF0000" for |
| 921 |
red. |
| 922 |
""" |
| 923 |
createLabel(trackerId: Int!, name: String!, |
| 924 |
foregroundColor: String!, backgroundColor: String!): Label! @access(scope: TRACKERS, kind: RW) |
| 925 |
|
| 926 |
"Changes the name or colors for a label." |
| 927 |
updateLabel(id: Int!, input: UpdateLabelInput!): Label! @access(scope: TRACKERS, kind: RW) |
| 928 |
|
| 929 |
""" |
| 930 |
Deletes a label, removing it from any tickets which currently have it |
| 931 |
applied. |
| 932 |
""" |
| 933 |
deleteLabel(id: Int!): Label! @access(scope: TRACKERS, kind: RW) |
| 934 |
|
| 935 |
"Creates a new ticket." |
| 936 |
submitTicket(trackerId: Int!, |
| 937 |
input: SubmitTicketInput!): Ticket! @access(scope: TICKETS, kind: RW) |
| 938 |
|
| 939 |
"Deletes a ticket." |
| 940 |
deleteTicket(trackerId: Int!, ticketId: Int!): Ticket! @access(scope: TICKETS, kind: RW) |
| 941 |
|
| 942 |
# Creates a new ticket from an incoming email. (For internal use only) |
| 943 |
submitTicketEmail(trackerId: Int!, |
| 944 |
input: SubmitTicketEmailInput!): Ticket! @internal |
| 945 |
|
| 946 |
# Creates a new comment from an incoming email. (For internal use only) |
| 947 |
submitCommentEmail(trackerId: Int!, ticketId: Int!, |
| 948 |
input: SubmitCommentEmailInput!): Event! @internal |
| 949 |
|
| 950 |
"Updates a ticket's subject or body" |
| 951 |
updateTicket(trackerId: Int!, ticketId: Int!, |
| 952 |
input: UpdateTicketInput!): Ticket! @access(scope: TICKETS, kind: RW) |
| 953 |
|
| 954 |
"Updates the status or resolution of a ticket" |
| 955 |
updateTicketStatus(trackerId: Int!, ticketId: Int!, |
| 956 |
input: UpdateStatusInput!): Event! @access(scope: TICKETS, kind: RW) |
| 957 |
|
| 958 |
"Submits a comment for a ticket" |
| 959 |
submitComment(trackerId: Int!, ticketId: Int!, |
| 960 |
input: SubmitCommentInput!): Event! @access(scope: TICKETS, kind: RW) |
| 961 |
|
| 962 |
"Adds a user to the list of assigned users for a ticket" |
| 963 |
assignUser(trackerId: Int!, ticketId: Int!, |
| 964 |
userId: Int!): Event! @access(scope: TICKETS, kind: RW) |
| 965 |
|
| 966 |
"Removes a user from the list of assigned users for a ticket" |
| 967 |
unassignUser(trackerId: Int!, ticketId: Int!, |
| 968 |
userId: Int!): Event! @access(scope: TICKETS, kind: RW) |
| 969 |
|
| 970 |
"Adds a label to the list of labels for a ticket" |
| 971 |
labelTicket(trackerId: Int!, ticketId: Int!, |
| 972 |
labelId: Int!): Event! @access(scope: TICKETS, kind: RW) |
| 973 |
|
| 974 |
"Removes a list from the list of labels for a ticket" |
| 975 |
unlabelTicket(trackerId: Int!, ticketId: Int!, |
| 976 |
labelId: Int!): Event! @access(scope: TICKETS, kind: RW) |
| 977 |
|
| 978 |
"Imports a gzipped JSON dump of tracker data" |
| 979 |
importTrackerDump(trackerId: Int!, dump: Upload!): Boolean! @access(scope: TRACKERS, kind: RW) |
| 980 |
|
| 981 |
""" |
| 982 |
Creates a new user webhook subscription. When an event from the |
| 983 |
provided list of events occurs, the 'query' parameter (a GraphQL query) |
| 984 |
will be evaluated and the results will be sent to the provided URL as the |
| 985 |
body of an HTTP POST request. The list of events must include at least one |
| 986 |
event, and no duplicates. |
| 987 |
|
| 988 |
This query is evaluated in the webhook context, such that query { webhook } |
| 989 |
may be used to access details of the event which trigged the webhook. The |
| 990 |
query may not make any mutations. |
| 991 |
""" |
| 992 |
createUserWebhook(config: UserWebhookInput!): WebhookSubscription! |
| 993 |
|
| 994 |
""" |
| 995 |
Deletes a user webhook. Any events already queued may still be |
| 996 |
delivered after this request completes. Clients authenticated with a |
| 997 |
personal access token may delete any webhook registered for their account, |
| 998 |
but authorized OAuth 2.0 clients may only delete their own webhooks. |
| 999 |
Manually deleting a webhook configured by a third-party client may cause |
| 1000 |
unexpected behavior with the third-party integration. |
| 1001 |
""" |
| 1002 |
deleteUserWebhook(id: Int!): WebhookSubscription! |
| 1003 |
|
| 1004 |
"Creates a new tracker webhook." |
| 1005 |
createTrackerWebhook(trackerId: Int!, config: TrackerWebhookInput!): WebhookSubscription! |
| 1006 |
|
| 1007 |
"Deletes a tracker webhook." |
| 1008 |
deleteTrackerWebhook(id: Int!): WebhookSubscription! |
| 1009 |
|
| 1010 |
"Creates a new ticket webhook." |
| 1011 |
createTicketWebhook(trackerId: Int!, ticketId: Int!, config: TicketWebhookInput!): WebhookSubscription! |
| 1012 |
|
| 1013 |
"Deletes a ticket webhook." |
| 1014 |
deleteTicketWebhook(id: Int!): WebhookSubscription! |
| 1015 |
|
| 1016 |
""" |
| 1017 |
Deletes the authenticated user's account. Internal use only. |
| 1018 |
""" |
| 1019 |
deleteUser: Int! @internal |
| 1020 |
|
| 1021 |
""" |
| 1022 |
Updates the user's preferences. |
| 1023 |
""" |
| 1024 |
updatePreferences(preferences: PreferencesInput!): Preferences! @access(scope: PROFILE, kind: RW) |
| 1025 |
} |