From 910a6a435e4226474fab557120e8c70b06281aef Mon Sep 17 00:00:00 2001 From: Marley Powell Date: Tue, 9 Nov 2021 08:04:51 +0000 Subject: [PATCH] feat: Added new types to `@backstage/plugin-azure-devops-common`. Signed-off-by: Marley Powell --- .changeset/many-mayflies-notice.md | 5 ++- plugins/azure-devops-common/api-report.md | 43 +++++++++++++++++++++ plugins/azure-devops-common/src/types.ts | 46 +++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/.changeset/many-mayflies-notice.md b/.changeset/many-mayflies-notice.md index cd4f91fa93..a96d1fcce5 100644 --- a/.changeset/many-mayflies-notice.md +++ b/.changeset/many-mayflies-notice.md @@ -1,6 +1,9 @@ --- '@backstage/plugin-azure-devops': patch '@backstage/plugin-azure-devops-backend': minor +'@backstage/plugin-azure-devops-common': patch --- -refactor(`@backstage/plugin-azure-devops`): Consume types from `@backstage/plugin-azure-devops-common`. Stop re-exporting types from `@backstage/plugin-azure-devops-backend`. +refactor(`@backstage/plugin-azure-devops`): Consume types from `@backstage/plugin-azure-devops-common`. +Stop re-exporting types from `@backstage/plugin-azure-devops-backend`. +Added new types to `@backstage/plugin-azure-devops-common`. diff --git a/plugins/azure-devops-common/api-report.md b/plugins/azure-devops-common/api-report.md index 0bc6568189..f03c0b4059 100644 --- a/plugins/azure-devops-common/api-report.md +++ b/plugins/azure-devops-common/api-report.md @@ -27,6 +27,42 @@ export enum BuildStatus { Postponed = 8, } +// Warning: (ae-missing-release-tag) "PullRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PullRequest = { + pullRequestId?: number; + repoName?: string; + title?: string; + uniqueName?: string; + createdBy?: string; + creationDate?: Date; + sourceRefName?: string; + targetRefName?: string; + status?: PullRequestStatus; + isDraft?: boolean; + link: string; +}; + +// Warning: (ae-missing-release-tag) "PullRequestOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type PullRequestOptions = { + top: number; + status: PullRequestStatus; +}; + +// Warning: (ae-missing-release-tag) "PullRequestStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export enum PullRequestStatus { + Abandoned = 2, + Active = 1, + All = 4, + Completed = 3, + NotSet = 0, +} + // Warning: (ae-missing-release-tag) "RepoBuild" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -43,5 +79,12 @@ export type RepoBuild = { uniqueName?: string; }; +// Warning: (ae-missing-release-tag) "RepoBuildOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type RepoBuildOptions = { + top?: number; +}; + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/azure-devops-common/src/types.ts b/plugins/azure-devops-common/src/types.ts index d7736d03e1..eacc2af30d 100644 --- a/plugins/azure-devops-common/src/types.ts +++ b/plugins/azure-devops-common/src/types.ts @@ -80,3 +80,49 @@ export type RepoBuild = { source: string; uniqueName?: string; }; + +export type RepoBuildOptions = { + top?: number; +}; + +export enum PullRequestStatus { + /** + * Status not set. Default state. + */ + NotSet = 0, + /** + * Pull request is active. + */ + Active = 1, + /** + * Pull request is abandoned. + */ + Abandoned = 2, + /** + * Pull request is completed. + */ + Completed = 3, + /** + * Used in pull request search criteria to include all statuses. + */ + All = 4, +} + +export type PullRequest = { + pullRequestId?: number; + repoName?: string; + title?: string; + uniqueName?: string; + createdBy?: string; + creationDate?: Date; + sourceRefName?: string; + targetRefName?: string; + status?: PullRequestStatus; + isDraft?: boolean; + link: string; +}; + +export type PullRequestOptions = { + top: number; + status: PullRequestStatus; +};