Files
ipal-kit/src/modules/consent/scanner/index.ts
T
Radosław SmolińskiandClaude Opus 5.5 86ff3f5ff7 Cookie scanner: one approval for everything a scan finds
After "Scan cookies" or a site check, the new Approve cookies view
(/admin/cookie-approval) lists what waits, grouped by consent category, with
provider, purpose and duration and New / Changed / Needs description markers.
One "Approve and add" puts every ticked cookie into Cookie banner -> Cookie
list in every locale. That list feeds the cookie policy table and the
detailed settings window.

- Never overwrites editor text or categories, never adds a second row (a
  pattern and a concrete name are the same cookie), never deletes.
- Unknown cookies are approved into a category that needs consent
  (approval.unknownCategory, default marketing) and flagged Needs
  description; writing a purpose clears the flag.
- Cookies a scan or crawl no longer finds are flagged No longer found, for
  review only.
- The dashboard and the crawl e-mail say how many cookies wait and link to
  the view; nothing is added without approval.
- Optional: cookieScanner.approval false keeps per-entry review.
- Migration: cookie-review gains change and needsDescription.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:17:46 +01:00

57 lines
2.4 KiB
TypeScript

// Cookie scanner — server-safe building blocks. The admin button is in /admin.
export {
approveCookies,
buildCookieApprovalEndpoints,
COOKIE_APPROVAL_PATH,
COOKIE_APPROVAL_VIEW_PATH,
countPendingCookies,
DEFAULT_UNKNOWN_CATEGORY,
loadCookieApproval,
PENDING_WHERE,
} from './approval.js'
export type { CookieApprovalItem, CookieApprovalList, CookieApprovalResult } from './approval.js'
export { buildCookieReviewCollection, COOKIE_REVIEW_SLUG } from './collection.js'
export { DEFAULT_DATABASE_CATEGORIES, indexCookieDatabase, loadCookieDatabase, lookupCookie } from './cookieDatabase.js'
export type { CookieDatabaseIndex } from './cookieDatabase.js'
export {
COOKIE_CRAWL_PATH,
COOKIE_CRAWL_RESULTS_PATH,
COOKIE_CRAWL_SLUG,
COOKIE_SCAN_TOKEN_ENV,
COOKIE_SCAN_URL_ENV,
resolveCrawlConfig,
} from './crawl/config.js'
export type { ResolvedCrawlConfig } from './crawl/config.js'
export { bearerMatches, buildCookieCrawlEndpoints } from './crawl/endpoints.js'
export { buildCookieCrawlGlobal } from './crawl/global.js'
export { finishCrawl, ingestCrawlResult } from './crawl/ingest.js'
export type { CrawlIngestSummary } from './crawl/ingest.js'
export { sendCrawlWarning } from './crawl/notify.js'
export { parseCrawlResult } from './crawl/result.js'
export type { CrawlObservation, CrawlRequest, CrawlResult } from './crawl/result.js'
export { DEFAULT_TRACKER_HOSTS, findCrawlViolations, GOOGLE_TAG_HOSTS } from './crawl/violations.js'
export type { CrawlViolation } from './crawl/violations.js'
export { buildCookieScanEndpoints, COOKIE_SCAN_PATH } from './endpoint.js'
export { cookieNameMatches, DEFAULT_COOKIE_INTEGRATIONS } from './integrations.js'
export { COOKIE_SCAN_LABELS, mergeCookieScanLabels } from './labels.js'
export type { CookieScanLabels } from './labels.js'
export { mergeCookieReview, suggestionFor } from './merge.js'
export type { CookieReviewValues } from './merge.js'
export { applyCookieFindings, collectCookieFindings, cookieScanContext, flagGoneEntries, nextChange, parseCookieNames, runCookieScan } from './scan.js'
export type { CookieChange, CookieObservation, CookieReviewEntryRef } from './scan.js'
export { addToCookieList, sameCookie } from './sync.js'
export type {
CookieApprovalOptions,
CookieCrawlOptions,
CookieDeclaration,
CookieFinding,
CookieFindingSource,
CookieIntegration,
CookieScanContext,
CookieScannerOptions,
CookieScanSummary,
CookieStorage,
LocalizedText,
OpenCookieCategory,
} from './types.js'