@graphikartistry/cursor-doc-automation
Version:
Cursor IDE extension for autonomous documentation and ticket management
51 lines • 1.71 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JiraClient = void 0;
const axios_1 = __importDefault(require("axios"));
const dotenv_1 = __importDefault(require("dotenv"));
dotenv_1.default.config();
class JiraClient {
constructor(token) {
this.client = axios_1.default.create({
baseURL: process.env.JIRA_URL || '',
auth: {
username: process.env.JIRA_USERNAME || '',
password: token,
},
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
});
}
async createTicket(summary, description, projectKey) {
const response = await this.client.post('/rest/api/3/issue', {
fields: {
project: { key: projectKey },
summary,
description: {
type: "doc",
version: 1,
content: [
{
type: "paragraph",
content: [
{
type: "text",
text: description
}
]
}
]
},
issuetype: { name: 'Task' },
},
});
return response.data;
}
}
exports.JiraClient = JiraClient;
//# sourceMappingURL=jiraClient.js.map