@testrelic/core 2.1.4 → 2.2.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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/types.ts","../src/logger.ts","../src/errors.ts","../src/validation.ts"],"sourcesContent":["// @testrelic/core — barrel export\n// Re-exports only, no implementation (Constitution II)\n\nexport type {\n NavigationType,\n TestRunReport,\n Summary,\n CIMetadata,\n CIProvider,\n TimelineEntry,\n TestResult,\n TestStatus,\n TestType,\n FailureDiagnostic,\n NetworkStats,\n ResourceBreakdown,\n ResourceType,\n CapturedNetworkRequest,\n ApiCallRecord,\n ApiAssertion,\n AssertionType,\n AssertionLocation,\n ReporterConfig,\n TestArtifacts,\n NavigationAnnotation,\n MergeOptions,\n StepTestIdentity,\n ApiCallStepRequest,\n ApiCallStepResponse,\n StepAssertion,\n NavigationStep,\n ApiCallStep,\n TimelineStep,\n TestRelicDataPayload,\n} from './types.js';\n\nexport {\n PAYLOAD_VERSION,\n ATTACHMENT_NAME,\n ATTACHMENT_CONTENT_TYPE,\n isTestRelicDataPayload,\n} from './types.js';\n\nexport type { Logger, LoggerOptions, LogLevel } from './logger.js';\nexport { createLogger } from './logger.js';\n\nexport { ErrorCode, TestRelicError, createError } from './errors.js';\n\nexport {\n isValidConfig,\n isValidNavigationType,\n isValidTestRunReport,\n} from './validation.js';\n","/**\n * @testrelic/core — Shared type definitions\n *\n * All interfaces for the JSON output schema, reporter configuration,\n * and internal fixture-to-reporter communication.\n *\n * Schema Version: 1.0.0\n */\n\n// ---------------------------------------------------------------------------\n// Navigation Types\n// ---------------------------------------------------------------------------\n\nexport type NavigationType =\n | 'goto'\n | 'navigation'\n | 'back'\n | 'forward'\n | 'refresh'\n | 'spa_route'\n | 'spa_replace'\n | 'hash_change'\n | 'link_click'\n | 'form_submit'\n | 'redirect'\n | 'popstate'\n | 'page_load'\n | 'manual_record'\n | 'fallback'\n | 'dummy';\n\n// ---------------------------------------------------------------------------\n// Output Schema Types (JSON report structure)\n// ---------------------------------------------------------------------------\n\nexport interface TestRunReport {\n readonly schemaVersion: string;\n readonly testRunId: string;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly totalDuration: number;\n readonly summary: Summary;\n readonly ci: CIMetadata | null;\n readonly metadata: Record<string, unknown> | null;\n readonly timeline: readonly (TimelineEntry | TimelineStep)[];\n readonly shardRunIds: string[] | null;\n}\n\n/** Breakdown of API calls by HTTP response status range. */\nexport interface ApiCallsByStatusRange {\n readonly '2xx': number;\n readonly '3xx': number;\n readonly '4xx': number;\n readonly '5xx': number;\n readonly error: number;\n}\n\n/** Statistical distribution of API call response times in milliseconds. */\nexport interface ApiResponseTimeStats {\n readonly avg: number;\n readonly min: number;\n readonly max: number;\n readonly p50: number;\n readonly p95: number;\n readonly p99: number;\n}\n\nexport interface Summary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedout: number;\n readonly totalApiCalls: number;\n readonly uniqueApiUrls: number;\n readonly apiCallsByMethod: Record<string, number>;\n readonly apiCallsByStatusRange: ApiCallsByStatusRange;\n readonly apiResponseTime: ApiResponseTimeStats | null;\n readonly totalAssertions: number;\n readonly passedAssertions: number;\n readonly failedAssertions: number;\n readonly totalNavigations: number;\n readonly uniqueNavigationUrls: number;\n readonly totalTimelineSteps: number;\n}\n\nexport interface CIMetadata {\n readonly provider: CIProvider;\n readonly buildId: string | null;\n readonly commitSha: string | null;\n readonly branch: string | null;\n}\n\nexport type CIProvider =\n | 'github-actions'\n | 'gitlab-ci'\n | 'jenkins'\n | 'circleci'\n | 'unknown';\n\nexport interface TimelineEntry {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly visitedAt: string;\n readonly duration: number;\n readonly specFile: string;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly tests: TestResult[];\n}\n\nexport interface TestResult {\n readonly title: string;\n readonly status: TestStatus;\n readonly duration: number;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly retryCount: number;\n readonly tags: string[];\n readonly failure: FailureDiagnostic | null;\n readonly testId: string;\n readonly filePath: string;\n readonly suiteName: string;\n readonly testType: TestType;\n readonly isFlaky: boolean;\n readonly retryStatus: string | null;\n readonly expectedStatus: TestStatus;\n readonly actualStatus: TestStatus;\n readonly artifacts: TestArtifacts | null;\n readonly networkRequests: CapturedNetworkRequest[] | null;\n readonly apiCalls: readonly ApiCallRecord[] | null;\n readonly apiAssertions: readonly ApiAssertion[] | null;\n}\n\nexport type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';\n\nexport interface CapturedNetworkRequest {\n readonly url: string;\n readonly method: string;\n readonly resourceType: ResourceType;\n readonly statusCode: number;\n readonly responseTimeMs: number;\n readonly startedAt: string;\n readonly requestHeaders: Record<string, string> | null;\n readonly requestBody: string | null;\n readonly responseBody: string | null;\n readonly responseHeaders: Record<string, string> | null;\n readonly contentType: string | null;\n readonly responseSize: number;\n readonly requestBodyTruncated: boolean;\n readonly responseBodyTruncated: boolean;\n readonly isBinary: boolean;\n readonly error: string | null;\n}\n\nexport interface TestArtifacts {\n readonly screenshot?: string;\n readonly video?: string;\n}\n\nexport type TestStatus = 'passed' | 'failed' | 'skipped' | 'flaky' | 'timedout';\n\nexport type TestType = 'e2e' | 'api' | 'unit' | 'unknown';\n\nexport interface FailureDiagnostic {\n readonly message: string;\n readonly line: number | null;\n readonly code: string | null;\n readonly stack: string | null;\n}\n\nexport interface NetworkStats {\n readonly totalRequests: number;\n readonly failedRequests: number;\n readonly failedRequestUrls: string[];\n readonly totalBytes: number;\n readonly byType: ResourceBreakdown;\n}\n\nexport interface ResourceBreakdown {\n readonly xhr: number;\n readonly document: number;\n readonly script: number;\n readonly stylesheet: number;\n readonly image: number;\n readonly font: number;\n readonly other: number;\n}\n\n// ---------------------------------------------------------------------------\n// API Call Record (captured from Playwright APIRequestContext proxy)\n// ---------------------------------------------------------------------------\n\nexport interface ApiCallRecord {\n /** Unique call identifier within the test (e.g., \"api-call-0\") */\n readonly id: string;\n /** ISO 8601 timestamp when the call was initiated */\n readonly timestamp: string;\n /** HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, or custom via fetch() */\n readonly method: string;\n /** Full resolved URL (after baseURL resolution by Playwright) */\n readonly url: string;\n /** All request headers sent, or null if unavailable */\n readonly requestHeaders: Record<string, string> | null;\n /** Request payload as string (JSON-serialized for objects). Null for bodiless methods */\n readonly requestBody: string | null;\n /** HTTP response status code, or null if request errored before response */\n readonly responseStatusCode: number | null;\n /** HTTP response status text, or null if request errored before response */\n readonly responseStatusText: string | null;\n /** All response headers received, or null if request errored before response */\n readonly responseHeaders: Record<string, string> | null;\n /** Response body: string for text/JSON, base64 for binary. Null on error */\n readonly responseBody: string | null;\n /** Duration in milliseconds from request initiation to response received */\n readonly responseTimeMs: number;\n /** Whether the response body is stored as a base64-encoded binary string */\n readonly isBinary: boolean;\n /** Error message if the call failed (network error, timeout), null on success */\n readonly error: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// API Assertion Types (captured from assertion tracking)\n// ---------------------------------------------------------------------------\n\n/** Categorization of the assertion being made. */\nexport type AssertionType =\n | 'status'\n | 'statusOk'\n | 'header'\n | 'bodyField'\n | 'bodyMatch'\n | 'bodyContains'\n | 'custom';\n\n/** Source location where an assertion was made in the test file. */\nexport interface AssertionLocation {\n /** Absolute or relative file path to the test file */\n readonly file: string;\n /** Line number (1-based) */\n readonly line: number;\n /** Column number (1-based), if available */\n readonly column?: number;\n}\n\n/** A single captured assertion on API response data. */\nexport interface ApiAssertion {\n /** Links to ApiCallRecord.id from the API proxy */\n readonly callId: string;\n /** Category of assertion */\n readonly type: AssertionType;\n /** What the test expected */\n readonly expected: unknown;\n /** What was actually received */\n readonly actual: unknown;\n /** Whether the assertion passed or failed */\n readonly status: 'passed' | 'failed';\n /** Source location of the assertion in the test file */\n readonly location: AssertionLocation;\n /** String representation of the assertion expression (best-effort) */\n readonly expression?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Unified Timeline Types (navigation + API call steps)\n// ---------------------------------------------------------------------------\n\n/** Test identity block attached to every timeline step. */\nexport interface StepTestIdentity {\n readonly title: string;\n readonly fullTitle: readonly string[];\n readonly status: TestStatus;\n readonly duration: number;\n readonly retries: number;\n readonly retry: number;\n readonly tags: readonly string[];\n readonly failure: FailureDiagnostic | null;\n}\n\n/** Request details within an API call step. */\nexport interface ApiCallStepRequest {\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** Response details within an API call step. */\nexport interface ApiCallStepResponse {\n readonly statusCode: number;\n readonly statusText: string;\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** An assertion linked to an API call step (callId omitted — implicit from parent). */\nexport interface StepAssertion {\n readonly type: AssertionType;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly status: 'passed' | 'failed';\n readonly location: AssertionLocation;\n readonly expression?: string;\n}\n\n/** A browser navigation event in the unified timeline. */\nexport interface NavigationStep {\n readonly index: number;\n readonly type: 'navigation';\n readonly url: string;\n readonly timestamp: string;\n readonly durationOnUrl: number;\n readonly navigationType: NavigationType;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** An API request event in the unified timeline. */\nexport interface ApiCallStep {\n readonly index: number;\n readonly type: 'api_call';\n readonly callId: string;\n readonly method: string;\n readonly url: string;\n readonly timestamp: string;\n readonly responseTime: number | null;\n readonly request: ApiCallStepRequest;\n readonly response: ApiCallStepResponse | null;\n readonly error?: string | null;\n readonly assertions: readonly StepAssertion[];\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** Discriminated union of all timeline step types. */\nexport type TimelineStep = NavigationStep | ApiCallStep;\n\n// ---------------------------------------------------------------------------\n// Configuration Types (reporter tuple options)\n// ---------------------------------------------------------------------------\n\nexport interface ReporterConfig {\n readonly outputPath?: string;\n readonly includeStackTrace?: boolean;\n readonly includeCodeSnippets?: boolean;\n readonly codeContextLines?: number;\n readonly includeNetworkStats?: boolean;\n readonly navigationTypes?: NavigationType[] | null;\n readonly redactPatterns?: (string | RegExp)[];\n readonly testRunId?: string | null;\n readonly metadata?: Record<string, unknown> | null;\n readonly openReport?: boolean;\n readonly htmlReportPath?: string;\n readonly includeArtifacts?: boolean;\n /** When false, disables API call interception in the unified fixture. Default: true */\n readonly trackApiCalls?: boolean;\n /** When true, suppresses console summary output. Default: false */\n readonly quiet?: boolean;\n /** Capture request headers for API calls. Default: true */\n readonly captureRequestHeaders?: boolean;\n /** Capture response headers for API calls. Default: true */\n readonly captureResponseHeaders?: boolean;\n /** Capture request body for API calls. Default: true */\n readonly captureRequestBody?: boolean;\n /** Capture response body for API calls. Default: true */\n readonly captureResponseBody?: boolean;\n /** Capture API assertions (both pass and fail). Default: true */\n readonly captureAssertions?: boolean;\n /**\n * Header names whose values are replaced with \"[REDACTED]\".\n * Case-insensitive matching. Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key']\n */\n readonly redactHeaders?: string[];\n /**\n * Body field names whose values are replaced with \"[REDACTED]\" at any depth.\n * Default: ['password', 'secret', 'token', 'apiKey', 'api_key']\n */\n readonly redactBodyFields?: string[];\n /**\n * Only track API calls matching these URL patterns.\n * Default: undefined (track all)\n */\n readonly apiIncludeUrls?: (string | RegExp)[];\n /**\n * Exclude API calls matching these URL patterns. Takes precedence over include.\n * Default: undefined (exclude none)\n */\n readonly apiExcludeUrls?: (string | RegExp)[];\n}\n\n// ---------------------------------------------------------------------------\n// Internal Types (fixture → reporter communication)\n// ---------------------------------------------------------------------------\n\nexport interface NavigationAnnotation {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly timestamp: string;\n readonly domContentLoadedAt?: string;\n readonly networkIdleAt?: string;\n readonly networkStats?: NetworkStats;\n}\n\n// ---------------------------------------------------------------------------\n// Worker-Safe Data Payload (worker → reporter communication)\n// ---------------------------------------------------------------------------\n\n/** Consolidated data payload sent from a worker fixture to the reporter. */\nexport interface TestRelicDataPayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version (semver). */\n readonly version: string;\n /** Navigation events collected during the test. */\n readonly navigations: readonly NavigationAnnotation[];\n /** Captured network requests during the test. */\n readonly networkRequests: readonly CapturedNetworkRequest[];\n /** API calls made via APIRequestContext proxy. */\n readonly apiCalls: readonly ApiCallRecord[];\n /** Assertions captured on API responses. */\n readonly apiAssertions: readonly ApiAssertion[];\n}\n\n/** Current payload format version. */\nexport const PAYLOAD_VERSION = '1.0.0';\n\n/** Attachment name used for the consolidated payload. */\nexport const ATTACHMENT_NAME = 'testrelic-data';\n\n/** Attachment content type. */\nexport const ATTACHMENT_CONTENT_TYPE = 'application/json';\n\n/** Type guard: validates that a parsed object is a TestRelicDataPayload. */\nexport function isTestRelicDataPayload(obj: unknown): obj is TestRelicDataPayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n typeof record.version === 'string' &&\n record.version.length > 0 &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.networkRequests) &&\n Array.isArray(record.apiCalls) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merge CLI Types\n// ---------------------------------------------------------------------------\n\nexport interface MergeOptions {\n readonly output: string;\n readonly testRunId?: string;\n}\n","/**\n * @testrelic/core — Configurable logger\n *\n * Provides a Logger interface with a no-op default.\n * Never uses console.* directly (Constitution SDK Constraint).\n */\n\nexport interface Logger {\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n debug(message: string, ...args: unknown[]): void;\n}\n\nexport interface LoggerOptions {\n readonly handler?: (level: LogLevel, message: string, args: unknown[]) => void;\n}\n\nexport type LogLevel = 'info' | 'warn' | 'error' | 'debug';\n\ntype LogHandler = (level: LogLevel, message: string, args: unknown[]) => void;\n\nconst noopHandler: LogHandler = () => {};\n\nexport function createLogger(options?: LoggerOptions): Logger {\n const handler = options?.handler ?? noopHandler;\n\n return {\n info(message: string, ...args: unknown[]) {\n handler('info', message, args);\n },\n warn(message: string, ...args: unknown[]) {\n handler('warn', message, args);\n },\n error(message: string, ...args: unknown[]) {\n handler('error', message, args);\n },\n debug(message: string, ...args: unknown[]) {\n handler('debug', message, args);\n },\n };\n}\n","/**\n * @testrelic/core — Structured error factory\n *\n * Machine-readable error codes for programmatic handling.\n */\n\nexport const ErrorCode = {\n CONFIG_INVALID: 'TESTRELIC_CONFIG_INVALID',\n OUTPUT_WRITE_FAILED: 'TESTRELIC_OUTPUT_WRITE_FAILED',\n MERGE_INVALID_SCHEMA: 'TESTRELIC_MERGE_INVALID_SCHEMA',\n MERGE_READ_FAILED: 'TESTRELIC_MERGE_READ_FAILED',\n NAVIGATION_FLUSH_FAILED: 'TESTRELIC_NAVIGATION_FLUSH_FAILED',\n CODE_EXTRACT_FAILED: 'TESTRELIC_CODE_EXTRACT_FAILED',\n HTML_REPORT_FAILED: 'TESTRELIC_HTML_REPORT_FAILED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\nexport class TestRelicError extends Error {\n readonly code: ErrorCode;\n\n constructor(code: ErrorCode, message: string, cause?: unknown) {\n super(message);\n this.name = 'TestRelicError';\n this.code = code;\n if (cause !== undefined) {\n Object.defineProperty(this, 'cause', { value: cause, writable: false, enumerable: false });\n }\n }\n}\n\nexport function createError(\n code: ErrorCode,\n message: string,\n cause?: unknown,\n): TestRelicError {\n return new TestRelicError(code, message, cause);\n}\n","/**\n * @testrelic/core — Lightweight runtime type guards\n *\n * Hand-written guards, no runtime schema libraries (Constitution SDK Constraint).\n */\n\nimport type {\n ReporterConfig,\n NavigationType,\n TestRunReport,\n} from './types.js';\n\nconst NAVIGATION_TYPES = new Set<string>([\n 'goto', 'navigation', 'back', 'forward', 'refresh',\n 'spa_route', 'spa_replace', 'hash_change', 'link_click',\n 'form_submit', 'redirect', 'popstate', 'page_load',\n 'manual_record', 'fallback', 'dummy',\n]);\n\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nexport function isValidNavigationType(value: unknown): value is NavigationType {\n return typeof value === 'string' && NAVIGATION_TYPES.has(value);\n}\n\nfunction hasNoPrototypePollution(obj: unknown): boolean {\n if (typeof obj !== 'object' || obj === null) return true;\n for (const key of Object.keys(obj)) {\n if (DANGEROUS_KEYS.has(key)) return false;\n }\n return true;\n}\n\nexport function isValidConfig(input: unknown): input is ReporterConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.outputPath !== undefined && typeof obj.outputPath !== 'string') return false;\n if (obj.includeStackTrace !== undefined && typeof obj.includeStackTrace !== 'boolean') return false;\n if (obj.includeCodeSnippets !== undefined && typeof obj.includeCodeSnippets !== 'boolean') return false;\n if (obj.codeContextLines !== undefined && typeof obj.codeContextLines !== 'number') return false;\n if (obj.includeNetworkStats !== undefined && typeof obj.includeNetworkStats !== 'boolean') return false;\n\n if (obj.navigationTypes !== undefined && obj.navigationTypes !== null) {\n if (!Array.isArray(obj.navigationTypes)) return false;\n for (const t of obj.navigationTypes) {\n if (!isValidNavigationType(t)) return false;\n }\n }\n\n if (obj.redactPatterns !== undefined) {\n if (!Array.isArray(obj.redactPatterns)) return false;\n for (const p of obj.redactPatterns) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.testRunId !== undefined && obj.testRunId !== null && typeof obj.testRunId !== 'string') return false;\n\n if (obj.metadata !== undefined && obj.metadata !== null) {\n if (typeof obj.metadata !== 'object') return false;\n if (!hasNoPrototypePollution(obj.metadata)) return false;\n }\n\n if (obj.openReport !== undefined && typeof obj.openReport !== 'boolean') return false;\n if (obj.htmlReportPath !== undefined && (typeof obj.htmlReportPath !== 'string' || obj.htmlReportPath === '')) return false;\n if (obj.includeArtifacts !== undefined && typeof obj.includeArtifacts !== 'boolean') return false;\n\n // API tracking configuration\n if (obj.trackApiCalls !== undefined && typeof obj.trackApiCalls !== 'boolean') return false;\n if (obj.captureRequestHeaders !== undefined && typeof obj.captureRequestHeaders !== 'boolean') return false;\n if (obj.captureResponseHeaders !== undefined && typeof obj.captureResponseHeaders !== 'boolean') return false;\n if (obj.captureRequestBody !== undefined && typeof obj.captureRequestBody !== 'boolean') return false;\n if (obj.captureResponseBody !== undefined && typeof obj.captureResponseBody !== 'boolean') return false;\n if (obj.captureAssertions !== undefined && typeof obj.captureAssertions !== 'boolean') return false;\n\n if (obj.redactHeaders !== undefined) {\n if (!Array.isArray(obj.redactHeaders)) return false;\n for (const h of obj.redactHeaders) {\n if (typeof h !== 'string') return false;\n }\n }\n\n if (obj.redactBodyFields !== undefined) {\n if (!Array.isArray(obj.redactBodyFields)) return false;\n for (const f of obj.redactBodyFields) {\n if (typeof f !== 'string') return false;\n }\n }\n\n if (obj.apiIncludeUrls !== undefined) {\n if (!Array.isArray(obj.apiIncludeUrls)) return false;\n for (const p of obj.apiIncludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.apiExcludeUrls !== undefined) {\n if (!Array.isArray(obj.apiExcludeUrls)) return false;\n for (const p of obj.apiExcludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n return true;\n}\n\nexport function isValidTestRunReport(value: unknown): value is TestRunReport {\n if (typeof value !== 'object' || value === null) return false;\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.schemaVersion !== 'string') return false;\n if (typeof obj.testRunId !== 'string') return false;\n if (typeof obj.startedAt !== 'string') return false;\n if (typeof obj.completedAt !== 'string') return false;\n if (typeof obj.totalDuration !== 'number') return false;\n if (typeof obj.summary !== 'object' || obj.summary === null) return false;\n if (!Array.isArray(obj.timeline)) return false;\n\n const summary = obj.summary as Record<string, unknown>;\n if (typeof summary.total !== 'number') return false;\n if (typeof summary.passed !== 'number') return false;\n if (typeof summary.failed !== 'number') return false;\n if (typeof summary.flaky !== 'number') return false;\n if (typeof summary.skipped !== 'number') return false;\n // timedout is optional for backward compat with schema 1.0.0\n if (summary.timedout !== undefined && typeof summary.timedout !== 'number') return false;\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC4aO,IAAM,kBAAkB;AAGxB,IAAM,kBAAkB;AAGxB,IAAM,0BAA0B;AAGhC,SAAS,uBAAuB,KAA2C;AAChF,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,SAAS;AACf,SACE,OAAO,kBAAkB,QACzB,OAAO,OAAO,YAAY,YAC1B,OAAO,QAAQ,SAAS,KACxB,MAAM,QAAQ,OAAO,WAAW,KAChC,MAAM,QAAQ,OAAO,eAAe,KACpC,MAAM,QAAQ,OAAO,QAAQ,KAC7B,MAAM,QAAQ,OAAO,aAAa;AAEtC;;;AC3aA,IAAM,cAA0B,MAAM;AAAC;AAEhC,SAAS,aAAa,SAAiC;AAC5D,QAAM,UAAU,SAAS,WAAW;AAEpC,SAAO;AAAA,IACL,KAAK,YAAoB,MAAiB;AACxC,cAAQ,QAAQ,SAAS,IAAI;AAAA,IAC/B;AAAA,IACA,KAAK,YAAoB,MAAiB;AACxC,cAAQ,QAAQ,SAAS,IAAI;AAAA,IAC/B;AAAA,IACA,MAAM,YAAoB,MAAiB;AACzC,cAAQ,SAAS,SAAS,IAAI;AAAA,IAChC;AAAA,IACA,MAAM,YAAoB,MAAiB;AACzC,cAAQ,SAAS,SAAS,IAAI;AAAA,IAChC;AAAA,EACF;AACF;;;ACnCO,IAAM,YAAY;AAAA,EACvB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,sBAAsB;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AAO,IAAI,cAAc,SAAU,QAAO;AAC9C,MAAI,OAAO,IAAI,gBAAgB,SAAU,QAAO;AAChD,MAAI,OAAO,IAAI,kBAAkB,SAAU,QAAO;AAClD,MAAI,OAAO,IAAI,YAAY,YAAY,IAAI,YAAY,KAAM,QAAO;AACpE,MAAI,CAAC,MAAM,QAAQ,IAAI,QAAQ,EAAG,QAAO;AAEzC,QAAM,UAAU,IAAI;AACpB,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,YAAY,SAAU,QAAO;AAEhD,MAAI,QAAQ,aAAa,UAAa,OAAO,QAAQ,aAAa,SAAU,QAAO;AAEnF,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/types.ts","../src/logger.ts","../src/errors.ts","../src/validation.ts"],"sourcesContent":["// @testrelic/core — barrel export\n// Re-exports only, no implementation (Constitution II)\n\nexport type {\n NavigationType,\n TestRunReport,\n Summary,\n CIMetadata,\n CIProvider,\n TimelineEntry,\n TestResult,\n TestStatus,\n TestType,\n FailureDiagnostic,\n NetworkStats,\n ResourceBreakdown,\n ResourceType,\n CapturedNetworkRequest,\n ApiCallRecord,\n ApiAssertion,\n AssertionType,\n AssertionLocation,\n ReporterConfig,\n TestArtifacts,\n NavigationAnnotation,\n MergeOptions,\n StepTestIdentity,\n ApiCallStepRequest,\n ApiCallStepResponse,\n StepAssertion,\n NavigationStep,\n ApiCallStep,\n TimelineStep,\n ActionStep,\n ActionCategory,\n TestRelicDataPayload,\n} from './types.js';\n\nexport {\n PAYLOAD_VERSION,\n ATTACHMENT_NAME,\n ATTACHMENT_CONTENT_TYPE,\n isTestRelicDataPayload,\n} from './types.js';\n\nexport type { Logger, LoggerOptions, LogLevel } from './logger.js';\nexport { createLogger } from './logger.js';\n\nexport { ErrorCode, TestRelicError, createError } from './errors.js';\n\nexport {\n isValidConfig,\n isValidNavigationType,\n isValidTestRunReport,\n} from './validation.js';\n","/**\n * @testrelic/core — Shared type definitions\n *\n * All interfaces for the JSON output schema, reporter configuration,\n * and internal fixture-to-reporter communication.\n *\n * Schema Version: 1.0.0\n */\n\n// ---------------------------------------------------------------------------\n// Navigation Types\n// ---------------------------------------------------------------------------\n\nexport type NavigationType =\n | 'goto'\n | 'navigation'\n | 'back'\n | 'forward'\n | 'refresh'\n | 'spa_route'\n | 'spa_replace'\n | 'hash_change'\n | 'link_click'\n | 'form_submit'\n | 'redirect'\n | 'popstate'\n | 'page_load'\n | 'manual_record'\n | 'fallback'\n | 'dummy';\n\n// ---------------------------------------------------------------------------\n// Output Schema Types (JSON report structure)\n// ---------------------------------------------------------------------------\n\nexport interface TestRunReport {\n readonly schemaVersion: string;\n readonly testRunId: string;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly totalDuration: number;\n readonly summary: Summary;\n readonly ci: CIMetadata | null;\n readonly metadata: Record<string, unknown> | null;\n readonly timeline: readonly (TimelineEntry | TimelineStep)[];\n readonly shardRunIds: string[] | null;\n}\n\n/** Breakdown of API calls by HTTP response status range. */\nexport interface ApiCallsByStatusRange {\n readonly '2xx': number;\n readonly '3xx': number;\n readonly '4xx': number;\n readonly '5xx': number;\n readonly error: number;\n}\n\n/** Statistical distribution of API call response times in milliseconds. */\nexport interface ApiResponseTimeStats {\n readonly avg: number;\n readonly min: number;\n readonly max: number;\n readonly p50: number;\n readonly p95: number;\n readonly p99: number;\n}\n\nexport interface Summary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedout: number;\n readonly totalApiCalls: number;\n readonly uniqueApiUrls: number;\n readonly apiCallsByMethod: Record<string, number>;\n readonly apiCallsByStatusRange: ApiCallsByStatusRange;\n readonly apiResponseTime: ApiResponseTimeStats | null;\n readonly totalAssertions: number;\n readonly passedAssertions: number;\n readonly failedAssertions: number;\n readonly totalNavigations: number;\n readonly uniqueNavigationUrls: number;\n readonly totalTimelineSteps: number;\n readonly totalActionSteps: number;\n readonly actionStepsByCategory: Record<string, number>;\n}\n\nexport interface CIMetadata {\n readonly provider: CIProvider;\n readonly buildId: string | null;\n readonly commitSha: string | null;\n readonly branch: string | null;\n}\n\nexport type CIProvider =\n | 'github-actions'\n | 'gitlab-ci'\n | 'jenkins'\n | 'circleci'\n | 'unknown';\n\nexport interface TimelineEntry {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly visitedAt: string;\n readonly duration: number;\n readonly specFile: string;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly tests: TestResult[];\n}\n\nexport interface TestResult {\n readonly title: string;\n readonly status: TestStatus;\n readonly duration: number;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly retryCount: number;\n readonly tags: string[];\n readonly failure: FailureDiagnostic | null;\n readonly testId: string;\n readonly filePath: string;\n readonly suiteName: string;\n readonly testType: TestType;\n readonly isFlaky: boolean;\n readonly retryStatus: string | null;\n readonly expectedStatus: TestStatus;\n readonly actualStatus: TestStatus;\n readonly artifacts: TestArtifacts | null;\n readonly networkRequests: CapturedNetworkRequest[] | null;\n readonly apiCalls: readonly ApiCallRecord[] | null;\n readonly apiAssertions: readonly ApiAssertion[] | null;\n readonly actions: readonly ActionStep[] | null;\n}\n\nexport type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';\n\nexport interface CapturedNetworkRequest {\n readonly url: string;\n readonly method: string;\n readonly resourceType: ResourceType;\n readonly statusCode: number;\n readonly responseTimeMs: number;\n readonly startedAt: string;\n readonly requestHeaders: Record<string, string> | null;\n readonly requestBody: string | null;\n readonly responseBody: string | null;\n readonly responseHeaders: Record<string, string> | null;\n readonly contentType: string | null;\n readonly responseSize: number;\n readonly requestBodyTruncated: boolean;\n readonly responseBodyTruncated: boolean;\n readonly isBinary: boolean;\n readonly error: string | null;\n}\n\nexport interface TestArtifacts {\n readonly screenshot?: string;\n readonly video?: string;\n}\n\nexport type TestStatus = 'passed' | 'failed' | 'skipped' | 'flaky' | 'timedout';\n\nexport type TestType = 'e2e' | 'api' | 'unit' | 'unknown';\n\nexport interface FailureDiagnostic {\n readonly message: string;\n readonly line: number | null;\n readonly code: string | null;\n readonly stack: string | null;\n}\n\nexport interface NetworkStats {\n readonly totalRequests: number;\n readonly failedRequests: number;\n readonly failedRequestUrls: string[];\n readonly totalBytes: number;\n readonly byType: ResourceBreakdown;\n}\n\nexport interface ResourceBreakdown {\n readonly xhr: number;\n readonly document: number;\n readonly script: number;\n readonly stylesheet: number;\n readonly image: number;\n readonly font: number;\n readonly other: number;\n}\n\n// ---------------------------------------------------------------------------\n// API Call Record (captured from Playwright APIRequestContext proxy)\n// ---------------------------------------------------------------------------\n\nexport interface ApiCallRecord {\n /** Unique call identifier within the test (e.g., \"api-call-0\") */\n readonly id: string;\n /** ISO 8601 timestamp when the call was initiated */\n readonly timestamp: string;\n /** HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, or custom via fetch() */\n readonly method: string;\n /** Full resolved URL (after baseURL resolution by Playwright) */\n readonly url: string;\n /** All request headers sent, or null if unavailable */\n readonly requestHeaders: Record<string, string> | null;\n /** Request payload as string (JSON-serialized for objects). Null for bodiless methods */\n readonly requestBody: string | null;\n /** HTTP response status code, or null if request errored before response */\n readonly responseStatusCode: number | null;\n /** HTTP response status text, or null if request errored before response */\n readonly responseStatusText: string | null;\n /** All response headers received, or null if request errored before response */\n readonly responseHeaders: Record<string, string> | null;\n /** Response body: string for text/JSON, base64 for binary. Null on error */\n readonly responseBody: string | null;\n /** Duration in milliseconds from request initiation to response received */\n readonly responseTimeMs: number;\n /** Whether the response body is stored as a base64-encoded binary string */\n readonly isBinary: boolean;\n /** Error message if the call failed (network error, timeout), null on success */\n readonly error: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// API Assertion Types (captured from assertion tracking)\n// ---------------------------------------------------------------------------\n\n/** Categorization of the assertion being made. */\nexport type AssertionType =\n | 'status'\n | 'statusOk'\n | 'header'\n | 'bodyField'\n | 'bodyMatch'\n | 'bodyContains'\n | 'custom';\n\n/** Source location where an assertion was made in the test file. */\nexport interface AssertionLocation {\n /** Absolute or relative file path to the test file */\n readonly file: string;\n /** Line number (1-based) */\n readonly line: number;\n /** Column number (1-based), if available */\n readonly column?: number;\n}\n\n/** A single captured assertion on API response data. */\nexport interface ApiAssertion {\n /** Links to ApiCallRecord.id from the API proxy */\n readonly callId: string;\n /** Category of assertion */\n readonly type: AssertionType;\n /** What the test expected */\n readonly expected: unknown;\n /** What was actually received */\n readonly actual: unknown;\n /** Whether the assertion passed or failed */\n readonly status: 'passed' | 'failed';\n /** Source location of the assertion in the test file */\n readonly location: AssertionLocation;\n /** String representation of the assertion expression (best-effort) */\n readonly expression?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Unified Timeline Types (navigation + API call steps)\n// ---------------------------------------------------------------------------\n\n/** Test identity block attached to every timeline step. */\nexport interface StepTestIdentity {\n readonly title: string;\n readonly fullTitle: readonly string[];\n readonly status: TestStatus;\n readonly duration: number;\n readonly retries: number;\n readonly retry: number;\n readonly tags: readonly string[];\n readonly failure: FailureDiagnostic | null;\n}\n\n/** Request details within an API call step. */\nexport interface ApiCallStepRequest {\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** Response details within an API call step. */\nexport interface ApiCallStepResponse {\n readonly statusCode: number;\n readonly statusText: string;\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** An assertion linked to an API call step (callId omitted — implicit from parent). */\nexport interface StepAssertion {\n readonly type: AssertionType;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly status: 'passed' | 'failed';\n readonly location: AssertionLocation;\n readonly expression?: string;\n}\n\n/** A browser navigation event in the unified timeline. */\nexport interface NavigationStep {\n readonly index: number;\n readonly type: 'navigation';\n readonly url: string;\n readonly timestamp: string;\n readonly durationOnUrl: number;\n readonly navigationType: NavigationType;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** An API request event in the unified timeline. */\nexport interface ApiCallStep {\n readonly index: number;\n readonly type: 'api_call';\n readonly callId: string;\n readonly method: string;\n readonly url: string;\n readonly timestamp: string;\n readonly responseTime: number | null;\n readonly request: ApiCallStepRequest;\n readonly response: ApiCallStepResponse | null;\n readonly error?: string | null;\n readonly assertions: readonly StepAssertion[];\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** Discriminated union of all timeline step types. */\nexport type TimelineStep = NavigationStep | ApiCallStep;\n\n// ---------------------------------------------------------------------------\n// Action Step Types (Playwright test step capture)\n// ---------------------------------------------------------------------------\n\n/** Categorized type of a captured test action. */\nexport type ActionCategory = 'ui_action' | 'assertion' | 'custom_step';\n\n/** A single captured test action step. */\nexport interface ActionStep {\n readonly title: string;\n readonly category: ActionCategory;\n readonly timestamp: string;\n readonly duration: number;\n readonly videoOffset: number | null;\n readonly status: 'passed' | 'failed';\n readonly error: string | null;\n readonly children: readonly ActionStep[];\n}\n\n// ---------------------------------------------------------------------------\n// Configuration Types (reporter tuple options)\n// ---------------------------------------------------------------------------\n\nexport interface ReporterConfig {\n readonly outputPath?: string;\n readonly includeStackTrace?: boolean;\n readonly includeCodeSnippets?: boolean;\n readonly codeContextLines?: number;\n readonly includeNetworkStats?: boolean;\n readonly navigationTypes?: NavigationType[] | null;\n readonly redactPatterns?: (string | RegExp)[];\n readonly testRunId?: string | null;\n readonly metadata?: Record<string, unknown> | null;\n readonly openReport?: boolean;\n readonly htmlReportPath?: string;\n readonly includeArtifacts?: boolean;\n /** When false, disables API call interception in the unified fixture. Default: true */\n readonly trackApiCalls?: boolean;\n /** When true, suppresses console summary output. Default: false */\n readonly quiet?: boolean;\n /** When true, captures Playwright test steps (actions). Default: true */\n readonly includeActionSteps?: boolean;\n /** Capture request headers for API calls. Default: true */\n readonly captureRequestHeaders?: boolean;\n /** Capture response headers for API calls. Default: true */\n readonly captureResponseHeaders?: boolean;\n /** Capture request body for API calls. Default: true */\n readonly captureRequestBody?: boolean;\n /** Capture response body for API calls. Default: true */\n readonly captureResponseBody?: boolean;\n /** Capture API assertions (both pass and fail). Default: true */\n readonly captureAssertions?: boolean;\n /**\n * Header names whose values are replaced with \"[REDACTED]\".\n * Case-insensitive matching. Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key']\n */\n readonly redactHeaders?: string[];\n /**\n * Body field names whose values are replaced with \"[REDACTED]\" at any depth.\n * Default: ['password', 'secret', 'token', 'apiKey', 'api_key']\n */\n readonly redactBodyFields?: string[];\n /**\n * Only track API calls matching these URL patterns.\n * Default: undefined (track all)\n */\n readonly apiIncludeUrls?: (string | RegExp)[];\n /**\n * Exclude API calls matching these URL patterns. Takes precedence over include.\n * Default: undefined (exclude none)\n */\n readonly apiExcludeUrls?: (string | RegExp)[];\n}\n\n// ---------------------------------------------------------------------------\n// Internal Types (fixture → reporter communication)\n// ---------------------------------------------------------------------------\n\nexport interface NavigationAnnotation {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly timestamp: string;\n readonly domContentLoadedAt?: string;\n readonly networkIdleAt?: string;\n readonly networkStats?: NetworkStats;\n}\n\n// ---------------------------------------------------------------------------\n// Worker-Safe Data Payload (worker → reporter communication)\n// ---------------------------------------------------------------------------\n\n/** Consolidated data payload sent from a worker fixture to the reporter. */\nexport interface TestRelicDataPayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version (semver). */\n readonly version: string;\n /** Navigation events collected during the test. */\n readonly navigations: readonly NavigationAnnotation[];\n /** Captured network requests during the test. */\n readonly networkRequests: readonly CapturedNetworkRequest[];\n /** API calls made via APIRequestContext proxy. */\n readonly apiCalls: readonly ApiCallRecord[];\n /** Assertions captured on API responses. */\n readonly apiAssertions: readonly ApiAssertion[];\n}\n\n/** Current payload format version. */\nexport const PAYLOAD_VERSION = '1.0.0';\n\n/** Attachment name used for the consolidated payload. */\nexport const ATTACHMENT_NAME = 'testrelic-data';\n\n/** Attachment content type. */\nexport const ATTACHMENT_CONTENT_TYPE = 'application/json';\n\n/** Type guard: validates that a parsed object is a TestRelicDataPayload. */\nexport function isTestRelicDataPayload(obj: unknown): obj is TestRelicDataPayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n typeof record.version === 'string' &&\n record.version.length > 0 &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.networkRequests) &&\n Array.isArray(record.apiCalls) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merge CLI Types\n// ---------------------------------------------------------------------------\n\nexport interface MergeOptions {\n readonly output: string;\n readonly testRunId?: string;\n}\n","/**\n * @testrelic/core — Configurable logger\n *\n * Provides a Logger interface with a no-op default.\n * Never uses console.* directly (Constitution SDK Constraint).\n */\n\nexport interface Logger {\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n debug(message: string, ...args: unknown[]): void;\n}\n\nexport interface LoggerOptions {\n readonly handler?: (level: LogLevel, message: string, args: unknown[]) => void;\n}\n\nexport type LogLevel = 'info' | 'warn' | 'error' | 'debug';\n\ntype LogHandler = (level: LogLevel, message: string, args: unknown[]) => void;\n\nconst noopHandler: LogHandler = () => {};\n\nexport function createLogger(options?: LoggerOptions): Logger {\n const handler = options?.handler ?? noopHandler;\n\n return {\n info(message: string, ...args: unknown[]) {\n handler('info', message, args);\n },\n warn(message: string, ...args: unknown[]) {\n handler('warn', message, args);\n },\n error(message: string, ...args: unknown[]) {\n handler('error', message, args);\n },\n debug(message: string, ...args: unknown[]) {\n handler('debug', message, args);\n },\n };\n}\n","/**\n * @testrelic/core — Structured error factory\n *\n * Machine-readable error codes for programmatic handling.\n */\n\nexport const ErrorCode = {\n CONFIG_INVALID: 'TESTRELIC_CONFIG_INVALID',\n OUTPUT_WRITE_FAILED: 'TESTRELIC_OUTPUT_WRITE_FAILED',\n MERGE_INVALID_SCHEMA: 'TESTRELIC_MERGE_INVALID_SCHEMA',\n MERGE_READ_FAILED: 'TESTRELIC_MERGE_READ_FAILED',\n NAVIGATION_FLUSH_FAILED: 'TESTRELIC_NAVIGATION_FLUSH_FAILED',\n CODE_EXTRACT_FAILED: 'TESTRELIC_CODE_EXTRACT_FAILED',\n HTML_REPORT_FAILED: 'TESTRELIC_HTML_REPORT_FAILED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\nexport class TestRelicError extends Error {\n readonly code: ErrorCode;\n\n constructor(code: ErrorCode, message: string, cause?: unknown) {\n super(message);\n this.name = 'TestRelicError';\n this.code = code;\n if (cause !== undefined) {\n Object.defineProperty(this, 'cause', { value: cause, writable: false, enumerable: false });\n }\n }\n}\n\nexport function createError(\n code: ErrorCode,\n message: string,\n cause?: unknown,\n): TestRelicError {\n return new TestRelicError(code, message, cause);\n}\n","/**\n * @testrelic/core — Lightweight runtime type guards\n *\n * Hand-written guards, no runtime schema libraries (Constitution SDK Constraint).\n */\n\nimport type {\n ReporterConfig,\n NavigationType,\n TestRunReport,\n} from './types.js';\n\nconst NAVIGATION_TYPES = new Set<string>([\n 'goto', 'navigation', 'back', 'forward', 'refresh',\n 'spa_route', 'spa_replace', 'hash_change', 'link_click',\n 'form_submit', 'redirect', 'popstate', 'page_load',\n 'manual_record', 'fallback', 'dummy',\n]);\n\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nexport function isValidNavigationType(value: unknown): value is NavigationType {\n return typeof value === 'string' && NAVIGATION_TYPES.has(value);\n}\n\nfunction hasNoPrototypePollution(obj: unknown): boolean {\n if (typeof obj !== 'object' || obj === null) return true;\n for (const key of Object.keys(obj)) {\n if (DANGEROUS_KEYS.has(key)) return false;\n }\n return true;\n}\n\nexport function isValidConfig(input: unknown): input is ReporterConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.outputPath !== undefined && typeof obj.outputPath !== 'string') return false;\n if (obj.includeStackTrace !== undefined && typeof obj.includeStackTrace !== 'boolean') return false;\n if (obj.includeCodeSnippets !== undefined && typeof obj.includeCodeSnippets !== 'boolean') return false;\n if (obj.codeContextLines !== undefined && typeof obj.codeContextLines !== 'number') return false;\n if (obj.includeNetworkStats !== undefined && typeof obj.includeNetworkStats !== 'boolean') return false;\n\n if (obj.navigationTypes !== undefined && obj.navigationTypes !== null) {\n if (!Array.isArray(obj.navigationTypes)) return false;\n for (const t of obj.navigationTypes) {\n if (!isValidNavigationType(t)) return false;\n }\n }\n\n if (obj.redactPatterns !== undefined) {\n if (!Array.isArray(obj.redactPatterns)) return false;\n for (const p of obj.redactPatterns) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.testRunId !== undefined && obj.testRunId !== null && typeof obj.testRunId !== 'string') return false;\n\n if (obj.metadata !== undefined && obj.metadata !== null) {\n if (typeof obj.metadata !== 'object') return false;\n if (!hasNoPrototypePollution(obj.metadata)) return false;\n }\n\n if (obj.openReport !== undefined && typeof obj.openReport !== 'boolean') return false;\n if (obj.htmlReportPath !== undefined && (typeof obj.htmlReportPath !== 'string' || obj.htmlReportPath === '')) return false;\n if (obj.includeArtifacts !== undefined && typeof obj.includeArtifacts !== 'boolean') return false;\n\n // API tracking configuration\n if (obj.trackApiCalls !== undefined && typeof obj.trackApiCalls !== 'boolean') return false;\n if (obj.captureRequestHeaders !== undefined && typeof obj.captureRequestHeaders !== 'boolean') return false;\n if (obj.captureResponseHeaders !== undefined && typeof obj.captureResponseHeaders !== 'boolean') return false;\n if (obj.captureRequestBody !== undefined && typeof obj.captureRequestBody !== 'boolean') return false;\n if (obj.captureResponseBody !== undefined && typeof obj.captureResponseBody !== 'boolean') return false;\n if (obj.captureAssertions !== undefined && typeof obj.captureAssertions !== 'boolean') return false;\n\n if (obj.redactHeaders !== undefined) {\n if (!Array.isArray(obj.redactHeaders)) return false;\n for (const h of obj.redactHeaders) {\n if (typeof h !== 'string') return false;\n }\n }\n\n if (obj.redactBodyFields !== undefined) {\n if (!Array.isArray(obj.redactBodyFields)) return false;\n for (const f of obj.redactBodyFields) {\n if (typeof f !== 'string') return false;\n }\n }\n\n if (obj.apiIncludeUrls !== undefined) {\n if (!Array.isArray(obj.apiIncludeUrls)) return false;\n for (const p of obj.apiIncludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.apiExcludeUrls !== undefined) {\n if (!Array.isArray(obj.apiExcludeUrls)) return false;\n for (const p of obj.apiExcludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n return true;\n}\n\nexport function isValidTestRunReport(value: unknown): value is TestRunReport {\n if (typeof value !== 'object' || value === null) return false;\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.schemaVersion !== 'string') return false;\n if (typeof obj.testRunId !== 'string') return false;\n if (typeof obj.startedAt !== 'string') return false;\n if (typeof obj.completedAt !== 'string') return false;\n if (typeof obj.totalDuration !== 'number') return false;\n if (typeof obj.summary !== 'object' || obj.summary === null) return false;\n if (!Array.isArray(obj.timeline)) return false;\n\n const summary = obj.summary as Record<string, unknown>;\n if (typeof summary.total !== 'number') return false;\n if (typeof summary.passed !== 'number') return false;\n if (typeof summary.failed !== 'number') return false;\n if (typeof summary.flaky !== 'number') return false;\n if (typeof summary.skipped !== 'number') return false;\n // timedout is optional for backward compat with schema 1.0.0\n if (summary.timedout !== undefined && typeof summary.timedout !== 'number') return false;\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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;AAC/C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,YAAY,SAAU,QAAO;AAEhD,MAAI,QAAQ,aAAa,UAAa,OAAO,QAAQ,aAAa,SAAU,QAAO;AAEnF,SAAO;AACT;","names":[]}
package/dist/index.d.cts CHANGED
@@ -54,6 +54,8 @@ interface Summary {
54
54
  readonly totalNavigations: number;
55
55
  readonly uniqueNavigationUrls: number;
56
56
  readonly totalTimelineSteps: number;
57
+ readonly totalActionSteps: number;
58
+ readonly actionStepsByCategory: Record<string, number>;
57
59
  }
