import {build as bundle} from 'esbuild'; // @requirements REQ-PRODUCT-DISCOVERY import {readFile} from 'node:fs/promises'; import {compileLegalDocuments} from 'notabenda/content'; import {renderLegalLinks} from 'notabenda'; import {exampleConsentConfig} from '../static/choices-build.mjs'; export async function discoveryFiles(base){ const config=exampleConsentConfig(base);config.site.id='juniper-discovery';config.purposes=config.purposes.filter(p=>p.id!=='suggestions');config.services=config.services.filter(s=>s.id!=='sample-suggestions');config.storage=config.storage.filter(s=>s.serviceId!=='sample-suggestions'); config.consent.purposes=config.consent.purposes.filter(p=>p.id==='measurement');config.consent.services=config.consent.services.filter(s=>s.id==='sample-measurements'); config.purposes[0].name='Sample memory';config.purposes[0].description='Create one fictional local marker for this discovery demonstration.';config.services[0].name='Sample memory'; config.storage.find(s=>s.serviceId==='sample-measurements').name='juniper-discovery-memory'; for(const item of config.storage)if(item.serviceId==='privacy-choices')item.name=item.name.replace('juniper-choices',config.site.id); const files={}; for(const dark of [false,true]){ const themed=structuredClone(config),route=(dark?'/dark':'')+'/discovery';for(const [kind,doc] of Object.entries(themed.documents))doc.route=route+'/'+kind; const css=dark?'/assets/dark.css':'/assets/notabenda.css',build=compileLegalDocuments(themed,{mode:'preview',stylesheetUrl:css});Object.assign(files,build.files);files[route.slice(1)+'/site.json']=JSON.stringify(build.publicConfig); files[route.slice(1)+'/index.html']=`Browser discovery · NotabendaSkip to content
notabenda / discovery

Browser observations

Inspect browser
resources and storage

Capture resource references and storage names, then compare them with the declared service inventory.

Discovery guide
01 / OBSERVE, THEN REVIEWORIGINS + NAMES · PINNED RULE WITNESSES

LOCAL REVIEW

Compare observations
with your inventory

Download the capture, compare it with your inventory through the CLI, and review the candidates. Same-origin requests are not automatically essential, and a name match does not establish a legal basis.

npx notabenda catalog detect --capture notabenda-catalog-capture.json

Discovery is optional tooling. You choose when to run it and whether to use CI.

`; } const seed=await bundle({stdin:{contents:"export {browserCatalogSeed} from 'notabenda/catalog/browser/seed';",resolveDir:new URL('../../',import.meta.url).pathname},bundle:true,write:false,platform:'browser',format:'esm',target:'es2022',minify:true,banner:{js:'/*! Original browser technical rules; reference metadata includes Open Cookie Database attribution. See /assets/catalog/NOTICE.txt and /assets/catalog/open-cookie-database-LICENSE.txt. */'}});files['assets/browser-rules.mjs']=seed.outputFiles[0].text; files['assets/discovery-demo.mjs']=await readFile(new URL('./client.mjs',import.meta.url),'utf8');files['assets/discovery-page.css']=await readFile(new URL('./style.css',import.meta.url),'utf8'); return files; }