| 1 | import { Field, InputType } from '@nestjs/graphql'; |
| 2 | import { Allow } |
| 3 | |
| 4 | import { |
| 5 | IssueOrderField, |
| 6 | IssueState, |
| 7 | LabelOrderField, |
| 8 | OrderDirection, |
| 9 | ReleaseOrderField, |
| 10 | } from './enums.js'; |
| 11 | |
| 12 | // GraphQL already checks every input's types and nullability; @Allow only keeps fields through the global ValidationPipe's whitelist. |
| 13 | @InputType('IssueOrder') |
| 14 | export class IssueOrder |
| 15 | @Allow() |
| 16 | @Field(() => |
| 17 | field: IssueOrderField |
| 18 | |
| 19 | @Allow() |
| 20 | @Field(() => |
| 21 | direction: OrderDirection |
| 22 | } |
| 23 | |
| 24 | @InputType('IssueFilters') |
| 25 | export class IssueFilters |
| 26 | @Allow() |
| 27 | @Field(() => |
| 28 | assignee?: string |
| 29 | |
| 30 | @Allow() |
| 31 | @Field(() => |
| 32 | createdBy?: string |
| 33 | |
| 34 | // ponytail: mentioned is accepted and ignored; filter on issue_reference mentions when Ghost records them. |
| 35 | @Allow() |
| 36 | @Field(() => |
| 37 | mentioned?: string |
| 38 | |
| 39 | @Allow() |
| 40 | @Field(() => |
| 41 | labels?: string |
| 42 | |
| 43 | @Allow() |
| 44 | @Field(() => |
| 45 | states?: IssueState |
| 46 | } |
| 47 | |
| 48 | @InputType('LabelOrder') |
| 49 | export class LabelOrder |
| 50 | @Allow() |
| 51 | @Field(() => |
| 52 | field: LabelOrderField |
| 53 | |
| 54 | @Allow() |
| 55 | @Field(() => |
| 56 | direction: OrderDirection |
| 57 | } |
| 58 | |
| 59 | @InputType('ReleaseOrder') |
| 60 | export class ReleaseOrder |
| 61 | @Allow() |
| 62 | @Field(() => |
| 63 | field: ReleaseOrderField |
| 64 | |
| 65 | @Allow() |
| 66 | @Field(() => |
| 67 | direction: OrderDirection |
| 68 | } |