@vizzly-testing/cli 0.15.1 → 0.16.1

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.
Files changed (135) hide show
  1. package/dist/client/index.js +21 -4
  2. package/dist/reporter/reporter-bundle.css +1 -1
  3. package/dist/reporter/reporter-bundle.iife.js +11 -11
  4. package/dist/sdk/index.js +6 -6
  5. package/dist/services/api-service.js +42 -0
  6. package/dist/services/tdd-service.js +189 -6
  7. package/dist/services/test-runner.js +0 -8
  8. package/dist/services/uploader.js +1 -1
  9. package/dist/types/client.d.ts +88 -0
  10. package/dist/types/config.d.ts +29 -0
  11. package/dist/types/index.d.ts +426 -9
  12. package/dist/types/sdk.d.ts +146 -0
  13. package/dist/utils/config-helpers.js +2 -2
  14. package/docs/tdd-mode.md +34 -0
  15. package/package.json +21 -4
  16. package/dist/types/cli.d.ts +0 -2
  17. package/dist/types/client/index.d.ts +0 -80
  18. package/dist/types/commands/doctor.d.ts +0 -11
  19. package/dist/types/commands/finalize.d.ts +0 -13
  20. package/dist/types/commands/init.d.ts +0 -32
  21. package/dist/types/commands/login.d.ts +0 -11
  22. package/dist/types/commands/logout.d.ts +0 -11
  23. package/dist/types/commands/project.d.ts +0 -28
  24. package/dist/types/commands/run.d.ts +0 -16
  25. package/dist/types/commands/status.d.ts +0 -13
  26. package/dist/types/commands/tdd-daemon.d.ts +0 -24
  27. package/dist/types/commands/tdd.d.ts +0 -17
  28. package/dist/types/commands/upload.d.ts +0 -13
  29. package/dist/types/commands/whoami.d.ts +0 -11
  30. package/dist/types/errors/vizzly-error.d.ts +0 -75
  31. package/dist/types/plugin-loader.d.ts +0 -7
  32. package/dist/types/reporter/src/api/client.d.ts +0 -178
  33. package/dist/types/reporter/src/components/app-router.d.ts +0 -1
  34. package/dist/types/reporter/src/components/code-block.d.ts +0 -4
  35. package/dist/types/reporter/src/components/comparison/comparison-actions.d.ts +0 -5
  36. package/dist/types/reporter/src/components/comparison/comparison-card.d.ts +0 -7
  37. package/dist/types/reporter/src/components/comparison/comparison-group.d.ts +0 -10
  38. package/dist/types/reporter/src/components/comparison/comparison-list.d.ts +0 -6
  39. package/dist/types/reporter/src/components/comparison/comparison-modes/onion-skin-mode.d.ts +0 -10
  40. package/dist/types/reporter/src/components/comparison/comparison-modes/overlay-mode.d.ts +0 -11
  41. package/dist/types/reporter/src/components/comparison/comparison-modes/shared/base-comparison-mode.d.ts +0 -14
  42. package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts +0 -30
  43. package/dist/types/reporter/src/components/comparison/comparison-modes/toggle-view.d.ts +0 -8
  44. package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +0 -8
  45. package/dist/types/reporter/src/components/comparison/fullscreen-viewer.d.ts +0 -13
  46. package/dist/types/reporter/src/components/comparison/screenshot-display.d.ts +0 -16
  47. package/dist/types/reporter/src/components/comparison/screenshot-list.d.ts +0 -9
  48. package/dist/types/reporter/src/components/comparison/variant-selector.d.ts +0 -9
  49. package/dist/types/reporter/src/components/comparison/view-mode-selector.d.ts +0 -4
  50. package/dist/types/reporter/src/components/dashboard/dashboard-filters.d.ts +0 -16
  51. package/dist/types/reporter/src/components/design-system/alert.d.ts +0 -9
  52. package/dist/types/reporter/src/components/design-system/badge.d.ts +0 -17
  53. package/dist/types/reporter/src/components/design-system/button.d.ts +0 -19
  54. package/dist/types/reporter/src/components/design-system/card.d.ts +0 -31
  55. package/dist/types/reporter/src/components/design-system/empty-state.d.ts +0 -13
  56. package/dist/types/reporter/src/components/design-system/form-controls.d.ts +0 -44
  57. package/dist/types/reporter/src/components/design-system/health-ring.d.ts +0 -7
  58. package/dist/types/reporter/src/components/design-system/index.d.ts +0 -11
  59. package/dist/types/reporter/src/components/design-system/modal.d.ts +0 -10
  60. package/dist/types/reporter/src/components/design-system/skeleton.d.ts +0 -19
  61. package/dist/types/reporter/src/components/design-system/spinner.d.ts +0 -10
  62. package/dist/types/reporter/src/components/design-system/tabs.d.ts +0 -13
  63. package/dist/types/reporter/src/components/layout/header.d.ts +0 -5
  64. package/dist/types/reporter/src/components/layout/index.d.ts +0 -2
  65. package/dist/types/reporter/src/components/layout/layout.d.ts +0 -6
  66. package/dist/types/reporter/src/components/ui/smart-image.d.ts +0 -7
  67. package/dist/types/reporter/src/components/ui/toast.d.ts +0 -4
  68. package/dist/types/reporter/src/components/views/builds-view.d.ts +0 -1
  69. package/dist/types/reporter/src/components/views/comparison-detail-view.d.ts +0 -5
  70. package/dist/types/reporter/src/components/views/comparisons-view.d.ts +0 -5
  71. package/dist/types/reporter/src/components/views/projects-view.d.ts +0 -1
  72. package/dist/types/reporter/src/components/views/settings-view.d.ts +0 -1
  73. package/dist/types/reporter/src/components/views/stats-view.d.ts +0 -1
  74. package/dist/types/reporter/src/components/waiting-for-screenshots.d.ts +0 -1
  75. package/dist/types/reporter/src/hooks/queries/use-auth-queries.d.ts +0 -15
  76. package/dist/types/reporter/src/hooks/queries/use-cloud-queries.d.ts +0 -6
  77. package/dist/types/reporter/src/hooks/queries/use-config-queries.d.ts +0 -6
  78. package/dist/types/reporter/src/hooks/queries/use-tdd-queries.d.ts +0 -9
  79. package/dist/types/reporter/src/hooks/use-comparison-filters.d.ts +0 -20
  80. package/dist/types/reporter/src/hooks/use-image-loader.d.ts +0 -1
  81. package/dist/types/reporter/src/lib/query-client.d.ts +0 -2
  82. package/dist/types/reporter/src/lib/query-keys.d.ts +0 -13
  83. package/dist/types/reporter/src/main.d.ts +0 -1
  84. package/dist/types/reporter/src/services/api-client.d.ts +0 -11
  85. package/dist/types/reporter/src/utils/comparison-helpers.d.ts +0 -16
  86. package/dist/types/reporter/src/utils/constants.d.ts +0 -37
  87. package/dist/types/reporter/vite.config.d.ts +0 -2
  88. package/dist/types/reporter/vite.dev.config.d.ts +0 -2
  89. package/dist/types/sdk/index.d.ts +0 -110
  90. package/dist/types/server/handlers/api-handler.d.ts +0 -88
  91. package/dist/types/server/handlers/tdd-handler.d.ts +0 -162
  92. package/dist/types/server/http-server.d.ts +0 -6
  93. package/dist/types/server/middleware/cors.d.ts +0 -11
  94. package/dist/types/server/middleware/json-parser.d.ts +0 -10
  95. package/dist/types/server/middleware/response.d.ts +0 -50
  96. package/dist/types/server/routers/assets.d.ts +0 -6
  97. package/dist/types/server/routers/auth.d.ts +0 -9
  98. package/dist/types/server/routers/baseline.d.ts +0 -13
  99. package/dist/types/server/routers/cloud-proxy.d.ts +0 -11
  100. package/dist/types/server/routers/config.d.ts +0 -9
  101. package/dist/types/server/routers/dashboard.d.ts +0 -6
  102. package/dist/types/server/routers/health.d.ts +0 -11
  103. package/dist/types/server/routers/projects.d.ts +0 -9
  104. package/dist/types/server/routers/screenshot.d.ts +0 -11
  105. package/dist/types/services/api-service.d.ts +0 -100
  106. package/dist/types/services/auth-service.d.ts +0 -59
  107. package/dist/types/services/build-manager.d.ts +0 -69
  108. package/dist/types/services/config-service.d.ts +0 -97
  109. package/dist/types/services/html-report-generator.d.ts +0 -52
  110. package/dist/types/services/index.d.ts +0 -7
  111. package/dist/types/services/project-service.d.ts +0 -105
  112. package/dist/types/services/report-generator/viewer.d.ts +0 -0
  113. package/dist/types/services/screenshot-server.d.ts +0 -10
  114. package/dist/types/services/server-manager.d.ts +0 -269
  115. package/dist/types/services/static-report-generator.d.ts +0 -25
  116. package/dist/types/services/tdd-service.d.ts +0 -95
  117. package/dist/types/services/test-runner.d.ts +0 -31
  118. package/dist/types/services/uploader.d.ts +0 -36
  119. package/dist/types/utils/browser.d.ts +0 -6
  120. package/dist/types/utils/build-history.d.ts +0 -16
  121. package/dist/types/utils/ci-env.d.ts +0 -55
  122. package/dist/types/utils/colors.d.ts +0 -12
  123. package/dist/types/utils/config-helpers.d.ts +0 -6
  124. package/dist/types/utils/config-loader.d.ts +0 -25
  125. package/dist/types/utils/config-schema.d.ts +0 -51
  126. package/dist/types/utils/environment-config.d.ts +0 -59
  127. package/dist/types/utils/environment.d.ts +0 -36
  128. package/dist/types/utils/fetch-utils.d.ts +0 -1
  129. package/dist/types/utils/file-helpers.d.ts +0 -18
  130. package/dist/types/utils/git.d.ts +0 -56
  131. package/dist/types/utils/global-config.d.ts +0 -84
  132. package/dist/types/utils/image-input-detector.d.ts +0 -71
  133. package/dist/types/utils/output.d.ts +0 -84
  134. package/dist/types/utils/package-info.d.ts +0 -15
  135. package/dist/types/utils/security.d.ts +0 -30
