projax 3.3.25 → 3.3.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,20 @@ export interface ProjectPort {
36
36
  last_detected: number;
37
37
  created_at: number;
38
38
  }
39
+ export interface TestResult {
40
+ id: number;
41
+ project_id: number;
42
+ script_name: string;
43
+ framework: string | null;
44
+ passed: number;
45
+ failed: number;
46
+ skipped: number;
47
+ total: number;
48
+ duration: number | null;
49
+ coverage: number | null;
50
+ timestamp: number;
51
+ raw_output: string | null;
52
+ }
39
53
  type ScanResponse = {
40
54
  project: Project;
41
55
  testsFound: number;
@@ -73,6 +87,9 @@ declare class DatabaseManager {
73
87
  getSetting(key: string): string | null;
74
88
  setSetting(key: string, value: string): void;
75
89
  getAllSettings(): Record<string, string>;
90
+ addTestResult(projectId: number, scriptName: string, passed: number, failed: number, skipped?: number, total?: number, duration?: number | null, coverage?: number | null, framework?: string | null, rawOutput?: string | null): TestResult;
91
+ getLatestTestResult(projectId: number): TestResult | null;
92
+ getTestResultsByProject(projectId: number, limit?: number): TestResult[];
76
93
  close(): void;
77
94
  }
78
95
  export declare function getDatabaseManager(): DatabaseManager;
@@ -40,7 +40,7 @@ const fs = __importStar(require("fs"));
40
40
  const child_process_1 = require("child_process");
41
41
  class DatabaseManager {
42
42
  apiBaseUrl;
43
- defaultPort = 3001;
43
+ defaultPort = 38124;
44
44
  constructor() {
45
45
  // Read API port from file, or use default
46
46
  const dataDir = path.join(os.homedir(), '.projax');
@@ -232,6 +232,34 @@ class DatabaseManager {
232
232
  getAllSettings() {
233
233
  return this.request('/settings');
234
234
  }
235
+ // Test Result operations
236
+ addTestResult(projectId, scriptName, passed, failed, skipped = 0, total = passed + failed + skipped, duration = null, coverage = null, framework = null, rawOutput = null) {
237
+ return this.request(`/projects/${projectId}/test-results`, {
238
+ method: 'POST',
239
+ body: JSON.stringify({
240
+ scriptName,
241
+ passed,
242
+ failed,
243
+ skipped,
244
+ total,
245
+ duration,
246
+ coverage,
247
+ framework,
248
+ rawOutput,
249
+ }),
250
+ });
251
+ }
252
+ getLatestTestResult(projectId) {
253
+ try {
254
+ return this.request(`/projects/${projectId}/test-results/latest`);
255
+ }
256
+ catch (error) {
257
+ return null;
258
+ }
259
+ }
260
+ getTestResultsByProject(projectId, limit = 10) {
261
+ return this.request(`/projects/${projectId}/test-results?limit=${limit}`);
262
+ }
235
263
  close() {
236
264
  // No-op for API client
237
265
  }