UNPKG

@graphikartistry/cursor-doc-automation

Version:

Cursor IDE extension for autonomous documentation and ticket management

35 lines 1.19 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitHubClient = void 0; const axios_1 = __importDefault(require("axios")); class GitHubClient { constructor(token) { this.baseUrl = 'https://api.github.com'; this.token = token; } async createPullRequest(options) { try { const response = await axios_1.default.post(`${this.baseUrl}/repos/${process.env.GITHUB_REPOSITORY}/pulls`, { title: options.title, body: options.body, head: options.branch, base: 'main' }, { headers: { Authorization: `token ${this.token}`, Accept: 'application/vnd.github.v3+json' } }); return response.data.html_url; } catch (error) { console.error('Error creating PR:', error); throw error; } } } exports.GitHubClient = GitHubClient; //# sourceMappingURL=githubClient.js.map