@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.
- package/dist/client/index.js +21 -4
- package/dist/reporter/reporter-bundle.css +1 -1
- package/dist/reporter/reporter-bundle.iife.js +11 -11
- package/dist/sdk/index.js +6 -6
- package/dist/services/api-service.js +42 -0
- package/dist/services/tdd-service.js +189 -6
- package/dist/services/test-runner.js +0 -8
- package/dist/services/uploader.js +1 -1
- package/dist/types/client.d.ts +88 -0
- package/dist/types/config.d.ts +29 -0
- package/dist/types/index.d.ts +426 -9
- package/dist/types/sdk.d.ts +146 -0
- package/dist/utils/config-helpers.js +2 -2
- package/docs/tdd-mode.md +34 -0
- package/package.json +21 -4
- package/dist/types/cli.d.ts +0 -2
- package/dist/types/client/index.d.ts +0 -80
- package/dist/types/commands/doctor.d.ts +0 -11
- package/dist/types/commands/finalize.d.ts +0 -13
- package/dist/types/commands/init.d.ts +0 -32
- package/dist/types/commands/login.d.ts +0 -11
- package/dist/types/commands/logout.d.ts +0 -11
- package/dist/types/commands/project.d.ts +0 -28
- package/dist/types/commands/run.d.ts +0 -16
- package/dist/types/commands/status.d.ts +0 -13
- package/dist/types/commands/tdd-daemon.d.ts +0 -24
- package/dist/types/commands/tdd.d.ts +0 -17
- package/dist/types/commands/upload.d.ts +0 -13
- package/dist/types/commands/whoami.d.ts +0 -11
- package/dist/types/errors/vizzly-error.d.ts +0 -75
- package/dist/types/plugin-loader.d.ts +0 -7
- package/dist/types/reporter/src/api/client.d.ts +0 -178
- package/dist/types/reporter/src/components/app-router.d.ts +0 -1
- package/dist/types/reporter/src/components/code-block.d.ts +0 -4
- package/dist/types/reporter/src/components/comparison/comparison-actions.d.ts +0 -5
- package/dist/types/reporter/src/components/comparison/comparison-card.d.ts +0 -7
- package/dist/types/reporter/src/components/comparison/comparison-group.d.ts +0 -10
- package/dist/types/reporter/src/components/comparison/comparison-list.d.ts +0 -6
- package/dist/types/reporter/src/components/comparison/comparison-modes/onion-skin-mode.d.ts +0 -10
- package/dist/types/reporter/src/components/comparison/comparison-modes/overlay-mode.d.ts +0 -11
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/base-comparison-mode.d.ts +0 -14
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts +0 -30
- package/dist/types/reporter/src/components/comparison/comparison-modes/toggle-view.d.ts +0 -8
- package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +0 -8
- package/dist/types/reporter/src/components/comparison/fullscreen-viewer.d.ts +0 -13
- package/dist/types/reporter/src/components/comparison/screenshot-display.d.ts +0 -16
- package/dist/types/reporter/src/components/comparison/screenshot-list.d.ts +0 -9
- package/dist/types/reporter/src/components/comparison/variant-selector.d.ts +0 -9
- package/dist/types/reporter/src/components/comparison/view-mode-selector.d.ts +0 -4
- package/dist/types/reporter/src/components/dashboard/dashboard-filters.d.ts +0 -16
- package/dist/types/reporter/src/components/design-system/alert.d.ts +0 -9
- package/dist/types/reporter/src/components/design-system/badge.d.ts +0 -17
- package/dist/types/reporter/src/components/design-system/button.d.ts +0 -19
- package/dist/types/reporter/src/components/design-system/card.d.ts +0 -31
- package/dist/types/reporter/src/components/design-system/empty-state.d.ts +0 -13
- package/dist/types/reporter/src/components/design-system/form-controls.d.ts +0 -44
- package/dist/types/reporter/src/components/design-system/health-ring.d.ts +0 -7
- package/dist/types/reporter/src/components/design-system/index.d.ts +0 -11
- package/dist/types/reporter/src/components/design-system/modal.d.ts +0 -10
- package/dist/types/reporter/src/components/design-system/skeleton.d.ts +0 -19
- package/dist/types/reporter/src/components/design-system/spinner.d.ts +0 -10
- package/dist/types/reporter/src/components/design-system/tabs.d.ts +0 -13
- package/dist/types/reporter/src/components/layout/header.d.ts +0 -5
- package/dist/types/reporter/src/components/layout/index.d.ts +0 -2
- package/dist/types/reporter/src/components/layout/layout.d.ts +0 -6
- package/dist/types/reporter/src/components/ui/smart-image.d.ts +0 -7
- package/dist/types/reporter/src/components/ui/toast.d.ts +0 -4
- package/dist/types/reporter/src/components/views/builds-view.d.ts +0 -1
- package/dist/types/reporter/src/components/views/comparison-detail-view.d.ts +0 -5
- package/dist/types/reporter/src/components/views/comparisons-view.d.ts +0 -5
- package/dist/types/reporter/src/components/views/projects-view.d.ts +0 -1
- package/dist/types/reporter/src/components/views/settings-view.d.ts +0 -1
- package/dist/types/reporter/src/components/views/stats-view.d.ts +0 -1
- package/dist/types/reporter/src/components/waiting-for-screenshots.d.ts +0 -1
- package/dist/types/reporter/src/hooks/queries/use-auth-queries.d.ts +0 -15
- package/dist/types/reporter/src/hooks/queries/use-cloud-queries.d.ts +0 -6
- package/dist/types/reporter/src/hooks/queries/use-config-queries.d.ts +0 -6
- package/dist/types/reporter/src/hooks/queries/use-tdd-queries.d.ts +0 -9
- package/dist/types/reporter/src/hooks/use-comparison-filters.d.ts +0 -20
- package/dist/types/reporter/src/hooks/use-image-loader.d.ts +0 -1
- package/dist/types/reporter/src/lib/query-client.d.ts +0 -2
- package/dist/types/reporter/src/lib/query-keys.d.ts +0 -13
- package/dist/types/reporter/src/main.d.ts +0 -1
- package/dist/types/reporter/src/services/api-client.d.ts +0 -11
- package/dist/types/reporter/src/utils/comparison-helpers.d.ts +0 -16
- package/dist/types/reporter/src/utils/constants.d.ts +0 -37
- package/dist/types/reporter/vite.config.d.ts +0 -2
- package/dist/types/reporter/vite.dev.config.d.ts +0 -2
- package/dist/types/sdk/index.d.ts +0 -110
- package/dist/types/server/handlers/api-handler.d.ts +0 -88
- package/dist/types/server/handlers/tdd-handler.d.ts +0 -162
- package/dist/types/server/http-server.d.ts +0 -6
- package/dist/types/server/middleware/cors.d.ts +0 -11
- package/dist/types/server/middleware/json-parser.d.ts +0 -10
- package/dist/types/server/middleware/response.d.ts +0 -50
- package/dist/types/server/routers/assets.d.ts +0 -6
- package/dist/types/server/routers/auth.d.ts +0 -9
- package/dist/types/server/routers/baseline.d.ts +0 -13
- package/dist/types/server/routers/cloud-proxy.d.ts +0 -11
- package/dist/types/server/routers/config.d.ts +0 -9
- package/dist/types/server/routers/dashboard.d.ts +0 -6
- package/dist/types/server/routers/health.d.ts +0 -11
- package/dist/types/server/routers/projects.d.ts +0 -9
- package/dist/types/server/routers/screenshot.d.ts +0 -11
- package/dist/types/services/api-service.d.ts +0 -100
- package/dist/types/services/auth-service.d.ts +0 -59
- package/dist/types/services/build-manager.d.ts +0 -69
- package/dist/types/services/config-service.d.ts +0 -97
- package/dist/types/services/html-report-generator.d.ts +0 -52
- package/dist/types/services/index.d.ts +0 -7
- package/dist/types/services/project-service.d.ts +0 -105
- package/dist/types/services/report-generator/viewer.d.ts +0 -0
- package/dist/types/services/screenshot-server.d.ts +0 -10
- package/dist/types/services/server-manager.d.ts +0 -269
- package/dist/types/services/static-report-generator.d.ts +0 -25
- package/dist/types/services/tdd-service.d.ts +0 -95
- package/dist/types/services/test-runner.d.ts +0 -31
- package/dist/types/services/uploader.d.ts +0 -36
- package/dist/types/utils/browser.d.ts +0 -6
- package/dist/types/utils/build-history.d.ts +0 -16
- package/dist/types/utils/ci-env.d.ts +0 -55
- package/dist/types/utils/colors.d.ts +0 -12
- package/dist/types/utils/config-helpers.d.ts +0 -6
- package/dist/types/utils/config-loader.d.ts +0 -25
- package/dist/types/utils/config-schema.d.ts +0 -51
- package/dist/types/utils/environment-config.d.ts +0 -59
- package/dist/types/utils/environment.d.ts +0 -36
- package/dist/types/utils/fetch-utils.d.ts +0 -1
- package/dist/types/utils/file-helpers.d.ts +0 -18
- package/dist/types/utils/git.d.ts +0 -56
- package/dist/types/utils/global-config.d.ts +0 -84
- package/dist/types/utils/image-input-detector.d.ts +0 -71
- package/dist/types/utils/output.d.ts +0 -84
- package/dist/types/utils/package-info.d.ts +0 -15
- package/dist/types/utils/security.d.ts +0 -30
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a new Vizzly instance with custom configuration
|
|
3
|
-
*
|
|
4
|
-
* @param {import('../types').VizzlyConfig} [config] - Configuration options
|
|
5
|
-
* @returns {Promise<VizzlySDK>} Configured Vizzly SDK instance
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* // Create with custom config
|
|
9
|
-
* import { createVizzly } from '@vizzly-testing/cli/sdk';
|
|
10
|
-
*
|
|
11
|
-
* const vizzly = await createVizzly({
|
|
12
|
-
* apiKey: process.env.VIZZLY_TOKEN,
|
|
13
|
-
* apiUrl: 'https://app.vizzly.dev',
|
|
14
|
-
* server: {
|
|
15
|
-
* port: 3003,
|
|
16
|
-
* enabled: true
|
|
17
|
-
* }
|
|
18
|
-
* });
|
|
19
|
-
*
|
|
20
|
-
* // Start the server
|
|
21
|
-
* await vizzly.start();
|
|
22
|
-
*
|
|
23
|
-
* // Take screenshots
|
|
24
|
-
* const screenshot = await getScreenshotSomehow();
|
|
25
|
-
* await vizzly.screenshot('my-test', screenshot);
|
|
26
|
-
*
|
|
27
|
-
* // Upload results
|
|
28
|
-
* const result = await vizzly.upload();
|
|
29
|
-
* console.log(`Build URL: ${result.url}`);
|
|
30
|
-
*
|
|
31
|
-
* // Cleanup
|
|
32
|
-
* await vizzly.stop();
|
|
33
|
-
*/
|
|
34
|
-
export function createVizzly(config?: any, options?: {}): Promise<VizzlySDK>;
|
|
35
|
-
/**
|
|
36
|
-
* @typedef {Object} VizzlySDK
|
|
37
|
-
* @property {Function} start - Start the Vizzly server
|
|
38
|
-
* @property {Function} stop - Stop the Vizzly server
|
|
39
|
-
* @property {Function} screenshot - Capture a screenshot
|
|
40
|
-
* @property {Function} upload - Upload screenshots to Vizzly
|
|
41
|
-
* @property {Function} compare - Run local comparison (TDD mode)
|
|
42
|
-
* @property {Function} getConfig - Get current configuration
|
|
43
|
-
* @property {Function} on - Subscribe to events
|
|
44
|
-
* @property {Function} off - Unsubscribe from events
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* VizzlySDK class implementation
|
|
48
|
-
* @class
|
|
49
|
-
* @extends {EventEmitter}
|
|
50
|
-
*/
|
|
51
|
-
export class VizzlySDK {
|
|
52
|
-
/**
|
|
53
|
-
* @param {import('../types').VizzlyConfig} config - Configuration
|
|
54
|
-
* @param {Object} services - Service instances
|
|
55
|
-
*/
|
|
56
|
-
constructor(config: any, services: any);
|
|
57
|
-
config: any;
|
|
58
|
-
services: any;
|
|
59
|
-
server: ScreenshotServer;
|
|
60
|
-
currentBuildId: any;
|
|
61
|
-
/**
|
|
62
|
-
* Stop the Vizzly server
|
|
63
|
-
* @returns {Promise<void>}
|
|
64
|
-
*/
|
|
65
|
-
stop(): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Get current configuration
|
|
68
|
-
* @returns {Object} Current config
|
|
69
|
-
*/
|
|
70
|
-
getConfig(): any;
|
|
71
|
-
/**
|
|
72
|
-
* Start the Vizzly server
|
|
73
|
-
* @returns {Promise<{port: number, url: string}>} Server information
|
|
74
|
-
*/
|
|
75
|
-
start(): Promise<{
|
|
76
|
-
port: number;
|
|
77
|
-
url: string;
|
|
78
|
-
}>;
|
|
79
|
-
/**
|
|
80
|
-
* Capture a screenshot
|
|
81
|
-
* @param {string} name - Screenshot name
|
|
82
|
-
* @param {Buffer|string} imageBuffer - Image data as a Buffer, or a file path to an image
|
|
83
|
-
* @param {import('../types').ScreenshotOptions} [options] - Options
|
|
84
|
-
* @returns {Promise<void>}
|
|
85
|
-
* @throws {VizzlyError} When server is not running
|
|
86
|
-
* @throws {VizzlyError} When file path is provided but file doesn't exist
|
|
87
|
-
* @throws {VizzlyError} When file cannot be read due to permissions or I/O errors
|
|
88
|
-
*/
|
|
89
|
-
screenshot(name: string, imageBuffer: Buffer | string, options?: any): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Upload all captured screenshots
|
|
92
|
-
* @param {import('../types').UploadOptions} [options] - Upload options
|
|
93
|
-
* @returns {Promise<import('../types').UploadResult>} Upload result
|
|
94
|
-
*/
|
|
95
|
-
upload(options?: any): Promise<any>;
|
|
96
|
-
/**
|
|
97
|
-
* Run local comparison in TDD mode
|
|
98
|
-
* @param {string} name - Screenshot name
|
|
99
|
-
* @param {Buffer|string} imageBuffer - Current image as a Buffer, or a file path to an image
|
|
100
|
-
* @returns {Promise<import('../types').ComparisonResult>} Comparison result
|
|
101
|
-
* @throws {VizzlyError} When file path is provided but file doesn't exist
|
|
102
|
-
* @throws {VizzlyError} When file cannot be read due to permissions or I/O errors
|
|
103
|
-
*/
|
|
104
|
-
compare(name: string, imageBuffer: Buffer | string): Promise<any>;
|
|
105
|
-
}
|
|
106
|
-
export { loadConfig } from "../utils/config-loader.js";
|
|
107
|
-
export * as output from "../utils/output.js";
|
|
108
|
-
export { createUploader } from "../services/uploader.js";
|
|
109
|
-
export { createTDDService } from "../services/tdd-service.js";
|
|
110
|
-
import { ScreenshotServer } from '../services/screenshot-server.js';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export function createApiHandler(apiService: any): {
|
|
2
|
-
handleScreenshot: (buildId: any, name: any, image: any, properties?: {}) => Promise<{
|
|
3
|
-
statusCode: number;
|
|
4
|
-
body: {
|
|
5
|
-
success: boolean;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
count: number;
|
|
8
|
-
message: string;
|
|
9
|
-
error?: undefined;
|
|
10
|
-
originalPath?: undefined;
|
|
11
|
-
filePath?: undefined;
|
|
12
|
-
receivedType?: undefined;
|
|
13
|
-
name?: undefined;
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
statusCode: number;
|
|
17
|
-
body: {
|
|
18
|
-
error: string;
|
|
19
|
-
success?: undefined;
|
|
20
|
-
disabled?: undefined;
|
|
21
|
-
count?: undefined;
|
|
22
|
-
message?: undefined;
|
|
23
|
-
originalPath?: undefined;
|
|
24
|
-
filePath?: undefined;
|
|
25
|
-
receivedType?: undefined;
|
|
26
|
-
name?: undefined;
|
|
27
|
-
};
|
|
28
|
-
} | {
|
|
29
|
-
statusCode: number;
|
|
30
|
-
body: {
|
|
31
|
-
error: string;
|
|
32
|
-
originalPath: any;
|
|
33
|
-
success?: undefined;
|
|
34
|
-
disabled?: undefined;
|
|
35
|
-
count?: undefined;
|
|
36
|
-
message?: undefined;
|
|
37
|
-
filePath?: undefined;
|
|
38
|
-
receivedType?: undefined;
|
|
39
|
-
name?: undefined;
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
|
-
statusCode: number;
|
|
43
|
-
body: {
|
|
44
|
-
error: string;
|
|
45
|
-
filePath: any;
|
|
46
|
-
success?: undefined;
|
|
47
|
-
disabled?: undefined;
|
|
48
|
-
count?: undefined;
|
|
49
|
-
message?: undefined;
|
|
50
|
-
originalPath?: undefined;
|
|
51
|
-
receivedType?: undefined;
|
|
52
|
-
name?: undefined;
|
|
53
|
-
};
|
|
54
|
-
} | {
|
|
55
|
-
statusCode: number;
|
|
56
|
-
body: {
|
|
57
|
-
error: string;
|
|
58
|
-
receivedType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
59
|
-
success?: undefined;
|
|
60
|
-
disabled?: undefined;
|
|
61
|
-
count?: undefined;
|
|
62
|
-
message?: undefined;
|
|
63
|
-
originalPath?: undefined;
|
|
64
|
-
filePath?: undefined;
|
|
65
|
-
name?: undefined;
|
|
66
|
-
};
|
|
67
|
-
} | {
|
|
68
|
-
statusCode: number;
|
|
69
|
-
body: {
|
|
70
|
-
success: boolean;
|
|
71
|
-
name: any;
|
|
72
|
-
count: number;
|
|
73
|
-
disabled?: undefined;
|
|
74
|
-
message?: undefined;
|
|
75
|
-
error?: undefined;
|
|
76
|
-
originalPath?: undefined;
|
|
77
|
-
filePath?: undefined;
|
|
78
|
-
receivedType?: undefined;
|
|
79
|
-
};
|
|
80
|
-
}>;
|
|
81
|
-
getScreenshotCount: () => number;
|
|
82
|
-
flush: () => Promise<{
|
|
83
|
-
uploaded: number;
|
|
84
|
-
failed: number;
|
|
85
|
-
total: number;
|
|
86
|
-
}>;
|
|
87
|
-
cleanup: () => void;
|
|
88
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
export function createTddHandler(config: any, workingDir: any, baselineBuild: any, baselineComparison: any, setBaseline?: boolean): {
|
|
2
|
-
initialize: () => Promise<void>;
|
|
3
|
-
handleScreenshot: (buildId: any, name: any, image: any, properties?: {}) => Promise<{
|
|
4
|
-
statusCode: number;
|
|
5
|
-
body: {
|
|
6
|
-
error: string;
|
|
7
|
-
details: any;
|
|
8
|
-
tddMode: boolean;
|
|
9
|
-
originalPath?: undefined;
|
|
10
|
-
filePath?: undefined;
|
|
11
|
-
receivedType?: undefined;
|
|
12
|
-
comparison?: undefined;
|
|
13
|
-
status?: undefined;
|
|
14
|
-
message?: undefined;
|
|
15
|
-
success?: undefined;
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
statusCode: number;
|
|
19
|
-
body: {
|
|
20
|
-
error: string;
|
|
21
|
-
originalPath: any;
|
|
22
|
-
tddMode: boolean;
|
|
23
|
-
details?: undefined;
|
|
24
|
-
filePath?: undefined;
|
|
25
|
-
receivedType?: undefined;
|
|
26
|
-
comparison?: undefined;
|
|
27
|
-
status?: undefined;
|
|
28
|
-
message?: undefined;
|
|
29
|
-
success?: undefined;
|
|
30
|
-
};
|
|
31
|
-
} | {
|
|
32
|
-
statusCode: number;
|
|
33
|
-
body: {
|
|
34
|
-
error: string;
|
|
35
|
-
filePath: any;
|
|
36
|
-
tddMode: boolean;
|
|
37
|
-
details?: undefined;
|
|
38
|
-
originalPath?: undefined;
|
|
39
|
-
receivedType?: undefined;
|
|
40
|
-
comparison?: undefined;
|
|
41
|
-
status?: undefined;
|
|
42
|
-
message?: undefined;
|
|
43
|
-
success?: undefined;
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
statusCode: number;
|
|
47
|
-
body: {
|
|
48
|
-
error: string;
|
|
49
|
-
tddMode: boolean;
|
|
50
|
-
details?: undefined;
|
|
51
|
-
originalPath?: undefined;
|
|
52
|
-
filePath?: undefined;
|
|
53
|
-
receivedType?: undefined;
|
|
54
|
-
comparison?: undefined;
|
|
55
|
-
status?: undefined;
|
|
56
|
-
message?: undefined;
|
|
57
|
-
success?: undefined;
|
|
58
|
-
};
|
|
59
|
-
} | {
|
|
60
|
-
statusCode: number;
|
|
61
|
-
body: {
|
|
62
|
-
error: string;
|
|
63
|
-
receivedType: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
64
|
-
tddMode: boolean;
|
|
65
|
-
details?: undefined;
|
|
66
|
-
originalPath?: undefined;
|
|
67
|
-
filePath?: undefined;
|
|
68
|
-
comparison?: undefined;
|
|
69
|
-
status?: undefined;
|
|
70
|
-
message?: undefined;
|
|
71
|
-
success?: undefined;
|
|
72
|
-
};
|
|
73
|
-
} | {
|
|
74
|
-
statusCode: number;
|
|
75
|
-
body: {
|
|
76
|
-
error: string;
|
|
77
|
-
details: string;
|
|
78
|
-
comparison: {
|
|
79
|
-
name: any;
|
|
80
|
-
status: string;
|
|
81
|
-
baseline: any;
|
|
82
|
-
current: any;
|
|
83
|
-
diff: any;
|
|
84
|
-
diffPercentage: any;
|
|
85
|
-
threshold: any;
|
|
86
|
-
};
|
|
87
|
-
tddMode: boolean;
|
|
88
|
-
originalPath?: undefined;
|
|
89
|
-
filePath?: undefined;
|
|
90
|
-
receivedType?: undefined;
|
|
91
|
-
status?: undefined;
|
|
92
|
-
message?: undefined;
|
|
93
|
-
success?: undefined;
|
|
94
|
-
};
|
|
95
|
-
} | {
|
|
96
|
-
statusCode: number;
|
|
97
|
-
body: {
|
|
98
|
-
status: string;
|
|
99
|
-
message: string;
|
|
100
|
-
comparison: {
|
|
101
|
-
name: any;
|
|
102
|
-
status: string;
|
|
103
|
-
baseline: any;
|
|
104
|
-
current: any;
|
|
105
|
-
diff?: undefined;
|
|
106
|
-
diffPercentage?: undefined;
|
|
107
|
-
threshold?: undefined;
|
|
108
|
-
};
|
|
109
|
-
tddMode: boolean;
|
|
110
|
-
error?: undefined;
|
|
111
|
-
details?: undefined;
|
|
112
|
-
originalPath?: undefined;
|
|
113
|
-
filePath?: undefined;
|
|
114
|
-
receivedType?: undefined;
|
|
115
|
-
success?: undefined;
|
|
116
|
-
};
|
|
117
|
-
} | {
|
|
118
|
-
statusCode: number;
|
|
119
|
-
body: {
|
|
120
|
-
success: boolean;
|
|
121
|
-
comparison: {
|
|
122
|
-
name: any;
|
|
123
|
-
status: string;
|
|
124
|
-
baseline?: undefined;
|
|
125
|
-
current?: undefined;
|
|
126
|
-
diff?: undefined;
|
|
127
|
-
diffPercentage?: undefined;
|
|
128
|
-
threshold?: undefined;
|
|
129
|
-
};
|
|
130
|
-
tddMode: boolean;
|
|
131
|
-
error?: undefined;
|
|
132
|
-
details?: undefined;
|
|
133
|
-
originalPath?: undefined;
|
|
134
|
-
filePath?: undefined;
|
|
135
|
-
receivedType?: undefined;
|
|
136
|
-
status?: undefined;
|
|
137
|
-
message?: undefined;
|
|
138
|
-
};
|
|
139
|
-
}>;
|
|
140
|
-
getResults: () => Promise<{
|
|
141
|
-
total: number;
|
|
142
|
-
passed: number;
|
|
143
|
-
failed: number;
|
|
144
|
-
new: number;
|
|
145
|
-
errors: number;
|
|
146
|
-
comparisons: any[];
|
|
147
|
-
baseline: any;
|
|
148
|
-
}>;
|
|
149
|
-
acceptBaseline: (comparisonId: any) => Promise<any>;
|
|
150
|
-
acceptAllBaselines: () => Promise<{
|
|
151
|
-
count: number;
|
|
152
|
-
}>;
|
|
153
|
-
resetBaselines: () => Promise<{
|
|
154
|
-
success: boolean;
|
|
155
|
-
deletedBaselines: number;
|
|
156
|
-
deletedCurrents: number;
|
|
157
|
-
deletedDiffs: number;
|
|
158
|
-
}>;
|
|
159
|
-
cleanup: () => void;
|
|
160
|
-
tddService: TddService;
|
|
161
|
-
};
|
|
162
|
-
import { TddService } from '../../services/tdd-service.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CORS Middleware
|
|
3
|
-
* Handles cross-origin requests and preflight OPTIONS
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Apply CORS headers and handle OPTIONS preflight
|
|
7
|
-
* @param {http.IncomingMessage} req
|
|
8
|
-
* @param {http.ServerResponse} res
|
|
9
|
-
* @returns {boolean} True if request was handled (OPTIONS), false to continue
|
|
10
|
-
*/
|
|
11
|
-
export function corsMiddleware(req: http.IncomingMessage, res: http.ServerResponse): boolean;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSON Body Parser Middleware
|
|
3
|
-
* Parses JSON request bodies for POST requests
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Parse JSON body from request
|
|
7
|
-
* @param {http.IncomingMessage} req
|
|
8
|
-
* @returns {Promise<Object|null>} Parsed JSON body or null for non-POST
|
|
9
|
-
*/
|
|
10
|
-
export function parseJsonBody(req: http.IncomingMessage): Promise<any | null>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Response Helpers
|
|
3
|
-
* Standardized response utilities for consistent API responses
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Send JSON response
|
|
7
|
-
* @param {http.ServerResponse} res
|
|
8
|
-
* @param {number} statusCode
|
|
9
|
-
* @param {Object} data
|
|
10
|
-
*/
|
|
11
|
-
export function sendJson(res: http.ServerResponse, statusCode: number, data: any): void;
|
|
12
|
-
/**
|
|
13
|
-
* Send success response
|
|
14
|
-
* @param {http.ServerResponse} res
|
|
15
|
-
* @param {Object} data
|
|
16
|
-
*/
|
|
17
|
-
export function sendSuccess(res: http.ServerResponse, data?: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* Send error response
|
|
20
|
-
* @param {http.ServerResponse} res
|
|
21
|
-
* @param {number} statusCode
|
|
22
|
-
* @param {string} message
|
|
23
|
-
*/
|
|
24
|
-
export function sendError(res: http.ServerResponse, statusCode: number, message: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* Send 404 Not Found
|
|
27
|
-
* @param {http.ServerResponse} res
|
|
28
|
-
* @param {string} message
|
|
29
|
-
*/
|
|
30
|
-
export function sendNotFound(res: http.ServerResponse, message?: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Send 503 Service Unavailable
|
|
33
|
-
* @param {http.ServerResponse} res
|
|
34
|
-
* @param {string} serviceName
|
|
35
|
-
*/
|
|
36
|
-
export function sendServiceUnavailable(res: http.ServerResponse, serviceName: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Send HTML response
|
|
39
|
-
* @param {http.ServerResponse} res
|
|
40
|
-
* @param {number} statusCode
|
|
41
|
-
* @param {string} html
|
|
42
|
-
*/
|
|
43
|
-
export function sendHtml(res: http.ServerResponse, statusCode: number, html: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Send file response with specified content type
|
|
46
|
-
* @param {http.ServerResponse} res
|
|
47
|
-
* @param {Buffer|string} content
|
|
48
|
-
* @param {string} contentType
|
|
49
|
-
*/
|
|
50
|
-
export function sendFile(res: http.ServerResponse, content: Buffer | string, contentType: string): void;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create baseline router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {Object} context.screenshotHandler - Screenshot handler
|
|
5
|
-
* @param {Object} context.tddService - TDD service for baseline downloads
|
|
6
|
-
* @param {Object} context.authService - Auth service for OAuth requests
|
|
7
|
-
* @returns {Function} Route handler
|
|
8
|
-
*/
|
|
9
|
-
export function createBaselineRouter({ screenshotHandler, tddService, authService, }: {
|
|
10
|
-
screenshotHandler: any;
|
|
11
|
-
tddService: any;
|
|
12
|
-
authService: any;
|
|
13
|
-
}): Function;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create cloud proxy router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {Object} context.authService - Auth service for token management
|
|
5
|
-
* @param {string} context.apiUrl - Base API URL (default: https://app.vizzly.dev)
|
|
6
|
-
* @returns {Function} Route handler
|
|
7
|
-
*/
|
|
8
|
-
export function createCloudProxyRouter({ authService, apiUrl: _apiUrl, }: {
|
|
9
|
-
authService: any;
|
|
10
|
-
apiUrl: string;
|
|
11
|
-
}): Function;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create config router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {Object} context.configService - Config service
|
|
5
|
-
* @returns {Function} Route handler
|
|
6
|
-
*/
|
|
7
|
-
export function createConfigRouter({ configService }: {
|
|
8
|
-
configService: any;
|
|
9
|
-
}): Function;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create health router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {number} context.port - Server port
|
|
5
|
-
* @param {Object} context.screenshotHandler - Screenshot handler
|
|
6
|
-
* @returns {Function} Route handler
|
|
7
|
-
*/
|
|
8
|
-
export function createHealthRouter({ port, screenshotHandler }: {
|
|
9
|
-
port: number;
|
|
10
|
-
screenshotHandler: any;
|
|
11
|
-
}): Function;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create projects router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {Object} context.projectService - Project service
|
|
5
|
-
* @returns {Function} Route handler
|
|
6
|
-
*/
|
|
7
|
-
export function createProjectsRouter({ projectService }: {
|
|
8
|
-
projectService: any;
|
|
9
|
-
}): Function;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create screenshot router
|
|
3
|
-
* @param {Object} context - Router context
|
|
4
|
-
* @param {Object} context.screenshotHandler - Screenshot handler
|
|
5
|
-
* @param {string|null} context.defaultBuildId - Default build ID
|
|
6
|
-
* @returns {Function} Route handler
|
|
7
|
-
*/
|
|
8
|
-
export function createScreenshotRouter({ screenshotHandler, defaultBuildId }: {
|
|
9
|
-
screenshotHandler: any;
|
|
10
|
-
defaultBuildId: string | null;
|
|
11
|
-
}): Function;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ApiService class for direct API communication
|
|
3
|
-
*/
|
|
4
|
-
export class ApiService {
|
|
5
|
-
constructor(options?: {});
|
|
6
|
-
baseUrl: any;
|
|
7
|
-
token: any;
|
|
8
|
-
uploadAll: any;
|
|
9
|
-
userAgent: string;
|
|
10
|
-
/**
|
|
11
|
-
* Make an API request
|
|
12
|
-
* @param {string} endpoint - API endpoint
|
|
13
|
-
* @param {Object} options - Fetch options
|
|
14
|
-
* @param {boolean} isRetry - Internal flag to prevent infinite retry loops
|
|
15
|
-
* @returns {Promise<Object>} Response data
|
|
16
|
-
*/
|
|
17
|
-
request(endpoint: string, options?: any, isRetry?: boolean): Promise<any>;
|
|
18
|
-
/**
|
|
19
|
-
* Get build information
|
|
20
|
-
* @param {string} buildId - Build ID
|
|
21
|
-
* @param {string} include - Optional include parameter (e.g., 'screenshots')
|
|
22
|
-
* @returns {Promise<Object>} Build data
|
|
23
|
-
*/
|
|
24
|
-
getBuild(buildId: string, include?: string): Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
* Get comparison information
|
|
27
|
-
* @param {string} comparisonId - Comparison ID
|
|
28
|
-
* @returns {Promise<Object>} Comparison data
|
|
29
|
-
*/
|
|
30
|
-
getComparison(comparisonId: string): Promise<any>;
|
|
31
|
-
/**
|
|
32
|
-
* Search for comparisons by name across builds
|
|
33
|
-
* @param {string} name - Screenshot name to search for
|
|
34
|
-
* @param {Object} filters - Optional filters (branch, limit, offset)
|
|
35
|
-
* @param {string} [filters.branch] - Filter by branch name
|
|
36
|
-
* @param {number} [filters.limit=50] - Maximum number of results (default: 50)
|
|
37
|
-
* @param {number} [filters.offset=0] - Pagination offset (default: 0)
|
|
38
|
-
* @returns {Promise<Object>} Search results with comparisons and pagination
|
|
39
|
-
*/
|
|
40
|
-
searchComparisons(name: string, filters?: {
|
|
41
|
-
branch?: string;
|
|
42
|
-
limit?: number;
|
|
43
|
-
offset?: number;
|
|
44
|
-
}): Promise<any>;
|
|
45
|
-
/**
|
|
46
|
-
* Get builds for a project
|
|
47
|
-
* @param {Object} filters - Filter options
|
|
48
|
-
* @returns {Promise<Array>} List of builds
|
|
49
|
-
*/
|
|
50
|
-
getBuilds(filters?: any): Promise<any[]>;
|
|
51
|
-
/**
|
|
52
|
-
* Create a new build
|
|
53
|
-
* @param {Object} metadata - Build metadata
|
|
54
|
-
* @returns {Promise<Object>} Created build data
|
|
55
|
-
*/
|
|
56
|
-
createBuild(metadata: any): Promise<any>;
|
|
57
|
-
/**
|
|
58
|
-
* Check if SHAs already exist on the server
|
|
59
|
-
* @param {string[]|Object[]} shas - Array of SHA256 hashes to check, or array of screenshot objects with metadata
|
|
60
|
-
* @param {string} buildId - Build ID for screenshot record creation
|
|
61
|
-
* @returns {Promise<Object>} Response with existing SHAs and screenshot data
|
|
62
|
-
*/
|
|
63
|
-
checkShas(shas: string[] | any[], buildId: string): Promise<any>;
|
|
64
|
-
/**
|
|
65
|
-
* Upload a screenshot with SHA checking
|
|
66
|
-
* @param {string} buildId - Build ID
|
|
67
|
-
* @param {string} name - Screenshot name
|
|
68
|
-
* @param {Buffer} buffer - Screenshot data
|
|
69
|
-
* @param {Object} metadata - Additional metadata
|
|
70
|
-
* @returns {Promise<Object>} Upload result
|
|
71
|
-
*/
|
|
72
|
-
uploadScreenshot(buildId: string, name: string, buffer: Buffer, metadata?: any): Promise<any>;
|
|
73
|
-
/**
|
|
74
|
-
* Update build status
|
|
75
|
-
* @param {string} buildId - Build ID
|
|
76
|
-
* @param {string} status - Build status (pending|running|completed|failed)
|
|
77
|
-
* @param {number} executionTimeMs - Execution time in milliseconds
|
|
78
|
-
* @returns {Promise<Object>} Updated build data
|
|
79
|
-
*/
|
|
80
|
-
updateBuildStatus(buildId: string, status: string, executionTimeMs?: number): Promise<any>;
|
|
81
|
-
/**
|
|
82
|
-
* Finalize a build (convenience method)
|
|
83
|
-
* @param {string} buildId - Build ID
|
|
84
|
-
* @param {boolean} success - Whether the build succeeded
|
|
85
|
-
* @param {number} executionTimeMs - Execution time in milliseconds
|
|
86
|
-
* @returns {Promise<Object>} Finalized build data
|
|
87
|
-
*/
|
|
88
|
-
finalizeBuild(buildId: string, success?: boolean, executionTimeMs?: number): Promise<any>;
|
|
89
|
-
/**
|
|
90
|
-
* Get token context (organization and project info)
|
|
91
|
-
* @returns {Promise<Object>} Token context data
|
|
92
|
-
*/
|
|
93
|
-
getTokenContext(): Promise<any>;
|
|
94
|
-
/**
|
|
95
|
-
* Finalize a parallel build
|
|
96
|
-
* @param {string} parallelId - Parallel ID to finalize
|
|
97
|
-
* @returns {Promise<Object>} Finalization result
|
|
98
|
-
*/
|
|
99
|
-
finalizeParallelBuild(parallelId: string): Promise<any>;
|
|
100
|
-
}
|