@mate_tsaava/azure-devops-core
v1.0.1
Published
Azure DevOps API client library for PR operations
Maintainers
Readme
@mate_tsaava/azure-devops-core
Azure DevOps API client library for pull request operations.
Installation
npm install @mate_tsaava/azure-devops-coreUsage
import {
AzureDevOpsClient,
PullRequestFetcher,
CommentPoster,
createPatAuthenticator,
} from "@mate_tsaava/azure-devops-core";
// Create client
const client = new AzureDevOpsClient({
organization: "your-org",
getToken: createPatAuthenticator(), // Uses AZURE_DEVOPS_PAT env var
});
// Fetch PR diff
const fetcher = new PullRequestFetcher(client, "your-project");
const prDiff = await fetcher.fetchFullDiff("repo-name", 123);
// Post comments
const poster = new CommentPoster(client, "your-project");
await poster.postInlineComment("repo-name", 123, {
filePath: "/src/file.ts",
line: 42,
content: "Consider refactoring this",
});Environment Variables
AZURE_DEVOPS_PAT- Personal Access Token with Code (Read & Write) permissions
License
MIT
