{t.scanIntro}
+ {integrations ? ( ++ {integrations.length ? `${t.integrationsFound}: ${integrations.map((i) => i.label).join(', ')}` : t.integrationsNone} +
+ ) : null} + +{t.namesHint}
+{t('alertBody')}
+ > + )} + + {t('alertLink')} + +${esc(v.name)} (${esc(v.kind)}${v.category ? `, ${esc(v.category)}` : ''}) — ${esc(fill(t('beforeConsentOn'), { pages: v.pages.join(', ') }))}${esc(fill(t('emailIntro'), values))}
+${esc(fill(t('alertTitle'), values))}
+${items ? `${esc(t('alertBody'))}
+` + try { + await payload.sendEmail({ html, subject: fill(t('emailSubject'), values), to }) + return true + } catch (err) { + payload.logger.error(`[ipal] cookie crawl warning e-mail failed: ${err instanceof Error ? err.message : String(err)}`) + return false + } +} diff --git a/src/modules/consent/scanner/crawl/result.ts b/src/modules/consent/scanner/crawl/result.ts new file mode 100644 index 0000000..69e2101 --- /dev/null +++ b/src/modules/consent/scanner/crawl/result.ts @@ -0,0 +1,77 @@ +import type { CookieStorage } from '../types.js' + +/** + * What the scanner service sends back to the site (POST + * /api/ipal/cookie-crawl/results). The service lives in + * services/cookie-crawler; keep both sides in step. + */ +export type CrawlObservation = { + /** Set on the "after accept all" run. */ + after: boolean + /** Set on the run with no consent. */ + before: boolean + /** Cookie domain without the leading dot; omitted for storage keys. */ + domain?: string + name: string + /** Paths where it was first seen (max 5). */ + pages: string[] + storage: CookieStorage +} + +export type CrawlRequest = { after: boolean; before: boolean; host: string; pages: string[] } + +export type CrawlResult = + | { + /** False when the "Accept all" button was not found — the second run had no consent. */ + accepted: boolean + jobId: string + observations: CrawlObservation[] + ok: true + pages: string[] + requests: CrawlRequest[] + } + | { error: string; jobId: string; ok: false } + +const STORAGES = new SetAbout
') + : PAGE(` +