@nicodoggie/node-kiwi-tcms-api
Version:
Vibe-coded Node.js wrapper for Kiwi TCMS XML-RPC API. Use at your own risk.
150 lines • 4.57 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KiwiTCMS = void 0;
const client_1 = require("./client");
// Import all API modules
const auth_1 = require("./modules/auth");
const testcase_1 = require("./modules/testcase");
const testplan_1 = require("./modules/testplan");
const testrun_1 = require("./modules/testrun");
const testexecution_1 = require("./modules/testexecution");
const management_1 = require("./modules/management");
const utilities_1 = require("./modules/utilities");
/**
* Main Kiwi TCMS API client
*
* This is the primary interface for interacting with Kiwi TCMS.
* It provides access to all API modules through a single client instance.
*
* @example
* ```typescript
* import { KiwiTCMS } from 'node-kiwi-tcms';
*
* const kiwi = new KiwiTCMS({
* baseUrl: 'https://your-kiwi-instance.com',
* username: 'your-username',
* password: 'your-password'
* });
*
* // Get all test cases
* const testCases = await kiwi.testCase.filter();
*
* // Create a new test plan
* const testPlan = await kiwi.testPlan.create({
* name: 'My Test Plan',
* product_version_id: 1,
* author_id: 1,
* type_id: 1
* });
* ```
*/
class KiwiTCMS {
client;
// Core test management modules
auth;
testCase;
testPlan;
testRun;
testExecution;
// Management modules
product;
build;
component;
classification;
category;
version;
planType;
priority;
testCaseStatus;
testExecutionStatus;
environment;
tag;
user;
bug;
// Utility modules
attachment;
markdown;
utils;
url;
constructor(config) {
this.client = new client_1.KiwiClient(config);
// Initialize core test management modules
this.auth = new auth_1.AuthAPI(this.client);
this.testCase = new testcase_1.TestCaseAPI(this.client);
this.testPlan = new testplan_1.TestPlanAPI(this.client);
this.testRun = new testrun_1.TestRunAPI(this.client);
this.testExecution = new testexecution_1.TestExecutionAPI(this.client);
// Initialize management modules
this.product = new management_1.ProductAPI(this.client);
this.build = new management_1.BuildAPI(this.client);
this.component = new management_1.ComponentAPI(this.client);
this.classification = new management_1.ClassificationAPI(this.client);
this.category = new management_1.CategoryAPI(this.client);
this.version = new management_1.VersionAPI(this.client);
this.planType = new management_1.PlanTypeAPI(this.client);
this.priority = new management_1.PriorityAPI(this.client);
this.testCaseStatus = new management_1.TestCaseStatusAPI(this.client);
this.testExecutionStatus = new management_1.TestExecutionStatusAPI(this.client);
this.environment = new management_1.EnvironmentAPI(this.client);
this.tag = new management_1.TagAPI(this.client);
this.user = new management_1.UserAPI(this.client);
this.bug = new management_1.BugAPI(this.client);
// Initialize utility modules
this.attachment = new utilities_1.AttachmentAPI(this.client);
this.markdown = new utilities_1.MarkdownAPI(this.client);
this.utils = new utilities_1.KiwiUtilsAPI(this.client);
this.url = new utilities_1.UrlAPI(this.client);
}
/**
* Authenticate with the Kiwi TCMS server
*
* @returns Session ID
*/
async login() {
return await this.client.login();
}
/**
* Logout from the Kiwi TCMS server
*/
async logout() {
await this.client.logout();
}
/**
* Check if client is authenticated
*/
isAuthenticated() {
return this.client.isAuthenticated();
}
/**
* Get current session ID
*/
getSessionId() {
return this.client.getSessionId();
}
/**
* Set session ID manually (useful for token-based authentication)
*/
setSessionId(sessionId) {
this.client.setSessionId(sessionId);
}
/**
* Get Kiwi TCMS server version
*/
async getVersion() {
return await this.client.getVersion();
}
/**
* List available XML-RPC methods (useful for debugging)
*/
async listMethods() {
return await this.client.listMethods();
}
/**
* Get the underlying XML-RPC client for advanced usage
*/
getClient() {
return this.client;
}
}
exports.KiwiTCMS = KiwiTCMS;
//# sourceMappingURL=kiwi-tcms.js.map