Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/core/src/resources/MergeRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
import type { CommitDiffSchema, CommitSchema } from './Commits';
import type { IssueSchema, TimeStatsSchema } from './Issues';
import type { ExpandedPipelineSchema, PipelineSchema } from './Pipelines';
import type { ReviewerState } from './Webhooks';
import type { SimpleProjectSchema } from './Projects';
import type { TodoSchema } from './TodoLists';
import type { SimpleUserSchema } from './Users';
Expand Down Expand Up @@ -191,7 +192,7 @@ export interface MergeRequestChangesSchema

export interface MergeRequestReviewerSchema extends Record<string, unknown> {
user: MappedOmit<SimpleUserSchema, 'created_at'>;
state: 'unreviewed' | 'requested_changes' | 'reviewed' | 'approved' | 'review_started';
state: ReviewerState;
created_at: string;
}

Expand Down
17 changes: 13 additions & 4 deletions packages/core/src/resources/Webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ export interface WebhookDiffSchema {
deleted_file: boolean;
}

export type WebhookUserSchema = Pick<SimpleUserSchema, 'id' | 'name' | 'username' | 'avatar_url'>;
export type ReviewerState = 'unreviewed' | 'requested_changes' | 'reviewed' | 'approved' | 'review_started' | 'unapproved';

export type WebhookUserSchema = Pick<SimpleUserSchema, 'id' | 'name' | 'username' | 'avatar_url'> & {
email: string;
};

export interface WebhookReviewerSchema extends WebhookUserSchema {
state: ReviewerState;
re_requested: boolean;
}

export interface BaseWebhookEventSchema {
object_kind: string;
Expand Down Expand Up @@ -376,8 +385,8 @@ export interface WebhookMergeRequestEventSchema extends BaseWebhookEventSchema {
current: WebhookUserSchema[] | null;
};
reviewers: {
previous: WebhookUserSchema[] | null;
current: WebhookUserSchema[] | null;
previous: WebhookReviewerSchema[] | null;
current: WebhookReviewerSchema[] | null;
};
labels: {
previous: WebhookLabelSchema[] | null;
Expand All @@ -393,7 +402,7 @@ export interface WebhookMergeRequestEventSchema extends BaseWebhookEventSchema {
};
};
assignees: WebhookUserSchema[] | null;
reviewers: WebhookUserSchema[] | null;
reviewers: WebhookReviewerSchema[] | null;
}

export interface WebhookWikiEventSchema extends MappedOmit<BaseWebhookEventSchema, 'event_name'> {
Expand Down