@@ -1,25 +0,0 @@
1
- export class StaticReportGenerator {
2
- constructor(workingDir: any, config: any);
3
- workingDir: any;
4
- config: any;
5
- reportDir: any;
6
- reportPath: any;
7
- /**
8
- * Generate static HTML report with React reporter bundle
9
- * @param {Object} reportData - Complete report data (same format as live dashboard)
10
- * @returns {Promise<string>} Path to generated report
11
- */
12
- generateReport(reportData: any): Promise<string>;
13
- /**
14
- * Generate HTML template with embedded React app
15
- * @param {Object} reportData - Report data to embed
16
- * @returns {string} HTML content
17
- */
18
- generateHtmlTemplate(reportData: any): string;
19
- /**
20
- * Generate a minimal HTML report when bundles are missing (fallback)
21
- * @param {Object} reportData - Report data
22
- * @returns {string} Minimal HTML content
23
- */
24
- generateFallbackHtml(reportData: any): string;
25
- }
@@ -1,95 +0,0 @@
1
- /**
2
- * Create a new TDD service instance
3
- */
4
- export function createTDDService(config: any, options?: {}): TddService;
5
- export class TddService {
6
- constructor(config: any, workingDir?: any, setBaseline?: boolean, authService?: any);
7
- config: any;
8
- setBaseline: boolean;
9
- authService: any;
10
- api: ApiService;
11
- workingDir: string;
12
- baselinePath: string;
13
- currentPath: string;
14
- diffPath: string;
15
- baselineData: any;
16
- comparisons: any[];
17
- threshold: any;
18
- downloadBaselines(environment?: string, branch?: any, buildId?: any, comparisonId?: any): Promise<any>;
19
- /**
20
- * Download baselines using OAuth authentication
21
- * Used when user is logged in via device flow but no API token is configured
22
- * @param {string} buildId - Build ID to download from
23
- * @param {string} organizationSlug - Organization slug
24
- * @param {string} projectSlug - Project slug
25
- * @param {Object} authService - Auth service for OAuth requests
26
- * @returns {Promise<Object>} Download result
27
- */
28
- downloadBaselinesWithAuth(buildId: string, organizationSlug: string, projectSlug: string, authService: any): Promise<any>;
29
- /**
30
- * Handle local baseline logic (either load existing or prepare for new baselines)
31
- * @returns {Promise<Object|null>} Baseline data or null if no local baselines exist
32
- */
33
- handleLocalBaselines(): Promise<any | null>;
34
- loadBaseline(): Promise<any>;
35
- compareScreenshot(name: any, imageBuffer: any, properties?: {}): Promise<{
36
- id: any;
37
- name: any;
38
- status: string;
39
- baseline: any;
40
- current: any;
41
- diff: any;
42
- properties: any;
43
- signature: string;
44
- }>;
45
- getResults(): {
46
- total: number;
47
- passed: number;
48
- failed: number;
49
- new: number;
50
- errors: number;
51
- comparisons: any[];
52
- baseline: any;
53
- };
54
- printResults(): Promise<{
55
- total: number;
56
- passed: number;
57
- failed: number;
58
- new: number;
59
- errors: number;
60
- comparisons: any[];
61
- baseline: any;
62
- }>;
63
- /**
64
- * Generate HTML report for TDD results
65
- * @param {Object} results - TDD comparison results
66
- */
67
- generateHtmlReport(results: any): Promise<string>;
68
- /**
69
- * Open HTML report in default browser
70
- * @param {string} reportPath - Path to HTML report
71
- */
72
- openReport(reportPath: string): Promise<void>;
73
- /**
74
- * Update baselines with current screenshots (accept changes)
75
- * @returns {number} Number of baselines updated
76
- */
77
- updateBaselines(): number;
78
- /**
79
- * Create a new baseline (used during --set-baseline mode)
80
- * @private
81
- */
82
- private createNewBaseline;
83
- /**
84
- * Update a single baseline with current screenshot
85
- * @private
86
- */
87
- private updateSingleBaseline;
88
- /**
89
- * Accept a current screenshot as the new baseline
90
- * @param {string|Object} idOrComparison - Comparison ID or comparison object
91
- * @returns {Object} Result object
92
- */
93
- acceptBaseline(idOrComparison: string | any): any;
94
- }
95
- import { ApiService } from '../services/api-service.js';
@@ -1,31 +0,0 @@
1
- export class TestRunner {
2
- constructor(config: any, buildManager: any, serverManager: any, tddService: any);
3
- config: any;
4
- buildManager: any;
5
- serverManager: any;
6
- tddService: any;
7
- testProcess: any;
8
- /**
9
- * Initialize server for daemon mode (no test execution)
10
- * @param {Object} options - Options for server initialization
11
- */
12
- initialize(options: any): Promise<void>;
13
- run(options: any): Promise<{
14
- testsPassed: number;
15
- testsFailed: number;
16
- screenshotsCaptured: number;
17
- buildId?: undefined;
18
- url?: undefined;
19
- } | {
20
- buildId: any;
21
- url: any;
22
- testsPassed: number;
23
- testsFailed: number;
24
- screenshotsCaptured: number;
25
- }>;
26
- createBuild(options: any, tdd: any): Promise<any>;
27
- createApiService(): Promise<import("./api-service.js").ApiService>;
28
- finalizeBuild(buildId: any, isTddMode: any, success: any, executionTime: any): Promise<void>;
29
- executeTestCommand(testCommand: any, env: any): Promise<any>;
30
- cancel(): Promise<void>;
31
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Create a new uploader instance
3
- */
4
- export function createUploader({ apiKey, apiUrl, userAgent, command, upload: uploadConfig }: {
5
- apiKey: any;
6
- apiUrl: any;
7
- userAgent: any;
8
- command: any;
9
- upload?: {};
10
- }, options?: {}): {
11
- upload: ({ screenshotsDir, buildName, branch, commit, message, environment, threshold, pullRequestNumber, parallelId, onProgress, }: {
12
- screenshotsDir: any;
13
- buildName: any;
14
- branch: any;
15
- commit: any;
16
- message: any;
17
- environment?: string;
18
- threshold: any;
19
- pullRequestNumber: any;
20
- parallelId: any;
21
- onProgress?: () => void;
22
- }) => Promise<{
23
- success: boolean;
24
- buildId: any;
25
- url: any;
26
- stats: {
27
- total: number;
28
- uploaded: any;
29
- skipped: any;
30
- };
31
- }>;
32
- waitForBuild: (buildId: any, timeout?: number) => Promise<{
33
- status: string;
34
- build: any;
35
- }>;
36
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Open a URL in the default browser
3
- * @param {string} url - URL to open
4
- * @returns {Promise<boolean>} True if successful
5
- */
6
- export function openBrowser(url: string): Promise<boolean>;
@@ -1,16 +0,0 @@
1
- /**
2
- * Archive a build to history directory
3
- * @param {string} workingDir - Working directory
4
- * @param {string} buildId - Build ID to archive
5
- * @param {Array} builds - Build data
6
- * @param {Array} comparisons - Comparison data
7
- * @param {Object} summary - Summary stats
8
- * @param {number} maxHistory - Maximum number of builds to keep (default: 3)
9
- */
10
- export function archiveBuild(workingDir: string, buildId: string, builds: any[], comparisons: any[], summary: any, maxHistory?: number): void;
11
- /**
12
- * Get list of archived builds
13
- * @param {string} workingDir - Working directory
14
- * @returns {Array} Array of build metadata
15
- */
16
- export function getArchivedBuilds(workingDir: string): any[];
@@ -1,55 +0,0 @@
1
- /**
2
- * CI Environment Detection
3
- *
4
- * Generic functions to extract git and PR information from any CI provider
5
- */
6
- /**
7
- * Get the branch name from CI environment variables
8
- * @returns {string|null} Branch name or null if not available
9
- */
10
- export function getBranch(): string | null;
11
- /**
12
- * Get the commit SHA from CI environment variables
13
- * @returns {string|null} Commit SHA or null if not available
14
- */
15
- export function getCommit(): string | null;
16
- /**
17
- * Get the commit message from CI environment variables
18
- * @returns {string|null} Commit message or null if not available
19
- */
20
- export function getCommitMessage(): string | null;
21
- /**
22
- * Get the pull request number from CI environment variables
23
- * @returns {number|null} PR number or null if not available/not a PR
24
- */
25
- export function getPullRequestNumber(): number | null;
26
- /**
27
- * Get the PR head SHA from CI environment variables
28
- * @returns {string|null} PR head SHA or null if not available
29
- */
30
- export function getPullRequestHeadSha(): string | null;
31
- /**
32
- * Get the PR base SHA from CI environment variables
33
- * @returns {string|null} PR base SHA or null if not available
34
- */
35
- export function getPullRequestBaseSha(): string | null;
36
- /**
37
- * Get the PR head ref (branch) from CI environment variables
38
- * @returns {string|null} PR head ref or null if not available
39
- */
40
- export function getPullRequestHeadRef(): string | null;
41
- /**
42
- * Get the PR base ref (target branch) from CI environment variables
43
- * @returns {string|null} PR base ref or null if not available
44
- */
45
- export function getPullRequestBaseRef(): string | null;
46
- /**
47
- * Check if we're currently in a pull request context
48
- * @returns {boolean} True if in a PR context
49
- */
50
- export function isPullRequest(): boolean;
51
- /**
52
- * Get the CI provider name
53
- * @returns {string} CI provider name or 'unknown'
54
- */
55
- export function getCIProvider(): string;
@@ -1,12 +0,0 @@
1
- export function createColors(options?: {}): {
2
- success: any;
3
- error: any;
4
- warning: any;
5
- info: any;
6
- };
7
- export namespace colors {
8
- let success: any;
9
- let error: any;
10
- let warning: any;
11
- let info: any;
12
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Define Vizzly configuration with type hints
3
- * @param {import('../types/index.js').VizzlyConfig} config
4
- * @returns {import('../types/index.js').VizzlyConfig}
5
- */
6
- export function defineConfig(config: any): any;
@@ -1,25 +0,0 @@
1
- export function loadConfig(configPath?: any, cliOverrides?: {}): Promise<{
2
- server: {
3
- port: number;
4
- timeout: number;
5
- };
6
- build: {
7
- name: string;
8
- environment: string;
9
- };
10
- upload: {
11
- screenshotsDir: string;
12
- batchSize: number;
13
- timeout: number;
14
- };
15
- comparison: {
16
- threshold: number;
17
- };
18
- tdd: {
19
- openReport: boolean;
20
- };
21
- plugins: any[];
22
- apiKey: any;
23
- apiUrl: string;
24
- }>;
25
- export function getScreenshotPaths(config: any): any[];
@@ -1,51 +0,0 @@
1
- /**
2
- * Validate Vizzly configuration
3
- * @param {unknown} config - Configuration to validate
4
- * @returns {Object} Validated configuration
5
- * @throws {ZodError} If validation fails
6
- */
7
- export function validateVizzlyConfig(config: unknown): any;
8
- /**
9
- * Safely validate with defaults if config is missing
10
- * @param {unknown} config - Configuration to validate (can be undefined)
11
- * @returns {Object} Validated configuration with defaults
12
- */
13
- export function validateVizzlyConfigWithDefaults(config: unknown): any;
14
- /**
15
- * Core Vizzly configuration schema
16
- * Allows plugin-specific keys with passthrough for extensibility
17
- */
18
- export let vizzlyConfigSchema: z.ZodDefault<z.ZodObject<{
19
- apiKey: z.ZodOptional<z.ZodString>;
20
- apiUrl: z.ZodOptional<z.ZodString>;
21
- server: z.ZodDefault<z.ZodObject<{
22
- port: z.ZodDefault<z.ZodNumber>;
23
- timeout: z.ZodDefault<z.ZodNumber>;
24
- }, z.core.$strip>>;
25
- build: z.ZodDefault<z.ZodObject<{
26
- name: z.ZodDefault<z.ZodString>;
27
- environment: z.ZodDefault<z.ZodString>;
28
- branch: z.ZodOptional<z.ZodString>;
29
- commit: z.ZodOptional<z.ZodString>;
30
- message: z.ZodOptional<z.ZodString>;
31
- }, z.core.$strip>>;
32
- upload: z.ZodDefault<z.ZodObject<{
33
- screenshotsDir: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
34
- batchSize: z.ZodDefault<z.ZodNumber>;
35
- timeout: z.ZodDefault<z.ZodNumber>;
36
- }, z.core.$strip>>;
37
- comparison: z.ZodDefault<z.ZodObject<{
38
- threshold: z.ZodDefault<z.ZodNumber>;
39
- }, z.core.$strip>>;
40
- tdd: z.ZodDefault<z.ZodObject<{
41
- openReport: z.ZodDefault<z.ZodBoolean>;
42
- }, z.core.$strip>>;
43
- plugins: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
- parallelId: z.ZodOptional<z.ZodString>;
45
- baselineBuildId: z.ZodOptional<z.ZodString>;
46
- baselineComparisonId: z.ZodOptional<z.ZodString>;
47
- eager: z.ZodOptional<z.ZodBoolean>;
48
- wait: z.ZodOptional<z.ZodBoolean>;
49
- allowNoToken: z.ZodOptional<z.ZodBoolean>;
50
- }, z.core.$loose>>;
51
- import { z } from 'zod';
@@ -1,59 +0,0 @@
1
- /**
2
- * Environment Configuration Utility
3
- * Centralized access to environment variables with proper defaults
4
- */
5
- /**
6
- * Get API token from environment
7
- * @returns {string|undefined} API token
8
- */
9
- export function getApiToken(): string | undefined;
10
- /**
11
- * Get API URL from environment
12
- * @returns {string} API URL with default
13
- */
14
- export function getApiUrl(): string;
15
- /**
16
- * Get log level from environment
17
- * @returns {string} Log level with default
18
- */
19
- export function getLogLevel(): string;
20
- /**
21
- * Get user agent from environment
22
- * @returns {string|undefined} User agent string
23
- */
24
- export function getUserAgent(): string | undefined;
25
- /**
26
- * Check if Vizzly is enabled in client
27
- * @returns {boolean} Whether Vizzly is enabled
28
- */
29
- export function isVizzlyEnabled(): boolean;
30
- /**
31
- * Get server URL from environment
32
- * @returns {string|undefined} Server URL
33
- */
34
- export function getServerUrl(): string | undefined;
35
- /**
36
- * Get build ID from environment
37
- * @returns {string|undefined} Build ID
38
- */
39
- export function getBuildId(): string | undefined;
40
- /**
41
- * Get parallel ID from environment
42
- * @returns {string|undefined} Parallel ID
43
- */
44
- export function getParallelId(): string | undefined;
45
- /**
46
- * Check if TDD mode is enabled
47
- * @returns {boolean} Whether TDD mode is enabled
48
- */
49
- export function isTddMode(): boolean;
50
- /**
51
- * Set Vizzly enabled state (for client)
52
- * @param {boolean} enabled - Whether to enable Vizzly
53
- */
54
- export function setVizzlyEnabled(enabled: boolean): void;
55
- /**
56
- * Get all Vizzly environment variables
57
- * @returns {Object} All environment configuration
58
- */
59
- export function getAllEnvironmentConfig(): any;
@@ -1,36 +0,0 @@
1
- /**
2
- * Environment detection utilities for handling CI/interactive environments
3
- */
4
- /**
5
- * Check if running in a CI environment
6
- * Based on common CI environment variables
7
- * @returns {boolean} True if running in CI
8
- */
9
- export function isCI(): boolean;
10
- /**
11
- * Check if stdout supports interactive features
12
- * @returns {boolean} True if interactive features are supported
13
- */
14
- export function isInteractiveTerminal(): boolean;
15
- /**
16
- * Determine if interactive mode should be enabled
17
- * Takes into account CI detection, TTY support, and explicit flags
18
- * @param {Object} options
19
- * @param {boolean} [options.noInteractive] - Explicit flag to disable interactive mode
20
- * @param {boolean} [options.interactive] - Explicit flag to force interactive mode
21
- * @returns {boolean} True if interactive mode should be enabled
22
- */
23
- export function shouldUseInteractiveMode(options?: {
24
- noInteractive?: boolean;
25
- interactive?: boolean;
26
- }): boolean;
27
- /**
28
- * Get environment type for logging/debugging
29
- * @returns {string} Environment type description
30
- */
31
- export function getEnvironmentType(): string;
32
- /**
33
- * Get detailed environment info for debugging
34
- * @returns {Object} Environment details
35
- */
36
- export function getEnvironmentDetails(): any;
@@ -1 +0,0 @@
1
- export function fetchWithTimeout(url: any, opts?: {}, ms?: number): Promise<Response>;
@@ -1,18 +0,0 @@
1
- /**
2
- * Resolve image buffer from file path or return buffer as-is
3
- * Handles both Buffer inputs and file path strings, with proper validation and error handling
4
- *
5
- * @param {Buffer|string} imageBufferOrPath - Image data as Buffer or file path
6
- * @param {string} contextName - Context for error messages (e.g., 'screenshot', 'compare')
7
- * @returns {Buffer} The image buffer
8
- * @throws {VizzlyError} When file not found, unreadable, or invalid input type
9
- *
10
- * @example
11
- * // With Buffer
12
- * const buffer = resolveImageBuffer(myBuffer, 'screenshot');
13
- *
14
- * @example
15
- * // With file path
16
- * const buffer = resolveImageBuffer('./my-image.png', 'screenshot');
17
- */
18
- export function resolveImageBuffer(imageBufferOrPath: Buffer | string, contextName: string): Buffer;
@@ -1,56 +0,0 @@
1
- export function getCommonAncestor(commit1: any, commit2: any, cwd?: any): Promise<any>;
2
- export function getCurrentCommitSha(cwd?: any): Promise<any>;
3
- export function getCurrentBranch(cwd?: any): Promise<any>;
4
- export function getDefaultBranch(cwd?: any): Promise<any>;
5
- export function generateBuildName(): string;
6
- /**
7
- * Get the current commit message
8
- * @param {string} cwd - Working directory
9
- * @returns {Promise<string|null>} Commit message or null if not available
10
- */
11
- export function getCommitMessage(cwd?: string): Promise<string | null>;
12
- /**
13
- * Detect commit message with override and environment variable support
14
- * @param {string} override - Commit message override from CLI
15
- * @param {string} cwd - Working directory
16
- * @returns {Promise<string|null>} Commit message or null if not available
17
- */
18
- export function detectCommitMessage(override?: string, cwd?: string): Promise<string | null>;
19
- /**
20
- * Check if the working directory is a git repository
21
- * @param {string} cwd - Working directory
22
- * @returns {Promise<boolean>}
23
- */
24
- export function isGitRepository(cwd?: string): Promise<boolean>;
25
- /**
26
- * Get git status information
27
- * @param {string} cwd - Working directory
28
- * @returns {Promise<Object|null>} Git status info or null
29
- */
30
- export function getGitStatus(cwd?: string): Promise<any | null>;
31
- /**
32
- * Detect branch with override support
33
- * @param {string} override - Branch override from CLI
34
- * @param {string} cwd - Working directory
35
- * @returns {Promise<string>}
36
- */
37
- export function detectBranch(override?: string, cwd?: string): Promise<string>;
38
- /**
39
- * Detect commit SHA with override support
40
- * @param {string} override - Commit override from CLI
41
- * @param {string} cwd - Working directory
42
- * @returns {Promise<string|null>}
43
- */
44
- export function detectCommit(override?: string, cwd?: string): Promise<string | null>;
45
- /**
46
- * Generate build name with git information
47
- * @param {string} override - Build name override from CLI
48
- * @param {string} cwd - Working directory
49
- * @returns {Promise<string>}
50
- */
51
- export function generateBuildNameWithGit(override?: string, cwd?: string): Promise<string>;
52
- /**
53
- * Detect pull request number from CI environment
54
- * @returns {number|null} Pull request number or null if not in PR context
55
- */
56
- export function detectPullRequestNumber(): number | null;
@@ -1,84 +0,0 @@
1
- /**
2
- * Get the path to the global Vizzly directory
3
- * @returns {string} Path to ~/.vizzly
4
- */
5
- export function getGlobalConfigDir(): string;
6
- /**
7
- * Get the path to the global config file
8
- * @returns {string} Path to ~/.vizzly/config.json
9
- */
10
- export function getGlobalConfigPath(): string;
11
- /**
12
- * Load the global configuration
13
- * @returns {Promise<Object>} Global config object
14
- */
15
- export function loadGlobalConfig(): Promise<any>;
16
- /**
17
- * Save the global configuration
18
- * @param {Object} config - Configuration object to save
19
- * @returns {Promise<void>}
20
- */
21
- export function saveGlobalConfig(config: any): Promise<void>;
22
- /**
23
- * Clear all global configuration
24
- * @returns {Promise<void>}
25
- */
26
- export function clearGlobalConfig(): Promise<void>;
27
- /**
28
- * Get authentication tokens from global config
29
- * @returns {Promise<Object|null>} Token object with accessToken, refreshToken, expiresAt, user, or null if not found
30
- */
31
- export function getAuthTokens(): Promise<any | null>;
32
- /**
33
- * Save authentication tokens to global config
34
- * @param {Object} auth - Auth object with accessToken, refreshToken, expiresAt, user
35
- * @returns {Promise<void>}
36
- */
37
- export function saveAuthTokens(auth: any): Promise<void>;
38
- /**
39
- * Clear authentication tokens from global config
40
- * @returns {Promise<void>}
41
- */
42
- export function clearAuthTokens(): Promise<void>;
43
- /**
44
- * Check if authentication tokens exist and are not expired
45
- * @returns {Promise<boolean>} True if valid tokens exist
46
- */
47
- export function hasValidTokens(): Promise<boolean>;
48
- /**
49
- * Get the access token from global config if available
50
- * @returns {Promise<string|null>} Access token or null
51
- */
52
- export function getAccessToken(): Promise<string | null>;
53
- /**
54
- * Get project mapping for a directory
55
- * Walks up the directory tree to find the closest mapping
56
- * @param {string} directoryPath - Absolute path to project directory
57
- * @returns {Promise<Object|null>} Project data or null
58
- */
59
- export function getProjectMapping(directoryPath: string): Promise<any | null>;
60
- /**
61
- * Save project mapping for a directory
62
- * @param {string} directoryPath - Absolute path to project directory
63
- * @param {Object} projectData - Project configuration
64
- * @param {string} projectData.token - Project API token (vzt_...)
65
- * @param {string} projectData.projectSlug - Project slug
66
- * @param {string} projectData.organizationSlug - Organization slug
67
- * @param {string} projectData.projectName - Project name
68
- */
69
- export function saveProjectMapping(directoryPath: string, projectData: {
70
- token: string;
71
- projectSlug: string;
72
- organizationSlug: string;
73
- projectName: string;
74
- }): Promise<void>;
75
- /**
76
- * Get all project mappings
77
- * @returns {Promise<Object>} Map of directory paths to project data
78
- */
79
- export function getProjectMappings(): Promise<any>;
80
- /**
81
- * Delete project mapping for a directory
82
- * @param {string} directoryPath - Absolute path to project directory
83
- */
84
- export function deleteProjectMapping(directoryPath: string): Promise<void>;