From a89ada59cf0573bfef4cb6e74c7e840df9e4a417 Mon Sep 17 00:00:00 2001 From: Marley Powell Date: Wed, 1 Dec 2021 08:28:53 +0000 Subject: [PATCH] refactor: Converted `PolicyTypeId` from `const` to `enum`. Signed-off-by: Marley Powell --- plugins/azure-devops-common/api-report.md | 16 ++++++++-------- plugins/azure-devops-common/src/types.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/azure-devops-common/api-report.md b/plugins/azure-devops-common/api-report.md index 61361495b3..17cccb05cb 100644 --- a/plugins/azure-devops-common/api-report.md +++ b/plugins/azure-devops-common/api-report.md @@ -120,14 +120,14 @@ export enum PolicyType { // Warning: (ae-missing-release-tag) "PolicyTypeId" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const PolicyTypeId: { - Build: string; - Status: string; - MinimumReviewers: string; - Comments: string; - RequiredReviewers: string; - MergeStrategy: string; -}; +export enum PolicyTypeId { + Build = '0609b952-1397-4640-95ec-e00a01b2c241', + Comments = 'c6a1889d-b943-4856-b76f-9e46bb6b0df2', + MergeStrategy = 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab', + MinimumReviewers = 'fa4e907d-c16b-4a4c-9dfa-4906e5d171dd', + RequiredReviewers = 'fd2167ab-b0be-447a-8ec8-39368250530e', + Status = 'cbdc66da-9728-4af8-aada-9a5a32e4a226', +} // Warning: (ae-missing-release-tag) "PullRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/azure-devops-common/src/types.ts b/plugins/azure-devops-common/src/types.ts index 844001771f..da41e08d1f 100644 --- a/plugins/azure-devops-common/src/types.ts +++ b/plugins/azure-devops-common/src/types.ts @@ -217,32 +217,32 @@ export enum PolicyType { MergeStrategy = 'MergeStrategy', } -export const PolicyTypeId = { +export enum PolicyTypeId { /** * This policy will require a successful build has been performed before updating protected refs. */ - Build: '0609b952-1397-4640-95ec-e00a01b2c241', + Build = '0609b952-1397-4640-95ec-e00a01b2c241', /** * This policy will require a successful status to be posted before updating protected refs. */ - Status: 'cbdc66da-9728-4af8-aada-9a5a32e4a226', + Status = 'cbdc66da-9728-4af8-aada-9a5a32e4a226', /** * This policy will ensure that a minimum number of reviewers have approved a pull request before completion. */ - MinimumReviewers: 'fa4e907d-c16b-4a4c-9dfa-4906e5d171dd', + MinimumReviewers = 'fa4e907d-c16b-4a4c-9dfa-4906e5d171dd', /** * Check if the pull request has any active comments. */ - Comments: 'c6a1889d-b943-4856-b76f-9e46bb6b0df2', + Comments = 'c6a1889d-b943-4856-b76f-9e46bb6b0df2', /** * This policy will ensure that required reviewers are added for modified files matching specified patterns. */ - RequiredReviewers: 'fd2167ab-b0be-447a-8ec8-39368250530e', + RequiredReviewers = 'fd2167ab-b0be-447a-8ec8-39368250530e', /** * This policy ensures that pull requests use a consistent merge strategy. */ - MergeStrategy: 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab', -}; + MergeStrategy = 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab', +} export enum PullRequestVoteStatus { Approved = 10,