@vizzly-testing/cli 0.14.0 → 0.15.0
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/cli.js +68 -68
- package/dist/commands/doctor.js +30 -34
- package/dist/commands/finalize.js +24 -23
- package/dist/commands/init.js +30 -28
- package/dist/commands/login.js +49 -55
- package/dist/commands/logout.js +14 -19
- package/dist/commands/project.js +83 -103
- package/dist/commands/run.js +77 -89
- package/dist/commands/status.js +48 -49
- package/dist/commands/tdd-daemon.js +90 -86
- package/dist/commands/tdd.js +59 -88
- package/dist/commands/upload.js +57 -57
- package/dist/commands/whoami.js +40 -45
- package/dist/index.js +2 -5
- package/dist/plugin-loader.js +15 -17
- package/dist/reporter/reporter-bundle.css +1 -1
- package/dist/reporter/reporter-bundle.iife.js +74 -41
- package/dist/sdk/index.js +36 -45
- package/dist/server/handlers/api-handler.js +14 -15
- package/dist/server/handlers/tdd-handler.js +34 -37
- package/dist/server/http-server.js +75 -869
- package/dist/server/middleware/cors.js +22 -0
- package/dist/server/middleware/json-parser.js +35 -0
- package/dist/server/middleware/response.js +79 -0
- package/dist/server/routers/assets.js +91 -0
- package/dist/server/routers/auth.js +144 -0
- package/dist/server/routers/baseline.js +163 -0
- package/dist/server/routers/cloud-proxy.js +146 -0
- package/dist/server/routers/config.js +126 -0
- package/dist/server/routers/dashboard.js +130 -0
- package/dist/server/routers/health.js +61 -0
- package/dist/server/routers/projects.js +168 -0
- package/dist/server/routers/screenshot.js +86 -0
- package/dist/services/auth-service.js +1 -1
- package/dist/services/build-manager.js +13 -40
- package/dist/services/config-service.js +2 -4
- package/dist/services/html-report-generator.js +6 -5
- package/dist/services/index.js +64 -0
- package/dist/services/project-service.js +121 -40
- package/dist/services/screenshot-server.js +9 -9
- package/dist/services/server-manager.js +11 -18
- package/dist/services/static-report-generator.js +3 -4
- package/dist/services/tdd-service.js +246 -103
- package/dist/services/test-runner.js +24 -25
- package/dist/services/uploader.js +5 -4
- package/dist/types/commands/init.d.ts +1 -2
- package/dist/types/index.d.ts +2 -3
- package/dist/types/plugin-loader.d.ts +1 -2
- package/dist/types/reporter/src/api/client.d.ts +178 -0
- package/dist/types/reporter/src/components/app-router.d.ts +1 -3
- package/dist/types/reporter/src/components/code-block.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/onion-skin-mode.d.ts +10 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/overlay-mode.d.ts +11 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/base-comparison-mode.d.ts +14 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/shared/image-renderer.d.ts +30 -0
- package/dist/types/reporter/src/components/comparison/comparison-modes/toggle-view.d.ts +8 -0
- package/dist/types/reporter/src/components/comparison/comparison-viewer.d.ts +4 -0
- package/dist/types/reporter/src/components/comparison/screenshot-display.d.ts +16 -0
- package/dist/types/reporter/src/components/design-system/alert.d.ts +9 -0
- package/dist/types/reporter/src/components/design-system/badge.d.ts +17 -0
- package/dist/types/reporter/src/components/design-system/button.d.ts +19 -0
- package/dist/types/reporter/src/components/design-system/card.d.ts +31 -0
- package/dist/types/reporter/src/components/design-system/empty-state.d.ts +13 -0
- package/dist/types/reporter/src/components/design-system/form-controls.d.ts +44 -0
- package/dist/types/reporter/src/components/design-system/health-ring.d.ts +7 -0
- package/dist/types/reporter/src/components/design-system/index.d.ts +11 -0
- package/dist/types/reporter/src/components/design-system/modal.d.ts +10 -0
- package/dist/types/reporter/src/components/design-system/skeleton.d.ts +19 -0
- package/dist/types/reporter/src/components/design-system/spinner.d.ts +10 -0
- package/dist/types/reporter/src/components/design-system/tabs.d.ts +13 -0
- package/dist/types/reporter/src/components/layout/header.d.ts +5 -0
- package/dist/types/reporter/src/components/layout/index.d.ts +2 -0
- package/dist/types/reporter/src/components/layout/layout.d.ts +6 -0
- package/dist/types/reporter/src/components/views/builds-view.d.ts +1 -0
- package/dist/types/reporter/src/components/views/comparison-detail-view.d.ts +1 -4
- package/dist/types/reporter/src/components/views/comparisons-view.d.ts +1 -6
- package/dist/types/reporter/src/components/views/stats-view.d.ts +1 -6
- package/dist/types/reporter/src/components/waiting-for-screenshots.d.ts +1 -0
- package/dist/types/reporter/src/hooks/queries/use-auth-queries.d.ts +15 -0
- package/dist/types/reporter/src/hooks/queries/use-cloud-queries.d.ts +6 -0
- package/dist/types/reporter/src/hooks/queries/use-config-queries.d.ts +6 -0
- package/dist/types/reporter/src/hooks/queries/use-tdd-queries.d.ts +9 -0
- package/dist/types/reporter/src/lib/query-client.d.ts +2 -0
- package/dist/types/reporter/src/lib/query-keys.d.ts +13 -0
- package/dist/types/sdk/index.d.ts +2 -4
- package/dist/types/server/handlers/tdd-handler.d.ts +2 -0
- package/dist/types/server/http-server.d.ts +1 -1
- package/dist/types/server/middleware/cors.d.ts +11 -0
- package/dist/types/server/middleware/json-parser.d.ts +10 -0
- package/dist/types/server/middleware/response.d.ts +50 -0
- package/dist/types/server/routers/assets.d.ts +6 -0
- package/dist/types/server/routers/auth.d.ts +9 -0
- package/dist/types/server/routers/baseline.d.ts +13 -0
- package/dist/types/server/routers/cloud-proxy.d.ts +11 -0
- package/dist/types/server/routers/config.d.ts +9 -0
- package/dist/types/server/routers/dashboard.d.ts +6 -0
- package/dist/types/server/routers/health.d.ts +11 -0
- package/dist/types/server/routers/projects.d.ts +9 -0
- package/dist/types/server/routers/screenshot.d.ts +11 -0
- package/dist/types/services/build-manager.d.ts +4 -3
- package/dist/types/services/config-service.d.ts +2 -3
- package/dist/types/services/index.d.ts +7 -0
- package/dist/types/services/project-service.d.ts +6 -4
- package/dist/types/services/screenshot-server.d.ts +5 -5
- package/dist/types/services/server-manager.d.ts +5 -3
- package/dist/types/services/tdd-service.d.ts +12 -1
- package/dist/types/services/test-runner.d.ts +3 -3
- package/dist/types/utils/output.d.ts +84 -0
- package/dist/utils/config-loader.js +24 -48
- package/dist/utils/global-config.js +2 -17
- package/dist/utils/output.js +445 -0
- package/dist/utils/security.js +3 -4
- package/docs/api-reference.md +0 -1
- package/docs/plugins.md +22 -22
- package/package.json +3 -2
- package/dist/container/index.js +0 -215
- package/dist/services/base-service.js +0 -154
- package/dist/types/container/index.d.ts +0 -59
- package/dist/types/reporter/src/components/comparison/viewer-modes/onion-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/overlay-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/side-by-side-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/comparison/viewer-modes/toggle-viewer.d.ts +0 -3
- package/dist/types/reporter/src/components/dashboard/dashboard-header.d.ts +0 -5
- package/dist/types/reporter/src/components/dashboard/dashboard-stats.d.ts +0 -4
- package/dist/types/reporter/src/components/dashboard/empty-state.d.ts +0 -8
- package/dist/types/reporter/src/components/ui/form-field.d.ts +0 -16
- package/dist/types/reporter/src/components/ui/status-badge.d.ts +0 -5
- package/dist/types/reporter/src/hooks/use-auth.d.ts +0 -10
- package/dist/types/reporter/src/hooks/use-baseline-actions.d.ts +0 -5
- package/dist/types/reporter/src/hooks/use-config.d.ts +0 -9
- package/dist/types/reporter/src/hooks/use-projects.d.ts +0 -10
- package/dist/types/reporter/src/hooks/use-report-data.d.ts +0 -7
- package/dist/types/reporter/src/hooks/use-vizzly-api.d.ts +0 -9
- package/dist/types/services/base-service.d.ts +0 -71
- package/dist/types/utils/console-ui.d.ts +0 -61
- package/dist/types/utils/logger-factory.d.ts +0 -26
- package/dist/types/utils/logger.d.ts +0 -79
- package/dist/utils/console-ui.js +0 -241
- package/dist/utils/logger-factory.js +0 -76
- package/dist/utils/logger.js +0 -231
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function Modal({ isOpen, onClose, title, description, children, size, showCloseButton, className, }: {
|
|
2
|
+
isOpen: any;
|
|
3
|
+
onClose: any;
|
|
4
|
+
title: any;
|
|
5
|
+
description: any;
|
|
6
|
+
children: any;
|
|
7
|
+
size?: string;
|
|
8
|
+
showCloseButton?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton Components
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* Loading placeholder animations
|
|
6
|
+
*/
|
|
7
|
+
export function Skeleton({ variant, className, count }: {
|
|
8
|
+
variant?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
count?: number;
|
|
11
|
+
}): any;
|
|
12
|
+
export function SkeletonCard({ className }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): any;
|
|
15
|
+
export function SkeletonTable({ rows, columns, className }: {
|
|
16
|
+
rows?: number;
|
|
17
|
+
columns?: number;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tabs Component
|
|
3
|
+
* Observatory Design System
|
|
4
|
+
*
|
|
5
|
+
* Variants: default, pills, underline
|
|
6
|
+
*/
|
|
7
|
+
export function Tabs({ tabs, activeTab, onChange, variant, className, }: {
|
|
8
|
+
tabs?: any[];
|
|
9
|
+
activeTab: any;
|
|
10
|
+
onChange: any;
|
|
11
|
+
variant?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BuildsView(): any;
|
|
@@ -2,7 +2,4 @@
|
|
|
2
2
|
* Route-driven comparison detail view
|
|
3
3
|
* The route parameter :id determines which comparison to show
|
|
4
4
|
*/
|
|
5
|
-
export default function ComparisonDetailView(
|
|
6
|
-
reportData: any;
|
|
7
|
-
setReportData: any;
|
|
8
|
-
}): any;
|
|
5
|
+
export default function ComparisonDetailView(): any;
|
|
@@ -2,9 +2,4 @@
|
|
|
2
2
|
* Comparisons list view - displays all screenshots
|
|
3
3
|
* Clicking a screenshot navigates to /comparison/:id
|
|
4
4
|
*/
|
|
5
|
-
export default function ComparisonsView(
|
|
6
|
-
reportData: any;
|
|
7
|
-
setReportData: any;
|
|
8
|
-
onRefresh: any;
|
|
9
|
-
loading: any;
|
|
10
|
-
}): any;
|
|
5
|
+
export default function ComparisonsView(): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function WaitingForScreenshots(): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function useAuthStatus(): import("@tanstack/react-query").UseQueryResult<{
|
|
2
|
+
authenticated: boolean;
|
|
3
|
+
user: any | null;
|
|
4
|
+
}, Error>;
|
|
5
|
+
export function useInitiateLogin(): import("@tanstack/react-query").UseMutationResult<{
|
|
6
|
+
deviceCode: string;
|
|
7
|
+
userCode: string;
|
|
8
|
+
verificationUri: string;
|
|
9
|
+
expiresIn: number;
|
|
10
|
+
}, Error, void, unknown>;
|
|
11
|
+
export function usePollAuthorization(): import("@tanstack/react-query").UseMutationResult<{
|
|
12
|
+
status: "pending" | "complete";
|
|
13
|
+
user?: any;
|
|
14
|
+
}, Error, void, unknown>;
|
|
15
|
+
export function useLogout(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function useProjects(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
2
|
+
export function useBuilds(orgSlug: any, projectSlug: any, options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
3
|
+
export function useDownloadBaselines(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
4
|
+
export function useProjectMappings(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
5
|
+
export function useCreateProjectMapping(): import("@tanstack/react-query").UseMutationResult<any, Error, any, unknown>;
|
|
6
|
+
export function useDeleteProjectMapping(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function useConfig(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
2
|
+
export function useProjectConfig(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
3
|
+
export function useGlobalConfig(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
4
|
+
export function useUpdateProjectConfig(): import("@tanstack/react-query").UseMutationResult<any, Error, any, unknown>;
|
|
5
|
+
export function useUpdateGlobalConfig(): import("@tanstack/react-query").UseMutationResult<any, Error, any, unknown>;
|
|
6
|
+
export function useValidateConfig(): import("@tanstack/react-query").UseMutationResult<any, Error, any, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function useReportData(options?: {}): import("@tanstack/react-query").DefinedUseQueryResult<any, Error>;
|
|
2
|
+
export function useTddStatus(options?: {}): import("@tanstack/react-query").UseQueryResult<any, Error>;
|
|
3
|
+
export function useAcceptBaseline(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
4
|
+
export function useAcceptAllBaselines(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
5
|
+
export function useResetBaselines(): import("@tanstack/react-query").UseMutationResult<any, Error, void, unknown>;
|
|
6
|
+
export function useRejectBaseline(): import("@tanstack/react-query").UseMutationResult<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
id: void;
|
|
9
|
+
}, Error, void, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export namespace queryKeys {
|
|
2
|
+
let auth: string[];
|
|
3
|
+
function authStatus(): string[];
|
|
4
|
+
let config: string[];
|
|
5
|
+
function projectConfig(): string[];
|
|
6
|
+
function globalConfig(): string[];
|
|
7
|
+
let tdd: string[];
|
|
8
|
+
function reportData(): string[];
|
|
9
|
+
function status(): string[];
|
|
10
|
+
let cloud: string[];
|
|
11
|
+
function projects(): string[];
|
|
12
|
+
function builds(orgSlug: any, projectSlug: any): any[];
|
|
13
|
+
}
|
|
@@ -51,12 +51,10 @@ export function createVizzly(config?: any, options?: {}): Promise<VizzlySDK>;
|
|
|
51
51
|
export class VizzlySDK {
|
|
52
52
|
/**
|
|
53
53
|
* @param {import('../types').VizzlyConfig} config - Configuration
|
|
54
|
-
* @param {import('../utils/logger').Logger} logger - Logger instance
|
|
55
54
|
* @param {Object} services - Service instances
|
|
56
55
|
*/
|
|
57
|
-
constructor(config: any,
|
|
56
|
+
constructor(config: any, services: any);
|
|
58
57
|
config: any;
|
|
59
|
-
logger: import("../utils/logger.js").Logger;
|
|
60
58
|
services: any;
|
|
61
59
|
server: ScreenshotServer;
|
|
62
60
|
currentBuildId: any;
|
|
@@ -106,7 +104,7 @@ export class VizzlySDK {
|
|
|
106
104
|
compare(name: string, imageBuffer: Buffer | string): Promise<any>;
|
|
107
105
|
}
|
|
108
106
|
export { loadConfig } from "../utils/config-loader.js";
|
|
109
|
-
export
|
|
107
|
+
export * as output from "../utils/output.js";
|
|
110
108
|
export { createUploader } from "../services/uploader.js";
|
|
111
109
|
export { createTDDService } from "../services/tdd-service.js";
|
|
112
110
|
import { ScreenshotServer } from '../services/screenshot-server.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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>;
|
|
@@ -0,0 +1,50 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -45,8 +45,9 @@ export function createQueuedBuild(buildOptions: any): any;
|
|
|
45
45
|
* @returns {Object} Validation result
|
|
46
46
|
*/
|
|
47
47
|
export function validateBuildOptions(buildOptions: any): any;
|
|
48
|
-
export class BuildManager
|
|
49
|
-
constructor(config: any
|
|
48
|
+
export class BuildManager {
|
|
49
|
+
constructor(config: any);
|
|
50
|
+
config: any;
|
|
50
51
|
currentBuild: any;
|
|
51
52
|
buildQueue: any[];
|
|
52
53
|
createBuild(buildOptions: any): Promise<any>;
|
|
@@ -55,6 +56,7 @@ export class BuildManager extends BaseService {
|
|
|
55
56
|
finalizeBuild(buildId: any, result?: {}): Promise<any>;
|
|
56
57
|
getCurrentBuild(): any;
|
|
57
58
|
queueBuild(buildOptions: any): void;
|
|
59
|
+
clear(): Promise<void>;
|
|
58
60
|
processNextBuild(): Promise<any>;
|
|
59
61
|
getQueueStatus(): {
|
|
60
62
|
length: number;
|
|
@@ -65,4 +67,3 @@ export class BuildManager extends BaseService {
|
|
|
65
67
|
}[];
|
|
66
68
|
};
|
|
67
69
|
}
|
|
68
|
-
import { BaseService } from './base-service.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConfigService for reading and writing configuration
|
|
3
|
-
* @extends BaseService
|
|
4
3
|
*/
|
|
5
|
-
export class ConfigService
|
|
4
|
+
export class ConfigService {
|
|
6
5
|
constructor(config: any, options?: {});
|
|
6
|
+
config: any;
|
|
7
7
|
projectRoot: any;
|
|
8
8
|
explorer: import("cosmiconfig").PublicExplorerSync;
|
|
9
9
|
/**
|
|
@@ -95,4 +95,3 @@ export class ConfigService extends BaseService {
|
|
|
95
95
|
*/
|
|
96
96
|
private _deepMerge;
|
|
97
97
|
}
|
|
98
|
-
import { BaseService } from './base-service.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create all services with their dependencies
|
|
3
|
+
* @param {Object} config - Configuration object
|
|
4
|
+
* @param {string} [command='run'] - Command context ('run', 'tdd', 'status')
|
|
5
|
+
* @returns {Object} Services object
|
|
6
|
+
*/
|
|
7
|
+
export function createServices(config: any, command?: string): any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ProjectService for managing project mappings and operations
|
|
3
|
-
* @extends BaseService
|
|
4
3
|
*/
|
|
5
|
-
export class ProjectService
|
|
4
|
+
export class ProjectService {
|
|
6
5
|
constructor(config: any, options?: {});
|
|
6
|
+
config: any;
|
|
7
7
|
apiService: any;
|
|
8
|
+
authService: any;
|
|
8
9
|
/**
|
|
9
10
|
* List all project mappings
|
|
10
11
|
* @returns {Promise<Array>} Array of project mappings
|
|
@@ -48,7 +49,8 @@ export class ProjectService extends BaseService {
|
|
|
48
49
|
switchProject(projectSlug: string, organizationSlug: string, token: string): Promise<any>;
|
|
49
50
|
/**
|
|
50
51
|
* List all projects from API
|
|
51
|
-
*
|
|
52
|
+
* Uses OAuth authentication (authService) when available, falls back to API token
|
|
53
|
+
* @returns {Promise<Array>} Array of projects with organization info
|
|
52
54
|
*/
|
|
53
55
|
listProjects(): Promise<any[]>;
|
|
54
56
|
/**
|
|
@@ -60,6 +62,7 @@ export class ProjectService extends BaseService {
|
|
|
60
62
|
getProject(projectSlug: string, organizationSlug: string): Promise<any>;
|
|
61
63
|
/**
|
|
62
64
|
* Get recent builds for a project
|
|
65
|
+
* Uses OAuth authentication (authService) when available, falls back to API token
|
|
63
66
|
* @param {string} projectSlug - Project slug
|
|
64
67
|
* @param {string} organizationSlug - Organization slug
|
|
65
68
|
* @param {Object} options - Query options
|
|
@@ -100,4 +103,3 @@ export class ProjectService extends BaseService {
|
|
|
100
103
|
*/
|
|
101
104
|
revokeProjectToken(projectSlug: string, organizationSlug: string, tokenId: string): Promise<void>;
|
|
102
105
|
}
|
|
103
|
-
import { BaseService } from './base-service.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export class ScreenshotServer
|
|
2
|
-
constructor(config: any,
|
|
1
|
+
export class ScreenshotServer {
|
|
2
|
+
constructor(config: any, buildManager: any);
|
|
3
|
+
config: any;
|
|
3
4
|
buildManager: any;
|
|
4
5
|
server: any;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
start(): Promise<any>;
|
|
7
|
+
stop(): Promise<any>;
|
|
7
8
|
handleRequest(req: any, res: any): Promise<void>;
|
|
8
9
|
parseRequestBody(req: any): Promise<any>;
|
|
9
10
|
}
|
|
10
|
-
import { BaseService } from './base-service.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export class ServerManager
|
|
1
|
+
export class ServerManager {
|
|
2
2
|
constructor(config: any, options?: {});
|
|
3
|
+
config: any;
|
|
3
4
|
httpServer: {
|
|
4
5
|
start: () => Promise<any>;
|
|
5
6
|
stop: () => Promise<any>;
|
|
6
|
-
finishBuild: (
|
|
7
|
+
finishBuild: (_buildId: any) => Promise<any>;
|
|
7
8
|
getServer: () => any;
|
|
8
9
|
};
|
|
9
10
|
handler: {
|
|
@@ -165,6 +166,7 @@ export class ServerManager extends BaseService {
|
|
|
165
166
|
deletedDiffs: number;
|
|
166
167
|
}>;
|
|
167
168
|
cleanup: () => void;
|
|
169
|
+
tddService: import("./tdd-service.js").TddService;
|
|
168
170
|
} | {
|
|
169
171
|
handleScreenshot: (buildId: any, name: any, image: any, properties?: {}) => Promise<{
|
|
170
172
|
statusCode: number;
|
|
@@ -259,9 +261,9 @@ export class ServerManager extends BaseService {
|
|
|
259
261
|
tddMode: boolean;
|
|
260
262
|
setBaseline: boolean;
|
|
261
263
|
createApiService(): Promise<import("./api-service.js").ApiService>;
|
|
264
|
+
stop(): Promise<void>;
|
|
262
265
|
get server(): {
|
|
263
266
|
getScreenshotCount: (buildId: any) => any;
|
|
264
267
|
finishBuild: (buildId: any) => Promise<any>;
|
|
265
268
|
};
|
|
266
269
|
}
|
|
267
|
-
import { BaseService } from './base-service.js';
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function createTDDService(config: any, options?: {}): TddService;
|
|
5
5
|
export class TddService {
|
|
6
|
-
constructor(config: any, workingDir?: any, setBaseline?: boolean);
|
|
6
|
+
constructor(config: any, workingDir?: any, setBaseline?: boolean, authService?: any);
|
|
7
7
|
config: any;
|
|
8
8
|
setBaseline: boolean;
|
|
9
|
+
authService: any;
|
|
9
10
|
api: ApiService;
|
|
10
11
|
workingDir: string;
|
|
11
12
|
baselinePath: string;
|
|
@@ -15,6 +16,16 @@ export class TddService {
|
|
|
15
16
|
comparisons: any[];
|
|
16
17
|
threshold: any;
|
|
17
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>;
|
|
18
29
|
/**
|
|
19
30
|
* Handle local baseline logic (either load existing or prepare for new baselines)
|
|
20
31
|
* @returns {Promise<Object|null>} Baseline data or null if no local baselines exist
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export class TestRunner
|
|
2
|
-
constructor(config: any,
|
|
1
|
+
export class TestRunner {
|
|
2
|
+
constructor(config: any, buildManager: any, serverManager: any, tddService: any);
|
|
3
|
+
config: any;
|
|
3
4
|
buildManager: any;
|
|
4
5
|
serverManager: any;
|
|
5
6
|
tddService: any;
|
|
@@ -28,4 +29,3 @@ export class TestRunner extends BaseService {
|
|
|
28
29
|
executeTestCommand(testCommand: any, env: any): Promise<any>;
|
|
29
30
|
cancel(): Promise<void>;
|
|
30
31
|
}
|
|
31
|
-
import { BaseService } from './base-service.js';
|