58
60
  interface CIMetadata {
59
61
  readonly provider: CIProvider;
@@ -94,6 +96,7 @@ interface TestResult {
94
96
  readonly networkRequests: CapturedNetworkRequest[] | null;
95
97
  readonly apiCalls: readonly ApiCallRecord[] | null;
96
98
  readonly apiAssertions: readonly ApiAssertion[] | null;
99
+ readonly actions: readonly ActionStep[] | null;
97
100
  }
98
101
  type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';
99
102
  interface CapturedNetworkRequest {
@@ -262,6 +265,19 @@ interface ApiCallStep {
262
265
  }
263
266
  /** Discriminated union of all timeline step types. */
264
267
  type TimelineStep = NavigationStep | ApiCallStep;
268
+ /** Categorized type of a captured test action. */
269
+ type ActionCategory = 'ui_action' | 'assertion' | 'custom_step';
270
+ /** A single captured test action step. */
271
+ interface ActionStep {
272
+ readonly title: string;
273
+ readonly category: ActionCategory;
274
+ readonly timestamp: string;
275
+ readonly duration: number;
276
+ readonly videoOffset: number | null;
277
+ readonly status: 'passed' | 'failed';
278
+ readonly error: string | null;
279
+ readonly children: readonly ActionStep[];
280
+ }
265
281
  interface ReporterConfig {
266
282
  readonly outputPath?: string;
267
283
  readonly includeStackTrace?: boolean;
@@ -279,6 +295,8 @@ interface ReporterConfig {
279
295
  readonly trackApiCalls?: boolean;
280
296
  /** When true, suppresses console summary output. Default: false */
281
297
  readonly quiet?: boolean;
298
+ /** When true, captures Playwright test steps (actions). Default: true */
299
+ readonly includeActionSteps?: boolean;
282
300
  /** Capture request headers for API calls. Default: true */
283
301
  readonly captureRequestHeaders?: boolean;
284
302
  /** Capture response headers for API calls. Default: true */
@@ -395,4 +413,4 @@ declare function isValidNavigationType(value: unknown): value is NavigationType;
395
413
  declare function isValidConfig(input: unknown): input is ReporterConfig;
396
414
  declare function isValidTestRunReport(value: unknown): value is TestRunReport;
397
415
 
398
- export { ATTACHMENT_CONTENT_TYPE, ATTACHMENT_NAME, type ApiAssertion, type ApiCallRecord, type ApiCallStep, type ApiCallStepRequest, type ApiCallStepResponse, type AssertionLocation, type AssertionType, type CIMetadata, type CIProvider, type CapturedNetworkRequest, ErrorCode, type FailureDiagnostic, type LogLevel, type Logger, type LoggerOptions, type MergeOptions, type NavigationAnnotation, type NavigationStep, type NavigationType, type NetworkStats, PAYLOAD_VERSION, type ReporterConfig, type ResourceBreakdown, type ResourceType, type StepAssertion, type StepTestIdentity, type Summary, type TestArtifacts, type TestRelicDataPayload, TestRelicError, type TestResult, type TestRunReport, type TestStatus, type TestType, type TimelineEntry, type TimelineStep, createError, createLogger, isTestRelicDataPayload, isValidConfig, isValidNavigationType, isValidTestRunReport };
416
+ export { ATTACHMENT_CONTENT_TYPE, ATTACHMENT_NAME, type ActionCategory, type ActionStep, type ApiAssertion, type ApiCallRecord, type ApiCallStep, type ApiCallStepRequest, type ApiCallStepResponse, type AssertionLocation, type AssertionType, type CIMetadata, type CIProvider, type CapturedNetworkRequest, ErrorCode, type FailureDiagnostic, type LogLevel, type Logger, type LoggerOptions, type MergeOptions, type NavigationAnnotation, type NavigationStep, type NavigationType, type NetworkStats, PAYLOAD_VERSION, type ReporterConfig, type ResourceBreakdown, type ResourceType, type StepAssertion, type StepTestIdentity, type Summary, type TestArtifacts, type TestRelicDataPayload, TestRelicError, type TestResult, type TestRunReport, type TestStatus, type TestType, type TimelineEntry, type TimelineStep, createError, createLogger, isTestRelicDataPayload, isValidConfig, isValidNavigationType, isValidTestRunReport };
package/dist/index.d.ts CHANGED
@@ -54,6 +54,8 @@ interface Summary {
54
54
  readonly totalNavigations: number;
55
55
  readonly uniqueNavigationUrls: number;
56
56
  readonly totalTimelineSteps: number;
57
+ readonly totalActionSteps: number;
58
+ readonly actionStepsByCategory: Record<string, number>;
57
59
  }
58
60
  interface CIMetadata {
59
61
  readonly provider: CIProvider;
@@ -94,6 +96,7 @@ interface TestResult {
94
96
  readonly networkRequests: CapturedNetworkRequest[] | null;
95
97
  readonly apiCalls: readonly ApiCallRecord[] | null;
96
98
  readonly apiAssertions: readonly ApiAssertion[] | null;
99
+ readonly actions: readonly ActionStep[] | null;
97
100
  }
98
101
  type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';
99
102
  interface CapturedNetworkRequest {
@@ -262,6 +265,19 @@ interface ApiCallStep {
262
265
  }
263
266
  /** Discriminated union of all timeline step types. */
264
267
  type TimelineStep = NavigationStep | ApiCallStep;
268
+ /** Categorized type of a captured test action. */
269
+ type ActionCategory = 'ui_action' | 'assertion' | 'custom_step';
270
+ /** A single captured test action step. */
271
+ interface ActionStep {
272
+ readonly title: string;
273
+ readonly category: ActionCategory;
274
+ readonly timestamp: string;
275
+ readonly duration: number;
276
+ readonly videoOffset: number | null;
277
+ readonly status: 'passed' | 'failed';
278
+ readonly error: string | null;
279
+ readonly children: readonly ActionStep[];
280
+ }
265
281
  interface ReporterConfig {
266
282
  readonly outputPath?: string;
267
283
  readonly includeStackTrace?: boolean;
@@ -279,6 +295,8 @@ interface ReporterConfig {
279
295
  readonly trackApiCalls?: boolean;
280
296
  /** When true, suppresses console summary output. Default: false */
281
297
  readonly quiet?: boolean;
298
+ /** When true, captures Playwright test steps (actions). Default: true */
299
+ readonly includeActionSteps?: boolean;
282
300
  /** Capture request headers for API calls. Default: true */
283
301
  readonly captureRequestHeaders?: boolean;
284
302
  /** Capture response headers for API calls. Default: true */
@@ -395,4 +413,4 @@ declare function isValidNavigationType(value: unknown): value is NavigationType;
395
413
  declare function isValidConfig(input: unknown): input is ReporterConfig;
396
414
  declare function isValidTestRunReport(value: unknown): value is TestRunReport;
397
415
 
398
- export { ATTACHMENT_CONTENT_TYPE, ATTACHMENT_NAME, type ApiAssertion, type ApiCallRecord, type ApiCallStep, type ApiCallStepRequest, type ApiCallStepResponse, type AssertionLocation, type AssertionType, type CIMetadata, type CIProvider, type CapturedNetworkRequest, ErrorCode, type FailureDiagnostic, type LogLevel, type Logger, type LoggerOptions, type MergeOptions, type NavigationAnnotation, type NavigationStep, type NavigationType, type NetworkStats, PAYLOAD_VERSION, type ReporterConfig, type ResourceBreakdown, type ResourceType, type StepAssertion, type StepTestIdentity, type Summary, type TestArtifacts, type TestRelicDataPayload, TestRelicError, type TestResult, type TestRunReport, type TestStatus, type TestType, type TimelineEntry, type TimelineStep, createError, createLogger, isTestRelicDataPayload, isValidConfig, isValidNavigationType, isValidTestRunReport };
416
+ export { ATTACHMENT_CONTENT_TYPE, ATTACHMENT_NAME, type ActionCategory, type ActionStep, type ApiAssertion, type ApiCallRecord, type ApiCallStep, type ApiCallStepRequest, type ApiCallStepResponse, type AssertionLocation, type AssertionType, type CIMetadata, type CIProvider, type CapturedNetworkRequest, ErrorCode, type FailureDiagnostic, type LogLevel, type Logger, type LoggerOptions, type MergeOptions, type NavigationAnnotation, type NavigationStep, type NavigationType, type NetworkStats, PAYLOAD_VERSION, type ReporterConfig, type ResourceBreakdown, type ResourceType, type StepAssertion, type StepTestIdentity, type Summary, type TestArtifacts, type TestRelicDataPayload, TestRelicError, type TestResult, type TestRunReport, type TestStatus, type TestType, type TimelineEntry, type TimelineStep, createError, createLogger, isTestRelicDataPayload, isValidConfig, isValidNavigationType, isValidTestRunReport };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts","../src/logger.ts","../src/errors.ts","../src/validation.ts"],"sourcesContent":["/**\n * @testrelic/core — Shared type definitions\n *\n * All interfaces for the JSON output schema, reporter configuration,\n * and internal fixture-to-reporter communication.\n *\n * Schema Version: 1.0.0\n */\n\n// ---------------------------------------------------------------------------\n// Navigation Types\n// ---------------------------------------------------------------------------\n\nexport type NavigationType =\n | 'goto'\n | 'navigation'\n | 'back'\n | 'forward'\n | 'refresh'\n | 'spa_route'\n | 'spa_replace'\n | 'hash_change'\n | 'link_click'\n | 'form_submit'\n | 'redirect'\n | 'popstate'\n | 'page_load'\n | 'manual_record'\n | 'fallback'\n | 'dummy';\n\n// ---------------------------------------------------------------------------\n// Output Schema Types (JSON report structure)\n// ---------------------------------------------------------------------------\n\nexport interface TestRunReport {\n readonly schemaVersion: string;\n readonly testRunId: string;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly totalDuration: number;\n readonly summary: Summary;\n readonly ci: CIMetadata | null;\n readonly metadata: Record<string, unknown> | null;\n readonly timeline: readonly (TimelineEntry | TimelineStep)[];\n readonly shardRunIds: string[] | null;\n}\n\n/** Breakdown of API calls by HTTP response status range. */\nexport interface ApiCallsByStatusRange {\n readonly '2xx': number;\n readonly '3xx': number;\n readonly '4xx': number;\n readonly '5xx': number;\n readonly error: number;\n}\n\n/** Statistical distribution of API call response times in milliseconds. */\nexport interface ApiResponseTimeStats {\n readonly avg: number;\n readonly min: number;\n readonly max: number;\n readonly p50: number;\n readonly p95: number;\n readonly p99: number;\n}\n\nexport interface Summary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedout: number;\n readonly totalApiCalls: number;\n readonly uniqueApiUrls: number;\n readonly apiCallsByMethod: Record<string, number>;\n readonly apiCallsByStatusRange: ApiCallsByStatusRange;\n readonly apiResponseTime: ApiResponseTimeStats | null;\n readonly totalAssertions: number;\n readonly passedAssertions: number;\n readonly failedAssertions: number;\n readonly totalNavigations: number;\n readonly uniqueNavigationUrls: number;\n readonly totalTimelineSteps: number;\n}\n\nexport interface CIMetadata {\n readonly provider: CIProvider;\n readonly buildId: string | null;\n readonly commitSha: string | null;\n readonly branch: string | null;\n}\n\nexport type CIProvider =\n | 'github-actions'\n | 'gitlab-ci'\n | 'jenkins'\n | 'circleci'\n | 'unknown';\n\nexport interface TimelineEntry {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly visitedAt: string;\n readonly duration: number;\n readonly specFile: string;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly tests: TestResult[];\n}\n\nexport interface TestResult {\n readonly title: string;\n readonly status: TestStatus;\n readonly duration: number;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly retryCount: number;\n readonly tags: string[];\n readonly failure: FailureDiagnostic | null;\n readonly testId: string;\n readonly filePath: string;\n readonly suiteName: string;\n readonly testType: TestType;\n readonly isFlaky: boolean;\n readonly retryStatus: string | null;\n readonly expectedStatus: TestStatus;\n readonly actualStatus: TestStatus;\n readonly artifacts: TestArtifacts | null;\n readonly networkRequests: CapturedNetworkRequest[] | null;\n readonly apiCalls: readonly ApiCallRecord[] | null;\n readonly apiAssertions: readonly ApiAssertion[] | null;\n}\n\nexport type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';\n\nexport interface CapturedNetworkRequest {\n readonly url: string;\n readonly method: string;\n readonly resourceType: ResourceType;\n readonly statusCode: number;\n readonly responseTimeMs: number;\n readonly startedAt: string;\n readonly requestHeaders: Record<string, string> | null;\n readonly requestBody: string | null;\n readonly responseBody: string | null;\n readonly responseHeaders: Record<string, string> | null;\n readonly contentType: string | null;\n readonly responseSize: number;\n readonly requestBodyTruncated: boolean;\n readonly responseBodyTruncated: boolean;\n readonly isBinary: boolean;\n readonly error: string | null;\n}\n\nexport interface TestArtifacts {\n readonly screenshot?: string;\n readonly video?: string;\n}\n\nexport type TestStatus = 'passed' | 'failed' | 'skipped' | 'flaky' | 'timedout';\n\nexport type TestType = 'e2e' | 'api' | 'unit' | 'unknown';\n\nexport interface FailureDiagnostic {\n readonly message: string;\n readonly line: number | null;\n readonly code: string | null;\n readonly stack: string | null;\n}\n\nexport interface NetworkStats {\n readonly totalRequests: number;\n readonly failedRequests: number;\n readonly failedRequestUrls: string[];\n readonly totalBytes: number;\n readonly byType: ResourceBreakdown;\n}\n\nexport interface ResourceBreakdown {\n readonly xhr: number;\n readonly document: number;\n readonly script: number;\n readonly stylesheet: number;\n readonly image: number;\n readonly font: number;\n readonly other: number;\n}\n\n// ---------------------------------------------------------------------------\n// API Call Record (captured from Playwright APIRequestContext proxy)\n// ---------------------------------------------------------------------------\n\nexport interface ApiCallRecord {\n /** Unique call identifier within the test (e.g., \"api-call-0\") */\n readonly id: string;\n /** ISO 8601 timestamp when the call was initiated */\n readonly timestamp: string;\n /** HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, or custom via fetch() */\n readonly method: string;\n /** Full resolved URL (after baseURL resolution by Playwright) */\n readonly url: string;\n /** All request headers sent, or null if unavailable */\n readonly requestHeaders: Record<string, string> | null;\n /** Request payload as string (JSON-serialized for objects). Null for bodiless methods */\n readonly requestBody: string | null;\n /** HTTP response status code, or null if request errored before response */\n readonly responseStatusCode: number | null;\n /** HTTP response status text, or null if request errored before response */\n readonly responseStatusText: string | null;\n /** All response headers received, or null if request errored before response */\n readonly responseHeaders: Record<string, string> | null;\n /** Response body: string for text/JSON, base64 for binary. Null on error */\n readonly responseBody: string | null;\n /** Duration in milliseconds from request initiation to response received */\n readonly responseTimeMs: number;\n /** Whether the response body is stored as a base64-encoded binary string */\n readonly isBinary: boolean;\n /** Error message if the call failed (network error, timeout), null on success */\n readonly error: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// API Assertion Types (captured from assertion tracking)\n// ---------------------------------------------------------------------------\n\n/** Categorization of the assertion being made. */\nexport type AssertionType =\n | 'status'\n | 'statusOk'\n | 'header'\n | 'bodyField'\n | 'bodyMatch'\n | 'bodyContains'\n | 'custom';\n\n/** Source location where an assertion was made in the test file. */\nexport interface AssertionLocation {\n /** Absolute or relative file path to the test file */\n readonly file: string;\n /** Line number (1-based) */\n readonly line: number;\n /** Column number (1-based), if available */\n readonly column?: number;\n}\n\n/** A single captured assertion on API response data. */\nexport interface ApiAssertion {\n /** Links to ApiCallRecord.id from the API proxy */\n readonly callId: string;\n /** Category of assertion */\n readonly type: AssertionType;\n /** What the test expected */\n readonly expected: unknown;\n /** What was actually received */\n readonly actual: unknown;\n /** Whether the assertion passed or failed */\n readonly status: 'passed' | 'failed';\n /** Source location of the assertion in the test file */\n readonly location: AssertionLocation;\n /** String representation of the assertion expression (best-effort) */\n readonly expression?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Unified Timeline Types (navigation + API call steps)\n// ---------------------------------------------------------------------------\n\n/** Test identity block attached to every timeline step. */\nexport interface StepTestIdentity {\n readonly title: string;\n readonly fullTitle: readonly string[];\n readonly status: TestStatus;\n readonly duration: number;\n readonly retries: number;\n readonly retry: number;\n readonly tags: readonly string[];\n readonly failure: FailureDiagnostic | null;\n}\n\n/** Request details within an API call step. */\nexport interface ApiCallStepRequest {\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** Response details within an API call step. */\nexport interface ApiCallStepResponse {\n readonly statusCode: number;\n readonly statusText: string;\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** An assertion linked to an API call step (callId omitted — implicit from parent). */\nexport interface StepAssertion {\n readonly type: AssertionType;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly status: 'passed' | 'failed';\n readonly location: AssertionLocation;\n readonly expression?: string;\n}\n\n/** A browser navigation event in the unified timeline. */\nexport interface NavigationStep {\n readonly index: number;\n readonly type: 'navigation';\n readonly url: string;\n readonly timestamp: string;\n readonly durationOnUrl: number;\n readonly navigationType: NavigationType;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** An API request event in the unified timeline. */\nexport interface ApiCallStep {\n readonly index: number;\n readonly type: 'api_call';\n readonly callId: string;\n readonly method: string;\n readonly url: string;\n readonly timestamp: string;\n readonly responseTime: number | null;\n readonly request: ApiCallStepRequest;\n readonly response: ApiCallStepResponse | null;\n readonly error?: string | null;\n readonly assertions: readonly StepAssertion[];\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** Discriminated union of all timeline step types. */\nexport type TimelineStep = NavigationStep | ApiCallStep;\n\n// ---------------------------------------------------------------------------\n// Configuration Types (reporter tuple options)\n// ---------------------------------------------------------------------------\n\nexport interface ReporterConfig {\n readonly outputPath?: string;\n readonly includeStackTrace?: boolean;\n readonly includeCodeSnippets?: boolean;\n readonly codeContextLines?: number;\n readonly includeNetworkStats?: boolean;\n readonly navigationTypes?: NavigationType[] | null;\n readonly redactPatterns?: (string | RegExp)[];\n readonly testRunId?: string | null;\n readonly metadata?: Record<string, unknown> | null;\n readonly openReport?: boolean;\n readonly htmlReportPath?: string;\n readonly includeArtifacts?: boolean;\n /** When false, disables API call interception in the unified fixture. Default: true */\n readonly trackApiCalls?: boolean;\n /** When true, suppresses console summary output. Default: false */\n readonly quiet?: boolean;\n /** Capture request headers for API calls. Default: true */\n readonly captureRequestHeaders?: boolean;\n /** Capture response headers for API calls. Default: true */\n readonly captureResponseHeaders?: boolean;\n /** Capture request body for API calls. Default: true */\n readonly captureRequestBody?: boolean;\n /** Capture response body for API calls. Default: true */\n readonly captureResponseBody?: boolean;\n /** Capture API assertions (both pass and fail). Default: true */\n readonly captureAssertions?: boolean;\n /**\n * Header names whose values are replaced with \"[REDACTED]\".\n * Case-insensitive matching. Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key']\n */\n readonly redactHeaders?: string[];\n /**\n * Body field names whose values are replaced with \"[REDACTED]\" at any depth.\n * Default: ['password', 'secret', 'token', 'apiKey', 'api_key']\n */\n readonly redactBodyFields?: string[];\n /**\n * Only track API calls matching these URL patterns.\n * Default: undefined (track all)\n */\n readonly apiIncludeUrls?: (string | RegExp)[];\n /**\n * Exclude API calls matching these URL patterns. Takes precedence over include.\n * Default: undefined (exclude none)\n */\n readonly apiExcludeUrls?: (string | RegExp)[];\n}\n\n// ---------------------------------------------------------------------------\n// Internal Types (fixture → reporter communication)\n// ---------------------------------------------------------------------------\n\nexport interface NavigationAnnotation {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly timestamp: string;\n readonly domContentLoadedAt?: string;\n readonly networkIdleAt?: string;\n readonly networkStats?: NetworkStats;\n}\n\n// ---------------------------------------------------------------------------\n// Worker-Safe Data Payload (worker → reporter communication)\n// ---------------------------------------------------------------------------\n\n/** Consolidated data payload sent from a worker fixture to the reporter. */\nexport interface TestRelicDataPayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version (semver). */\n readonly version: string;\n /** Navigation events collected during the test. */\n readonly navigations: readonly NavigationAnnotation[];\n /** Captured network requests during the test. */\n readonly networkRequests: readonly CapturedNetworkRequest[];\n /** API calls made via APIRequestContext proxy. */\n readonly apiCalls: readonly ApiCallRecord[];\n /** Assertions captured on API responses. */\n readonly apiAssertions: readonly ApiAssertion[];\n}\n\n/** Current payload format version. */\nexport const PAYLOAD_VERSION = '1.0.0';\n\n/** Attachment name used for the consolidated payload. */\nexport const ATTACHMENT_NAME = 'testrelic-data';\n\n/** Attachment content type. */\nexport const ATTACHMENT_CONTENT_TYPE = 'application/json';\n\n/** Type guard: validates that a parsed object is a TestRelicDataPayload. */\nexport function isTestRelicDataPayload(obj: unknown): obj is TestRelicDataPayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n typeof record.version === 'string' &&\n record.version.length > 0 &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.networkRequests) &&\n Array.isArray(record.apiCalls) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merge CLI Types\n// ---------------------------------------------------------------------------\n\nexport interface MergeOptions {\n readonly output: string;\n readonly testRunId?: string;\n}\n","/**\n * @testrelic/core — Configurable logger\n *\n * Provides a Logger interface with a no-op default.\n * Never uses console.* directly (Constitution SDK Constraint).\n */\n\nexport interface Logger {\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n debug(message: string, ...args: unknown[]): void;\n}\n\nexport interface LoggerOptions {\n readonly handler?: (level: LogLevel, message: string, args: unknown[]) => void;\n}\n\nexport type LogLevel = 'info' | 'warn' | 'error' | 'debug';\n\ntype LogHandler = (level: LogLevel, message: string, args: unknown[]) => void;\n\nconst noopHandler: LogHandler = () => {};\n\nexport function createLogger(options?: LoggerOptions): Logger {\n const handler = options?.handler ?? noopHandler;\n\n return {\n info(message: string, ...args: unknown[]) {\n handler('info', message, args);\n },\n warn(message: string, ...args: unknown[]) {\n handler('warn', message, args);\n },\n error(message: string, ...args: unknown[]) {\n handler('error', message, args);\n },\n debug(message: string, ...args: unknown[]) {\n handler('debug', message, args);\n },\n };\n}\n","/**\n * @testrelic/core — Structured error factory\n *\n * Machine-readable error codes for programmatic handling.\n */\n\nexport const ErrorCode = {\n CONFIG_INVALID: 'TESTRELIC_CONFIG_INVALID',\n OUTPUT_WRITE_FAILED: 'TESTRELIC_OUTPUT_WRITE_FAILED',\n MERGE_INVALID_SCHEMA: 'TESTRELIC_MERGE_INVALID_SCHEMA',\n MERGE_READ_FAILED: 'TESTRELIC_MERGE_READ_FAILED',\n NAVIGATION_FLUSH_FAILED: 'TESTRELIC_NAVIGATION_FLUSH_FAILED',\n CODE_EXTRACT_FAILED: 'TESTRELIC_CODE_EXTRACT_FAILED',\n HTML_REPORT_FAILED: 'TESTRELIC_HTML_REPORT_FAILED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\nexport class TestRelicError extends Error {\n readonly code: ErrorCode;\n\n constructor(code: ErrorCode, message: string, cause?: unknown) {\n super(message);\n this.name = 'TestRelicError';\n this.code = code;\n if (cause !== undefined) {\n Object.defineProperty(this, 'cause', { value: cause, writable: false, enumerable: false });\n }\n }\n}\n\nexport function createError(\n code: ErrorCode,\n message: string,\n cause?: unknown,\n): TestRelicError {\n return new TestRelicError(code, message, cause);\n}\n","/**\n * @testrelic/core — Lightweight runtime type guards\n *\n * Hand-written guards, no runtime schema libraries (Constitution SDK Constraint).\n */\n\nimport type {\n ReporterConfig,\n NavigationType,\n TestRunReport,\n} from './types.js';\n\nconst NAVIGATION_TYPES = new Set<string>([\n 'goto', 'navigation', 'back', 'forward', 'refresh',\n 'spa_route', 'spa_replace', 'hash_change', 'link_click',\n 'form_submit', 'redirect', 'popstate', 'page_load',\n 'manual_record', 'fallback', 'dummy',\n]);\n\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nexport function isValidNavigationType(value: unknown): value is NavigationType {\n return typeof value === 'string' && NAVIGATION_TYPES.has(value);\n}\n\nfunction hasNoPrototypePollution(obj: unknown): boolean {\n if (typeof obj !== 'object' || obj === null) return true;\n for (const key of Object.keys(obj)) {\n if (DANGEROUS_KEYS.has(key)) return false;\n }\n return true;\n}\n\nexport function isValidConfig(input: unknown): input is ReporterConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.outputPath !== undefined && typeof obj.outputPath !== 'string') return false;\n if (obj.includeStackTrace !== undefined && typeof obj.includeStackTrace !== 'boolean') return false;\n if (obj.includeCodeSnippets !== undefined && typeof obj.includeCodeSnippets !== 'boolean') return false;\n if (obj.codeContextLines !== undefined && typeof obj.codeContextLines !== 'number') return false;\n if (obj.includeNetworkStats !== undefined && typeof obj.includeNetworkStats !== 'boolean') return false;\n\n if (obj.navigationTypes !== undefined && obj.navigationTypes !== null) {\n if (!Array.isArray(obj.navigationTypes)) return false;\n for (const t of obj.navigationTypes) {\n if (!isValidNavigationType(t)) return false;\n }\n }\n\n if (obj.redactPatterns !== undefined) {\n if (!Array.isArray(obj.redactPatterns)) return false;\n for (const p of obj.redactPatterns) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.testRunId !== undefined && obj.testRunId !== null && typeof obj.testRunId !== 'string') return false;\n\n if (obj.metadata !== undefined && obj.metadata !== null) {\n if (typeof obj.metadata !== 'object') return false;\n if (!hasNoPrototypePollution(obj.metadata)) return false;\n }\n\n if (obj.openReport !== undefined && typeof obj.openReport !== 'boolean') return false;\n if (obj.htmlReportPath !== undefined && (typeof obj.htmlReportPath !== 'string' || obj.htmlReportPath === '')) return false;\n if (obj.includeArtifacts !== undefined && typeof obj.includeArtifacts !== 'boolean') return false;\n\n // API tracking configuration\n if (obj.trackApiCalls !== undefined && typeof obj.trackApiCalls !== 'boolean') return false;\n if (obj.captureRequestHeaders !== undefined && typeof obj.captureRequestHeaders !== 'boolean') return false;\n if (obj.captureResponseHeaders !== undefined && typeof obj.captureResponseHeaders !== 'boolean') return false;\n if (obj.captureRequestBody !== undefined && typeof obj.captureRequestBody !== 'boolean') return false;\n if (obj.captureResponseBody !== undefined && typeof obj.captureResponseBody !== 'boolean') return false;\n if (obj.captureAssertions !== undefined && typeof obj.captureAssertions !== 'boolean') return false;\n\n if (obj.redactHeaders !== undefined) {\n if (!Array.isArray(obj.redactHeaders)) return false;\n for (const h of obj.redactHeaders) {\n if (typeof h !== 'string') return false;\n }\n }\n\n if (obj.redactBodyFields !== undefined) {\n if (!Array.isArray(obj.redactBodyFields)) return false;\n for (const f of obj.redactBodyFields) {\n if (typeof f !== 'string') return false;\n }\n }\n\n if (obj.apiIncludeUrls !== undefined) {\n if (!Array.isArray(obj.apiIncludeUrls)) return false;\n for (const p of obj.apiIncludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.apiExcludeUrls !== undefined) {\n if (!Array.isArray(obj.apiExcludeUrls)) return false;\n for (const p of obj.apiExcludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n return true;\n}\n\nexport function isValidTestRunReport(value: unknown): value is TestRunReport {\n if (typeof value !== 'object' || value === null) return false;\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.schemaVersion !== 'string') return false;\n if (typeof obj.testRunId !== 'string') return false;\n if (typeof obj.startedAt !== 'string') return false;\n if (typeof obj.completedAt !== 'string') return false;\n if (typeof obj.totalDuration !== 'number') return false;\n if (typeof obj.summary !== 'object' || obj.summary === null) return false;\n if (!Array.isArray(obj.timeline)) return false;\n\n const summary = obj.summary as Record<string, unknown>;\n if (typeof summary.total !== 'number') return false;\n if (typeof summary.passed !== 'number') return false;\n if (typeof summary.failed !== 'number') return false;\n if (typeof summary.flaky !== 'number') return false;\n if (typeof summary.skipped !== 'number') return false;\n // timedout is optional for backward compat with schema 1.0.0\n if (summary.timedout !== undefined && typeof summary.timedout !== 'number') return false;\n\n return true;\n}\n"],"mappings":";AA4aO,IAAM,kBAAkB;AAGxB,IAAM,kBAAkB;AAGxB,IAAM,0BAA0B;AAGhC,SAAS,uBAAuB,KAA2C;AAChF,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,SAAS;AACf,SACE,OAAO,kBAAkB,QACzB,OAAO,OAAO,YAAY,YAC1B,OAAO,QAAQ,SAAS,KACxB,MAAM,QAAQ,OAAO,WAAW,KAChC,MAAM,QAAQ,OAAO,eAAe,KACpC,MAAM,QAAQ,OAAO,QAAQ,KAC7B,MAAM,QAAQ,OAAO,aAAa;AAEtC;;;AC3aA,IAAM,cAA0B,MAAM;AAAC;AAEhC,SAAS,aAAa,SAAiC;AAC5D,QAAM,UAAU,SAAS,WAAW;AAEpC,SAAO;AAAA,IACL,KAAK,YAAoB,MAAiB;AACxC,cAAQ,QAAQ,SAAS,IAAI;AAAA,IAC/B;AAAA,IACA,KAAK,YAAoB,MAAiB;AACxC,cAAQ,QAAQ,SAAS,IAAI;AAAA,IAC/B;AAAA,IACA,MAAM,YAAoB,M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AA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,OAAwC;AAC3E,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AAExD,QAAM,MAAM;AAEZ,MAAI,OAAO,IAAI,kBAAkB,SAAU,QAAO;AAClD,MAAI,OAAO,IAAI,cAAc,SAAU,QAAO;AAC9C,MAAI,OAAO,IAAI,cAAc,SAAU,QAAO;AAC9C,MAAI,OAAO,IAAI,gBAAgB,SAAU,QAAO;AAChD,MAAI,OAAO,IAAI,kBAAkB,SAAU,QAAO;AAClD,MAAI,OAAO,IAAI,YAAY,YAAY,IAAI,YAAY,KAAM,QAAO;AACpE,MAAI,CAAC,MAAM,QAAQ,IAAI,QAAQ,EAAG,QAAO;AAEzC,QAAM,UAAU,IAAI;AACpB,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,YAAY,SAAU,QAAO;AAEhD,MAAI,QAAQ,aAAa,UAAa,OAAO,QAAQ,aAAa,SAAU,QAAO;AAEnF,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/types.ts","../src/logger.ts","../src/errors.ts","../src/validation.ts"],"sourcesContent":["/**\n * @testrelic/core — Shared type definitions\n *\n * All interfaces for the JSON output schema, reporter configuration,\n * and internal fixture-to-reporter communication.\n *\n * Schema Version: 1.0.0\n */\n\n// ---------------------------------------------------------------------------\n// Navigation Types\n// ---------------------------------------------------------------------------\n\nexport type NavigationType =\n | 'goto'\n | 'navigation'\n | 'back'\n | 'forward'\n | 'refresh'\n | 'spa_route'\n | 'spa_replace'\n | 'hash_change'\n | 'link_click'\n | 'form_submit'\n | 'redirect'\n | 'popstate'\n | 'page_load'\n | 'manual_record'\n | 'fallback'\n | 'dummy';\n\n// ---------------------------------------------------------------------------\n// Output Schema Types (JSON report structure)\n// ---------------------------------------------------------------------------\n\nexport interface TestRunReport {\n readonly schemaVersion: string;\n readonly testRunId: string;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly totalDuration: number;\n readonly summary: Summary;\n readonly ci: CIMetadata | null;\n readonly metadata: Record<string, unknown> | null;\n readonly timeline: readonly (TimelineEntry | TimelineStep)[];\n readonly shardRunIds: string[] | null;\n}\n\n/** Breakdown of API calls by HTTP response status range. */\nexport interface ApiCallsByStatusRange {\n readonly '2xx': number;\n readonly '3xx': number;\n readonly '4xx': number;\n readonly '5xx': number;\n readonly error: number;\n}\n\n/** Statistical distribution of API call response times in milliseconds. */\nexport interface ApiResponseTimeStats {\n readonly avg: number;\n readonly min: number;\n readonly max: number;\n readonly p50: number;\n readonly p95: number;\n readonly p99: number;\n}\n\nexport interface Summary {\n readonly total: number;\n readonly passed: number;\n readonly failed: number;\n readonly flaky: number;\n readonly skipped: number;\n readonly timedout: number;\n readonly totalApiCalls: number;\n readonly uniqueApiUrls: number;\n readonly apiCallsByMethod: Record<string, number>;\n readonly apiCallsByStatusRange: ApiCallsByStatusRange;\n readonly apiResponseTime: ApiResponseTimeStats | null;\n readonly totalAssertions: number;\n readonly passedAssertions: number;\n readonly failedAssertions: number;\n readonly totalNavigations: number;\n readonly uniqueNavigationUrls: number;\n readonly totalTimelineSteps: number;\n readonly totalActionSteps: number;\n readonly actionStepsByCategory: Record<string, number>;\n}\n\nexport interface CIMetadata {\n readonly provider: CIProvider;\n readonly buildId: string | null;\n readonly commitSha: string | null;\n readonly branch: string | null;\n}\n\nexport type CIProvider =\n | 'github-actions'\n | 'gitlab-ci'\n | 'jenkins'\n | 'circleci'\n | 'unknown';\n\nexport interface TimelineEntry {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly visitedAt: string;\n readonly duration: number;\n readonly specFile: string;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly tests: TestResult[];\n}\n\nexport interface TestResult {\n readonly title: string;\n readonly status: TestStatus;\n readonly duration: number;\n readonly startedAt: string;\n readonly completedAt: string;\n readonly retryCount: number;\n readonly tags: string[];\n readonly failure: FailureDiagnostic | null;\n readonly testId: string;\n readonly filePath: string;\n readonly suiteName: string;\n readonly testType: TestType;\n readonly isFlaky: boolean;\n readonly retryStatus: string | null;\n readonly expectedStatus: TestStatus;\n readonly actualStatus: TestStatus;\n readonly artifacts: TestArtifacts | null;\n readonly networkRequests: CapturedNetworkRequest[] | null;\n readonly apiCalls: readonly ApiCallRecord[] | null;\n readonly apiAssertions: readonly ApiAssertion[] | null;\n readonly actions: readonly ActionStep[] | null;\n}\n\nexport type ResourceType = 'xhr' | 'document' | 'script' | 'stylesheet' | 'image' | 'font' | 'other';\n\nexport interface CapturedNetworkRequest {\n readonly url: string;\n readonly method: string;\n readonly resourceType: ResourceType;\n readonly statusCode: number;\n readonly responseTimeMs: number;\n readonly startedAt: string;\n readonly requestHeaders: Record<string, string> | null;\n readonly requestBody: string | null;\n readonly responseBody: string | null;\n readonly responseHeaders: Record<string, string> | null;\n readonly contentType: string | null;\n readonly responseSize: number;\n readonly requestBodyTruncated: boolean;\n readonly responseBodyTruncated: boolean;\n readonly isBinary: boolean;\n readonly error: string | null;\n}\n\nexport interface TestArtifacts {\n readonly screenshot?: string;\n readonly video?: string;\n}\n\nexport type TestStatus = 'passed' | 'failed' | 'skipped' | 'flaky' | 'timedout';\n\nexport type TestType = 'e2e' | 'api' | 'unit' | 'unknown';\n\nexport interface FailureDiagnostic {\n readonly message: string;\n readonly line: number | null;\n readonly code: string | null;\n readonly stack: string | null;\n}\n\nexport interface NetworkStats {\n readonly totalRequests: number;\n readonly failedRequests: number;\n readonly failedRequestUrls: string[];\n readonly totalBytes: number;\n readonly byType: ResourceBreakdown;\n}\n\nexport interface ResourceBreakdown {\n readonly xhr: number;\n readonly document: number;\n readonly script: number;\n readonly stylesheet: number;\n readonly image: number;\n readonly font: number;\n readonly other: number;\n}\n\n// ---------------------------------------------------------------------------\n// API Call Record (captured from Playwright APIRequestContext proxy)\n// ---------------------------------------------------------------------------\n\nexport interface ApiCallRecord {\n /** Unique call identifier within the test (e.g., \"api-call-0\") */\n readonly id: string;\n /** ISO 8601 timestamp when the call was initiated */\n readonly timestamp: string;\n /** HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, or custom via fetch() */\n readonly method: string;\n /** Full resolved URL (after baseURL resolution by Playwright) */\n readonly url: string;\n /** All request headers sent, or null if unavailable */\n readonly requestHeaders: Record<string, string> | null;\n /** Request payload as string (JSON-serialized for objects). Null for bodiless methods */\n readonly requestBody: string | null;\n /** HTTP response status code, or null if request errored before response */\n readonly responseStatusCode: number | null;\n /** HTTP response status text, or null if request errored before response */\n readonly responseStatusText: string | null;\n /** All response headers received, or null if request errored before response */\n readonly responseHeaders: Record<string, string> | null;\n /** Response body: string for text/JSON, base64 for binary. Null on error */\n readonly responseBody: string | null;\n /** Duration in milliseconds from request initiation to response received */\n readonly responseTimeMs: number;\n /** Whether the response body is stored as a base64-encoded binary string */\n readonly isBinary: boolean;\n /** Error message if the call failed (network error, timeout), null on success */\n readonly error: string | null;\n}\n\n// ---------------------------------------------------------------------------\n// API Assertion Types (captured from assertion tracking)\n// ---------------------------------------------------------------------------\n\n/** Categorization of the assertion being made. */\nexport type AssertionType =\n | 'status'\n | 'statusOk'\n | 'header'\n | 'bodyField'\n | 'bodyMatch'\n | 'bodyContains'\n | 'custom';\n\n/** Source location where an assertion was made in the test file. */\nexport interface AssertionLocation {\n /** Absolute or relative file path to the test file */\n readonly file: string;\n /** Line number (1-based) */\n readonly line: number;\n /** Column number (1-based), if available */\n readonly column?: number;\n}\n\n/** A single captured assertion on API response data. */\nexport interface ApiAssertion {\n /** Links to ApiCallRecord.id from the API proxy */\n readonly callId: string;\n /** Category of assertion */\n readonly type: AssertionType;\n /** What the test expected */\n readonly expected: unknown;\n /** What was actually received */\n readonly actual: unknown;\n /** Whether the assertion passed or failed */\n readonly status: 'passed' | 'failed';\n /** Source location of the assertion in the test file */\n readonly location: AssertionLocation;\n /** String representation of the assertion expression (best-effort) */\n readonly expression?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Unified Timeline Types (navigation + API call steps)\n// ---------------------------------------------------------------------------\n\n/** Test identity block attached to every timeline step. */\nexport interface StepTestIdentity {\n readonly title: string;\n readonly fullTitle: readonly string[];\n readonly status: TestStatus;\n readonly duration: number;\n readonly retries: number;\n readonly retry: number;\n readonly tags: readonly string[];\n readonly failure: FailureDiagnostic | null;\n}\n\n/** Request details within an API call step. */\nexport interface ApiCallStepRequest {\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** Response details within an API call step. */\nexport interface ApiCallStepResponse {\n readonly statusCode: number;\n readonly statusText: string;\n readonly headers: Record<string, string> | null;\n readonly body: unknown;\n}\n\n/** An assertion linked to an API call step (callId omitted — implicit from parent). */\nexport interface StepAssertion {\n readonly type: AssertionType;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly status: 'passed' | 'failed';\n readonly location: AssertionLocation;\n readonly expression?: string;\n}\n\n/** A browser navigation event in the unified timeline. */\nexport interface NavigationStep {\n readonly index: number;\n readonly type: 'navigation';\n readonly url: string;\n readonly timestamp: string;\n readonly durationOnUrl: number;\n readonly navigationType: NavigationType;\n readonly domContentLoadedAt: string | null;\n readonly networkIdleAt: string | null;\n readonly networkStats: NetworkStats | null;\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** An API request event in the unified timeline. */\nexport interface ApiCallStep {\n readonly index: number;\n readonly type: 'api_call';\n readonly callId: string;\n readonly method: string;\n readonly url: string;\n readonly timestamp: string;\n readonly responseTime: number | null;\n readonly request: ApiCallStepRequest;\n readonly response: ApiCallStepResponse | null;\n readonly error?: string | null;\n readonly assertions: readonly StepAssertion[];\n readonly specFile: string;\n readonly test: StepTestIdentity;\n}\n\n/** Discriminated union of all timeline step types. */\nexport type TimelineStep = NavigationStep | ApiCallStep;\n\n// ---------------------------------------------------------------------------\n// Action Step Types (Playwright test step capture)\n// ---------------------------------------------------------------------------\n\n/** Categorized type of a captured test action. */\nexport type ActionCategory = 'ui_action' | 'assertion' | 'custom_step';\n\n/** A single captured test action step. */\nexport interface ActionStep {\n readonly title: string;\n readonly category: ActionCategory;\n readonly timestamp: string;\n readonly duration: number;\n readonly videoOffset: number | null;\n readonly status: 'passed' | 'failed';\n readonly error: string | null;\n readonly children: readonly ActionStep[];\n}\n\n// ---------------------------------------------------------------------------\n// Configuration Types (reporter tuple options)\n// ---------------------------------------------------------------------------\n\nexport interface ReporterConfig {\n readonly outputPath?: string;\n readonly includeStackTrace?: boolean;\n readonly includeCodeSnippets?: boolean;\n readonly codeContextLines?: number;\n readonly includeNetworkStats?: boolean;\n readonly navigationTypes?: NavigationType[] | null;\n readonly redactPatterns?: (string | RegExp)[];\n readonly testRunId?: string | null;\n readonly metadata?: Record<string, unknown> | null;\n readonly openReport?: boolean;\n readonly htmlReportPath?: string;\n readonly includeArtifacts?: boolean;\n /** When false, disables API call interception in the unified fixture. Default: true */\n readonly trackApiCalls?: boolean;\n /** When true, suppresses console summary output. Default: false */\n readonly quiet?: boolean;\n /** When true, captures Playwright test steps (actions). Default: true */\n readonly includeActionSteps?: boolean;\n /** Capture request headers for API calls. Default: true */\n readonly captureRequestHeaders?: boolean;\n /** Capture response headers for API calls. Default: true */\n readonly captureResponseHeaders?: boolean;\n /** Capture request body for API calls. Default: true */\n readonly captureRequestBody?: boolean;\n /** Capture response body for API calls. Default: true */\n readonly captureResponseBody?: boolean;\n /** Capture API assertions (both pass and fail). Default: true */\n readonly captureAssertions?: boolean;\n /**\n * Header names whose values are replaced with \"[REDACTED]\".\n * Case-insensitive matching. Default: ['authorization', 'cookie', 'set-cookie', 'x-api-key']\n */\n readonly redactHeaders?: string[];\n /**\n * Body field names whose values are replaced with \"[REDACTED]\" at any depth.\n * Default: ['password', 'secret', 'token', 'apiKey', 'api_key']\n */\n readonly redactBodyFields?: string[];\n /**\n * Only track API calls matching these URL patterns.\n * Default: undefined (track all)\n */\n readonly apiIncludeUrls?: (string | RegExp)[];\n /**\n * Exclude API calls matching these URL patterns. Takes precedence over include.\n * Default: undefined (exclude none)\n */\n readonly apiExcludeUrls?: (string | RegExp)[];\n}\n\n// ---------------------------------------------------------------------------\n// Internal Types (fixture → reporter communication)\n// ---------------------------------------------------------------------------\n\nexport interface NavigationAnnotation {\n readonly url: string;\n readonly navigationType: NavigationType;\n readonly timestamp: string;\n readonly domContentLoadedAt?: string;\n readonly networkIdleAt?: string;\n readonly networkStats?: NetworkStats;\n}\n\n// ---------------------------------------------------------------------------\n// Worker-Safe Data Payload (worker → reporter communication)\n// ---------------------------------------------------------------------------\n\n/** Consolidated data payload sent from a worker fixture to the reporter. */\nexport interface TestRelicDataPayload {\n /** Marker to identify TestRelic attachments. Always `true`. */\n readonly testRelicData: true;\n /** Payload format version (semver). */\n readonly version: string;\n /** Navigation events collected during the test. */\n readonly navigations: readonly NavigationAnnotation[];\n /** Captured network requests during the test. */\n readonly networkRequests: readonly CapturedNetworkRequest[];\n /** API calls made via APIRequestContext proxy. */\n readonly apiCalls: readonly ApiCallRecord[];\n /** Assertions captured on API responses. */\n readonly apiAssertions: readonly ApiAssertion[];\n}\n\n/** Current payload format version. */\nexport const PAYLOAD_VERSION = '1.0.0';\n\n/** Attachment name used for the consolidated payload. */\nexport const ATTACHMENT_NAME = 'testrelic-data';\n\n/** Attachment content type. */\nexport const ATTACHMENT_CONTENT_TYPE = 'application/json';\n\n/** Type guard: validates that a parsed object is a TestRelicDataPayload. */\nexport function isTestRelicDataPayload(obj: unknown): obj is TestRelicDataPayload {\n if (typeof obj !== 'object' || obj === null) return false;\n const record = obj as Record<string, unknown>;\n return (\n record.testRelicData === true &&\n typeof record.version === 'string' &&\n record.version.length > 0 &&\n Array.isArray(record.navigations) &&\n Array.isArray(record.networkRequests) &&\n Array.isArray(record.apiCalls) &&\n Array.isArray(record.apiAssertions)\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merge CLI Types\n// ---------------------------------------------------------------------------\n\nexport interface MergeOptions {\n readonly output: string;\n readonly testRunId?: string;\n}\n","/**\n * @testrelic/core — Configurable logger\n *\n * Provides a Logger interface with a no-op default.\n * Never uses console.* directly (Constitution SDK Constraint).\n */\n\nexport interface Logger {\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n debug(message: string, ...args: unknown[]): void;\n}\n\nexport interface LoggerOptions {\n readonly handler?: (level: LogLevel, message: string, args: unknown[]) => void;\n}\n\nexport type LogLevel = 'info' | 'warn' | 'error' | 'debug';\n\ntype LogHandler = (level: LogLevel, message: string, args: unknown[]) => void;\n\nconst noopHandler: LogHandler = () => {};\n\nexport function createLogger(options?: LoggerOptions): Logger {\n const handler = options?.handler ?? noopHandler;\n\n return {\n info(message: string, ...args: unknown[]) {\n handler('info', message, args);\n },\n warn(message: string, ...args: unknown[]) {\n handler('warn', message, args);\n },\n error(message: string, ...args: unknown[]) {\n handler('error', message, args);\n },\n debug(message: string, ...args: unknown[]) {\n handler('debug', message, args);\n },\n };\n}\n","/**\n * @testrelic/core — Structured error factory\n *\n * Machine-readable error codes for programmatic handling.\n */\n\nexport const ErrorCode = {\n CONFIG_INVALID: 'TESTRELIC_CONFIG_INVALID',\n OUTPUT_WRITE_FAILED: 'TESTRELIC_OUTPUT_WRITE_FAILED',\n MERGE_INVALID_SCHEMA: 'TESTRELIC_MERGE_INVALID_SCHEMA',\n MERGE_READ_FAILED: 'TESTRELIC_MERGE_READ_FAILED',\n NAVIGATION_FLUSH_FAILED: 'TESTRELIC_NAVIGATION_FLUSH_FAILED',\n CODE_EXTRACT_FAILED: 'TESTRELIC_CODE_EXTRACT_FAILED',\n HTML_REPORT_FAILED: 'TESTRELIC_HTML_REPORT_FAILED',\n} as const;\n\nexport type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];\n\nexport class TestRelicError extends Error {\n readonly code: ErrorCode;\n\n constructor(code: ErrorCode, message: string, cause?: unknown) {\n super(message);\n this.name = 'TestRelicError';\n this.code = code;\n if (cause !== undefined) {\n Object.defineProperty(this, 'cause', { value: cause, writable: false, enumerable: false });\n }\n }\n}\n\nexport function createError(\n code: ErrorCode,\n message: string,\n cause?: unknown,\n): TestRelicError {\n return new TestRelicError(code, message, cause);\n}\n","/**\n * @testrelic/core — Lightweight runtime type guards\n *\n * Hand-written guards, no runtime schema libraries (Constitution SDK Constraint).\n */\n\nimport type {\n ReporterConfig,\n NavigationType,\n TestRunReport,\n} from './types.js';\n\nconst NAVIGATION_TYPES = new Set<string>([\n 'goto', 'navigation', 'back', 'forward', 'refresh',\n 'spa_route', 'spa_replace', 'hash_change', 'link_click',\n 'form_submit', 'redirect', 'popstate', 'page_load',\n 'manual_record', 'fallback', 'dummy',\n]);\n\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nexport function isValidNavigationType(value: unknown): value is NavigationType {\n return typeof value === 'string' && NAVIGATION_TYPES.has(value);\n}\n\nfunction hasNoPrototypePollution(obj: unknown): boolean {\n if (typeof obj !== 'object' || obj === null) return true;\n for (const key of Object.keys(obj)) {\n if (DANGEROUS_KEYS.has(key)) return false;\n }\n return true;\n}\n\nexport function isValidConfig(input: unknown): input is ReporterConfig {\n if (typeof input !== 'object' || input === null) return false;\n if (!hasNoPrototypePollution(input)) return false;\n\n const obj = input as Record<string, unknown>;\n\n if (obj.outputPath !== undefined && typeof obj.outputPath !== 'string') return false;\n if (obj.includeStackTrace !== undefined && typeof obj.includeStackTrace !== 'boolean') return false;\n if (obj.includeCodeSnippets !== undefined && typeof obj.includeCodeSnippets !== 'boolean') return false;\n if (obj.codeContextLines !== undefined && typeof obj.codeContextLines !== 'number') return false;\n if (obj.includeNetworkStats !== undefined && typeof obj.includeNetworkStats !== 'boolean') return false;\n\n if (obj.navigationTypes !== undefined && obj.navigationTypes !== null) {\n if (!Array.isArray(obj.navigationTypes)) return false;\n for (const t of obj.navigationTypes) {\n if (!isValidNavigationType(t)) return false;\n }\n }\n\n if (obj.redactPatterns !== undefined) {\n if (!Array.isArray(obj.redactPatterns)) return false;\n for (const p of obj.redactPatterns) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.testRunId !== undefined && obj.testRunId !== null && typeof obj.testRunId !== 'string') return false;\n\n if (obj.metadata !== undefined && obj.metadata !== null) {\n if (typeof obj.metadata !== 'object') return false;\n if (!hasNoPrototypePollution(obj.metadata)) return false;\n }\n\n if (obj.openReport !== undefined && typeof obj.openReport !== 'boolean') return false;\n if (obj.htmlReportPath !== undefined && (typeof obj.htmlReportPath !== 'string' || obj.htmlReportPath === '')) return false;\n if (obj.includeArtifacts !== undefined && typeof obj.includeArtifacts !== 'boolean') return false;\n\n // API tracking configuration\n if (obj.trackApiCalls !== undefined && typeof obj.trackApiCalls !== 'boolean') return false;\n if (obj.captureRequestHeaders !== undefined && typeof obj.captureRequestHeaders !== 'boolean') return false;\n if (obj.captureResponseHeaders !== undefined && typeof obj.captureResponseHeaders !== 'boolean') return false;\n if (obj.captureRequestBody !== undefined && typeof obj.captureRequestBody !== 'boolean') return false;\n if (obj.captureResponseBody !== undefined && typeof obj.captureResponseBody !== 'boolean') return false;\n if (obj.captureAssertions !== undefined && typeof obj.captureAssertions !== 'boolean') return false;\n\n if (obj.redactHeaders !== undefined) {\n if (!Array.isArray(obj.redactHeaders)) return false;\n for (const h of obj.redactHeaders) {\n if (typeof h !== 'string') return false;\n }\n }\n\n if (obj.redactBodyFields !== undefined) {\n if (!Array.isArray(obj.redactBodyFields)) return false;\n for (const f of obj.redactBodyFields) {\n if (typeof f !== 'string') return false;\n }\n }\n\n if (obj.apiIncludeUrls !== undefined) {\n if (!Array.isArray(obj.apiIncludeUrls)) return false;\n for (const p of obj.apiIncludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n if (obj.apiExcludeUrls !== undefined) {\n if (!Array.isArray(obj.apiExcludeUrls)) return false;\n for (const p of obj.apiExcludeUrls) {\n if (typeof p !== 'string' && !(p instanceof RegExp)) return false;\n }\n }\n\n return true;\n}\n\nexport function isValidTestRunReport(value: unknown): value is TestRunReport {\n if (typeof value !== 'object' || value === null) return false;\n\n const obj = value as Record<string, unknown>;\n\n if (typeof obj.schemaVersion !== 'string') return false;\n if (typeof obj.testRunId !== 'string') return false;\n if (typeof obj.startedAt !== 'string') return false;\n if (typeof obj.completedAt !== 'string') return false;\n if (typeof obj.totalDuration !== 'number') return false;\n if (typeof obj.summary !== 'object' || obj.summary === null) return false;\n if (!Array.isArray(obj.timeline)) return false;\n\n const summary = obj.summary as Record<string, unknown>;\n if (typeof summary.total !== 'number') return false;\n if (typeof summary.passed !== 'number') return false;\n if (typeof summary.failed !== 'number') return false;\n if (typeof summary.flaky !== 'number') return false;\n if (typeof summary.skipped !== 'number') return false;\n // timedout is optional for backward compat with schema 1.0.0\n if (summary.timedout !== undefined && typeof summary.timedout !== 'number') return false;\n\n return true;\n}\n"],"mappings":";AAocO,IAAM,kBAAkB;AAGxB,IAAM,kBAAkB;AAGxB,IAAM,0BAA0B;AAGhC,SAAS,uBAAuB,KAA2C;AAChF,MAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM,QAAO;AACpD,QAAM,SAAS;AACf,SACE,OAAO,kBAAkB,QACzB,OAAO,OAAO,YAAY,YAC1B,OAAO,QAAQ,SAAS,KACxB,MAAM,QAAQ,OAAO,WAAW,KAChC,MAAM,QAAQ,OAAO,eAAe,KACpC,MAAM,QAAQ,OAAO,QAAQ,KAC7B,MAAM,QAAQ,OAAO,aAAa;AAEtC;;;ACncA,IAAM,cAA0B,MAAM;AAAC;AAEhC,SAAS,aAAa,SAAiC;AAC5D,QAAM,UAAU,SAAS,WAAW;AAEpC,SAAO;AAAA,IACL,KAAK,YAAoB,MAAiB;AACxC,cAAQ,QAAQ,SAAS,IAAI;AAAA,IAC/B;AAAA,IACA,KAAK,YAAoB,MAAiB;AACxC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C,UAAI,OAAO,MAAM,YAAY,EAAE,aAAa,QAAS,QAAO;AAAA,IAC9D;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,OAAwC;AAC3E,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AAExD,QAAM,MAAM;AAEZ,MAAI,OAAO,IAAI,kBAAkB,SAAU,QAAO;AAClD,MAAI,OAAO,IAAI,cAAc,SAAU,QAAO;AAC9C,MAAI,OAAO,IAAI,cAAc,SAAU,QAAO;AAC9C,MAAI,OAAO,IAAI,gBAAgB,SAAU,QAAO;AAChD,MAAI,OAAO,IAAI,kBAAkB,SAAU,QAAO;AAClD,MAAI,OAAO,IAAI,YAAY,YAAY,IAAI,YAAY,KAAM,QAAO;AACpE,MAAI,CAAC,MAAM,QAAQ,IAAI,QAAQ,EAAG,QAAO;AAEzC,QAAM,UAAU,IAAI;AACpB,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,WAAW,SAAU,QAAO;AAC/C,MAAI,OAAO,QAAQ,UAAU,SAAU,QAAO;AAC9C,MAAI,OAAO,QAAQ,YAAY,SAAU,QAAO;AAEhD,MAAI,QAAQ,aAAa,UAAa,OAAO,QAAQ,aAAa,SAAU,QAAO;AAEnF,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testrelic/core",
3
- "version": "2.1.4",
3
+ "version": "2.2.1",
4
4
  "description": "Shared types, logger, errors, and validation for TestRelic packages",
5
5
  "keywords": [
6
6
  "testrelic",