From 6f1d31c1144b78f8f66c35ca61ad20ad91053b5c Mon Sep 17 00:00:00 2001 From: Justin Dalrymple Date: Mon, 22 Jan 2024 18:41:58 -0500 Subject: [PATCH] Updating code quaility --- .autorc.yml | 5 ++ packages/core/src/resources/Webhooks.ts | 65 ++++++++++--------------- 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/.autorc.yml b/.autorc.yml index ea3a083a2..ec0bb49c7 100644 --- a/.autorc.yml +++ b/.autorc.yml @@ -54,6 +54,11 @@ labels: description: Changes upgrade or remove dependencies releaseType: patch + - name: type:types + changelogTitle: 🗃️ Typescript Definitions + description: Changes only affect typescript definitions + releaseType: patch + - name: type:testing changelogTitle: 🚨 Tests description: Changes affect test code diff --git a/packages/core/src/resources/Webhooks.ts b/packages/core/src/resources/Webhooks.ts index 0456c34c3..ffd0d1a2e 100644 --- a/packages/core/src/resources/Webhooks.ts +++ b/packages/core/src/resources/Webhooks.ts @@ -42,6 +42,27 @@ export interface WebhookProjectSchema { http_url: string; } +export interface WebhookPipelineSchema { + project: { + id: number; + web_url: string; + path_with_namespace: string; + }; + pipeline_id: number; + job_id: number; +} + +export interface WebhookDiffSchema { + diff: string; + new_path: string; + old_path: string; + a_mode: string; + b_mode: string; + new_file: boolean; + renamed_file: boolean; + deleted_file: boolean; +} + export interface BaseWebhookEventSchema { object_kind: string; event_name: string; @@ -72,16 +93,7 @@ export interface WebhookBaseNoteEventSchema extends BaseWebhookEventSchema { commit_id: string; noteable_id: string | null; system: boolean; - st_diff: { - diff: string; - new_path: string; - old_path: string; - a_mode: string; - b_mode: string; - new_file: boolean; - renamed_file: boolean; - deleted_file: boolean; - }; + st_diff: WebhookDiffSchema | null; url: string; }; } @@ -171,7 +183,7 @@ export interface WebhookIssueEventSchema extends BaseWebhookEventSchema { id: number; name: string; }; - labels: WebhookEventLabelSchema[] | null; + labels: WebhookLabelSchema[] | null; }; repository: { name: string; @@ -438,15 +450,7 @@ export interface WebhookPipelineEventSchema email: string; }; }; - source_pipeline: { - project: { - id: number; - web_url: string; - path_with_namespace: string; - }; - pipeline_id: number; - job_id: number; - }; + source_pipeline: WebhookPipelineSchema; builds: | { id: number; @@ -531,15 +535,7 @@ export interface WebhookJobEventSchema extends MappedOmit