{"version":3,"sources":["../src/index.ts","../src/filtering.ts","../src/normalization.ts","../src/validation.ts"],"sourcesContent":["/**\n * @fileoverview URL adapter for Visnap visual testing framework\n *\n * URL-based TestCaseAdapter that can test any absolute URL without requiring a server.\n * Supports include/exclude filtering, viewport expansion, and per-URL configuration.\n */\n\nimport type {\n  TestCaseAdapter,\n  TestCaseInstanceMeta,\n  ViewportMap,\n  PageWithEvaluate,\n} from \"@visnap/protocol\";\n\nimport { createUrlFilter } from \"./filtering\";\nimport { normalizeUrls } from \"./normalization\";\nimport type { CreateUrlAdapterOptions } from \"./validation\";\nimport { validateCreateUrlAdapterOptions } from \"./validation\";\n\n/**\n * Creates a URL-based TestCaseAdapter that can:\n * - Test any absolute URL without requiring a server\n * - Apply include/exclude filtering using minimatch patterns\n * - Expand URLs across multiple viewport configurations\n * - Support per-URL configuration (viewport, threshold, interactions)\n *\n * @param options - Configuration options for the URL adapter\n * @returns A TestCaseAdapter instance configured for URL testing\n *\n * @example\n * ```typescript\n * const adapter = createAdapter({\n *   urls: [\n *     { id: \"homepage\", url: \"https://example.com\" },\n *     { id: \"about\", url: \"https://example.com/about\" }\n *   ],\n *   include: [\"homepage\"],\n *   exclude: [\"*test*\"]\n * });\n * ```\n */\nexport function createAdapter(\n  options: CreateUrlAdapterOptions\n): TestCaseAdapter {\n  // Validate options using ArkType schema\n  const validatedOptions = validateCreateUrlAdapterOptions(options);\n\n  // Create filter function\n  const filter = createUrlFilter({\n    include: validatedOptions.include,\n    exclude: validatedOptions.exclude,\n  });\n\n  // Filter URLs\n  const filteredUrls = validatedOptions.urls.filter(filter);\n\n  if (filteredUrls.length === 0) {\n    console.warn(\"No URLs match the include/exclude patterns\");\n  }\n\n  return {\n    name: \"url-adapter\",\n\n    /**\n     * Start the adapter and provide initial page URL for discovery\n     * @returns Promise resolving to adapter start result with initial page URL\n     */\n    async start() {\n      return {\n        // Provide the first URL as initial page URL for discovery\n        initialPageUrl: filteredUrls[0]?.url,\n      };\n    },\n\n    /**\n     * Lists normalized and filtered URLs as test case instances.\n     * No page context needed since URLs are absolute.\n     *\n     * @param _pageCtx - Page context (not used for URL adapter)\n     * @param o - Options including viewport configuration\n     * @returns Promise resolving to array of test case instances\n     */\n    async listCases(\n      _pageCtx?: PageWithEvaluate,\n      o?: { viewport?: ViewportMap }\n    ): Promise<TestCaseInstanceMeta[]> {\n      // Determine viewport keys\n      let viewportKeys = o?.viewport ? Object.keys(o.viewport) : [\"default\"];\n      if (!viewportKeys || viewportKeys.length === 0) {\n        viewportKeys = [\"default\"];\n      }\n\n      // Sort viewport keys deterministically\n      viewportKeys.sort((a, b) => a.localeCompare(b));\n\n      // Normalize URLs to test case instances\n      return normalizeUrls(filteredUrls, {\n        include: validatedOptions.include,\n        exclude: validatedOptions.exclude,\n        viewportKeys,\n        globalViewport: o?.viewport,\n      });\n    },\n\n    /**\n     * No stop() needed - no server to manage\n     * @returns Promise resolving immediately\n     */\n    async stop() {\n      // No cleanup needed\n    },\n  };\n}\n\n// Re-export types for convenience\nexport type { CreateUrlAdapterOptions, UrlConfig } from \"./validation\";\n","/**\n * @fileoverview URL filtering utilities for URL adapter\n *\n * Provides filtering functionality for URL test cases using minimatch patterns\n * for include/exclude filtering with comprehensive pattern matching support.\n */\n\nimport type { FilterOptions } from \"@visnap/protocol\";\nimport { minimatch } from \"minimatch\";\n\nimport type { UrlConfig } from \"./validation\";\n\n/**\n * Creates a predicate function that filters URLs by include and exclude patterns.\n * Patterns support minimatch wildcards. Invalid patterns are ignored.\n *\n * @param options - Filter options with include and exclude patterns\n * @returns Predicate function that returns true if URL should be included\n *\n * @example\n * ```typescript\n * const filter = createUrlFilter({\n *   include: [\"homepage\", \"about*\"],\n *   exclude: [\"*test*\", \"admin*\"]\n * });\n *\n * const shouldInclude = filter({ id: \"homepage\", url: \"https://example.com\" });\n * ```\n */\nexport function createUrlFilter(options: FilterOptions) {\n  const includePatterns = Array.isArray(options.include)\n    ? options.include.filter(pattern => pattern != null && pattern !== \"\")\n    : options.include && options.include !== \"\"\n      ? [options.include]\n      : [];\n  const excludePatterns = Array.isArray(options.exclude)\n    ? options.exclude.filter(pattern => pattern != null && pattern !== \"\")\n    : options.exclude && options.exclude !== \"\"\n      ? [options.exclude]\n      : [];\n\n  return (urlConfig: UrlConfig) => {\n    const urlId = urlConfig.id;\n\n    // Check include patterns\n    if (includePatterns.length > 0) {\n      const matchesInclude = includePatterns.some(pattern =>\n        minimatch(urlId, pattern)\n      );\n      if (!matchesInclude) return false;\n    }\n\n    // Check exclude patterns\n    if (excludePatterns.length > 0) {\n      const matchesExclude = excludePatterns.some(pattern =>\n        minimatch(urlId, pattern)\n      );\n      if (matchesExclude) return false;\n    }\n\n    return true;\n  };\n}\n\n// Re-export types from validation module\nexport type {\n  UrlConfig,\n  CreateUrlAdapterOptions,\n  Viewport,\n} from \"./validation\";\n","/**\n * @fileoverview URL normalization utilities for URL adapter\n *\n * Provides functions for normalizing and expanding URL configurations into\n * test case instances with viewport expansion and safe viewport validation.\n */\n\nimport {\n  DEFAULT_VIEWPORT,\n  type TestCaseInstanceMeta,\n  type ViewportMap,\n  type FilterOptions,\n  type Viewport,\n  type InteractionAction,\n} from \"@visnap/protocol\";\n\nimport type { UrlConfig } from \"./validation\";\nimport { validateUniqueTestCaseIds } from \"./validation\";\n\n/**\n * Creates a safe viewport with basic validation and fallbacks\n * This is a simplified version of the core createSafeViewport function\n *\n * @param viewport - Viewport configuration to validate\n * @param fallback - Fallback viewport if validation fails\n * @param context - Context string for error messages\n * @returns Validated viewport configuration\n * @throws {Error} If viewport is invalid\n */\nfunction createSafeViewport(\n  viewport: unknown | undefined,\n  fallback: Viewport = DEFAULT_VIEWPORT,\n  context: string = \"viewport\"\n): Viewport {\n  if (!viewport) {\n    return fallback;\n  }\n\n  // Basic validation\n  if (typeof viewport !== \"object\" || viewport === null) {\n    throw new Error(`${context} must be an object`);\n  }\n\n  const vp = viewport as Record<string, unknown>;\n\n  // Basic type checks\n  if (typeof vp.width !== \"number\" || typeof vp.height !== \"number\") {\n    throw new Error(`${context} must have numeric width and height`);\n  }\n\n  return {\n    width: vp.width,\n    height: vp.height,\n    deviceScaleFactor:\n      vp.deviceScaleFactor !== undefined ? (vp.deviceScaleFactor as number) : 1,\n  };\n}\n\n/**\n * Normalizes and expands URL configurations into TestCaseInstanceMeta[].\n * Applies filtering, viewport expansion, and per-URL configuration.\n *\n * @param urlConfigs - Array of URL configurations to normalize\n * @param options - Options including viewport keys and global viewport configuration\n * @returns Array of normalized test case instances\n *\n * @example\n * ```typescript\n * const instances = normalizeUrls(urlConfigs, {\n *   viewportKeys: [\"desktop\", \"mobile\"],\n *   globalViewport: {\n *     desktop: { width: 1920, height: 1080 },\n *     mobile: { width: 375, height: 667 }\n *   }\n * });\n * ```\n */\nexport function normalizeUrls(\n  urlConfigs: UrlConfig[],\n  options: FilterOptions & {\n    viewportKeys: string[];\n    globalViewport?: ViewportMap;\n  }\n): TestCaseInstanceMeta[] {\n  const results: TestCaseInstanceMeta[] = [];\n\n  for (const urlConfig of urlConfigs) {\n    // Generate test case instances for each viewport\n    for (const viewportKey of options.viewportKeys) {\n      const viewport = createSafeViewport(\n        urlConfig.viewport || options.globalViewport?.[viewportKey],\n        { width: 1920, height: 1080, deviceScaleFactor: 1 },\n        `URL '${urlConfig.id}' viewport`\n      );\n\n      const testCase: TestCaseInstanceMeta = {\n        // Base meta fields\n        id: generateTestId(urlConfig, viewportKey),\n        title: urlConfig.title || urlConfig.id,\n        kind: \"url\",\n        parameters: {},\n        tags: [],\n\n        // Instance fields\n        caseId: urlConfig.id,\n        variantId: viewportKey,\n        url: urlConfig.url,\n        screenshotTarget: urlConfig.screenshotTarget,\n        viewport,\n        threshold: urlConfig.threshold,\n        disableCSSInjection: urlConfig.disableCSSInjection ?? false,\n        interactions: urlConfig.interactions as InteractionAction[],\n        elementsToMask: urlConfig.elementsToMask,\n\n        // Visual testing config\n        visualTesting: {\n          skip: false,\n          screenshotTarget: urlConfig.screenshotTarget,\n          threshold: urlConfig.threshold,\n          viewport,\n          disableCSSInjection: urlConfig.disableCSSInjection ?? false,\n          interactions: urlConfig.interactions as InteractionAction[],\n          elementsToMask: urlConfig.elementsToMask,\n        },\n      };\n\n      results.push(testCase);\n    }\n  }\n\n  // Validate uniqueness before returning\n  validateUniqueTestCaseIds(results);\n\n  return results;\n}\n\n/**\n * Generates deterministic test IDs from URL configurations\n * @param urlConfig - URL configuration\n * @param viewportKey - Viewport key for this variant\n * @returns Generated test ID in format \"urlId-viewportKey\"\n *\n * @example\n * ```typescript\n * const testId = generateTestId(\n *   { id: \"homepage\", url: \"https://example.com\" },\n *   \"desktop\"\n * ); // Returns \"homepage-desktop\"\n * ```\n */\nexport function generateTestId(\n  urlConfig: UrlConfig,\n  viewportKey: string\n): string {\n  return `${urlConfig.id}-${viewportKey}`;\n}\n\n/**\n * Expands URLs across multiple viewport configurations\n * @param urlConfigs - Array of URL configurations to expand\n * @param viewportMap - Map of viewport configurations\n * @returns Array of test case instances expanded across viewports\n *\n * @example\n * ```typescript\n * const instances = expandUrlsForViewports(urlConfigs, {\n *   desktop: { width: 1920, height: 1080 },\n *   mobile: { width: 375, height: 667 }\n * });\n * ```\n */\nexport function expandUrlsForViewports(\n  urlConfigs: UrlConfig[],\n  viewportMap: ViewportMap\n): TestCaseInstanceMeta[] {\n  const viewportKeys = Object.keys(viewportMap).sort();\n  if (viewportKeys.length === 0) {\n    viewportKeys.push(\"default\");\n  }\n\n  return normalizeUrls(urlConfigs, {\n    viewportKeys,\n    globalViewport: viewportMap,\n  });\n}\n","/**\n * @fileoverview Validation utilities for URL adapter\n *\n * Provides ArkType-based validation schemas and functions for URL adapter options\n * and URL configurations with comprehensive error handling.\n */\n\nimport type { InteractionAction, TestCaseInstanceMeta } from \"@visnap/protocol\";\nimport { type } from \"arktype\";\n\n// ============= Schema Definitions =============\n\nconst viewportSchema = type({\n  width: \"number>0\",\n  height: \"number>0\",\n  \"deviceScaleFactor?\": \"number>0\",\n});\n\nconst urlConfigSchema = type({\n  id: \"string>0\",\n  url: \"string>0\",\n  \"title?\": \"string\",\n  \"screenshotTarget?\": \"string\",\n  \"elementsToMask?\": \"string[]\",\n  \"viewport?\": viewportSchema,\n  \"threshold?\": \"number\",\n  \"disableCSSInjection?\": \"boolean\",\n  \"interactions?\": \"object[]\",\n});\n\nconst createUrlAdapterOptionsSchema = type({\n  urls: \"object[]\",\n  \"include?\": \"string|string[]|undefined\",\n  \"exclude?\": \"string|string[]|undefined\",\n});\n\n// ============= Type Exports (inferred from schemas) =============\n\nexport type Viewport = typeof viewportSchema.infer;\n\n// ============= Type Definitions =============\n\n/**\n * Configuration for a single URL test case\n * @property id - Unique identifier for the URL\n * @property url - Absolute URL to test\n * @property title - Optional human-readable title\n * @property screenshotTarget - CSS selector for element to capture (default: \"body\")\n * @property elementsToMask - CSS selectors of elements to mask before capture\n * @property viewport - Viewport configuration for this URL\n * @property threshold - Pixel difference threshold for this URL\n * @property disableCSSInjection - Skip injecting global CSS for this URL\n * @property interactions - Actions to perform before capture\n */\nexport interface UrlConfig {\n  id: string;\n  url: string;\n  title?: string;\n  screenshotTarget?: string;\n  elementsToMask?: string[];\n  viewport?: Viewport;\n  threshold?: number;\n  disableCSSInjection?: boolean;\n  interactions?: InteractionAction[];\n}\n\n/**\n * Options for creating a URL adapter\n * @property urls - Array of URL configurations to test\n * @property include - Include patterns for filtering URLs (minimatch)\n * @property exclude - Exclude patterns for filtering URLs (minimatch)\n */\nexport interface CreateUrlAdapterOptions {\n  urls: UrlConfig[];\n  include?: string | string[];\n  exclude?: string | string[];\n}\n\n// Re-export types for compatibility\nexport type { FilterOptions } from \"@visnap/protocol\";\n\n// ============= Validation Functions =============\n\n/**\n * Validates URL format\n * @param url - URL string to validate\n * @returns True if URL is valid HTTP/HTTPS URL\n */\nexport function isValidUrl(url: string): boolean {\n  try {\n    const parsed = new URL(url);\n    return parsed.protocol === \"http:\" || parsed.protocol === \"https:\";\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Validates URL configuration using ArkType\n * @param config - URL configuration to validate\n * @returns Validated URL configuration\n * @throws {Error} If configuration is invalid\n */\nexport function validateUrlConfig(config: unknown): UrlConfig {\n  const result = urlConfigSchema(config);\n  if (result instanceof type.errors) {\n    throw new Error(`Invalid URL config: ${result.summary}`);\n  }\n\n  // Additional URL format validation\n  if (!isValidUrl(result.url)) {\n    throw new Error(`URL '${result.url}' is not a valid HTTP/HTTPS URL`);\n  }\n\n  return result as UrlConfig;\n}\n\n/**\n * Validates create URL adapter options\n * @param options - Options to validate\n * @returns Validated options\n * @throws {Error} If options are invalid\n */\nexport function validateCreateUrlAdapterOptions(\n  options: unknown\n): CreateUrlAdapterOptions {\n  const result = createUrlAdapterOptionsSchema(options);\n  if (result instanceof type.errors) {\n    throw new Error(`Invalid URL adapter options: ${result.summary}`);\n  }\n\n  // Validate that at least one URL is provided\n  if (result.urls.length === 0) {\n    throw new Error(\"At least one URL must be provided\");\n  }\n\n  // Validate each URL config\n  for (const urlConfig of result.urls as UrlConfig[]) {\n    validateUrlConfig(urlConfig);\n  }\n\n  return result as CreateUrlAdapterOptions;\n}\n\n/**\n * Validates that all test case IDs are unique\n * @param testCases - Array of test case instances to validate\n * @throws {Error} If duplicate IDs are found\n */\nexport function validateUniqueTestCaseIds(\n  testCases: TestCaseInstanceMeta[]\n): void {\n  const ids = testCases.map(tc => tc.id);\n  const uniqueIds = new Set(ids);\n\n  if (ids.length !== uniqueIds.size) {\n    const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);\n    throw new Error(\n      `Duplicate test case IDs found: ${[...new Set(duplicates)].join(\", \")}. ` +\n        `Each URL config must have a unique 'id' field.`\n    );\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQA,uBAA0B;AAqBnB,SAAS,gBAAgB,SAAwB;AACtD,QAAM,kBAAkB,MAAM,QAAQ,QAAQ,OAAO,IACjD,QAAQ,QAAQ,OAAO,aAAW,WAAW,QAAQ,YAA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