// @requirements REQ-PRODUCT-STORAGE-CLEANUP 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 storageCleanupFiles(base){ const config=exampleConsentConfig(base);config.site.id='juniper-storage-cleanup';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==='privacy-choices'); const purpose=config.purposes[0];purpose.name='Sample memory';purpose.description='Create three fictional browser markers only after permission.';purpose.dataCategories=['Synthetic browser marker'];purpose.retention='Removed on withdrawal while this example is running, or browser clearing.'; config.services[0].name='Sample browser memory';config.consent.purposes=[config.consent.purposes[0]];config.consent.services=[config.consent.services[0]]; for(const item of config.storage)item.name=item.name.replace('juniper-choices',config.site.id); for(const [i,type] of ['localStorage','sessionStorage','cookie'].entries())config.storage.push({id:'demo-'+i,name:'juniper-cleanup-'+i,type,serviceId:'sample-measurements',duration:'Until withdrawal or browser clearing',classification:'optional'}); for(const [kind,doc] of Object.entries(config.documents))doc.route='/storage-cleanup/'+kind; const build=compileLegalDocuments(config,{mode:'preview'}); const html=`Storage cleanup · Juniper Notes
Juniper NotesJuniper Notes examples

Notabenda · Declared storage cleanup

Storage cleanup after withdrawal

Allow memory to create three browser markers. Withdraw permission to stop the producer and remove its exact declared browser storage.

Local demonstration. No external trackers. Cookie expiration is requested for the declared path; it is not proof of deletion from every cookie scope.

Browser memory

Declared localStorage marker
Checking…
Declared sessionStorage marker
Checking…
Same-path cookie visible to this page
Checking…
Unrelated local marker
Checking…

Producer starts this visit: 0

Waiting for the runtime.

Declared cleanup targets

The adapter uses exact inventory IDs. It leaves unrelated items and choice memory alone. It cannot recall sent data, remove HttpOnly cookies or stop producers outside the lifecycle.

Read the cleanup guide

`; return {...build.files,'storage-cleanup/site.json':JSON.stringify(build.publicConfig),'storage-cleanup/index.html':html,'assets/storage-cleanup.mjs':await readFile(new URL('./client.mjs',import.meta.url),'utf8')}; }