// @requirements REQ-PRODUCT-SERVICE-CATALOG REQ-PRODUCT-CF-HISTORY REQ-PRODUCT-RETAINED-RELEASES import {compileLegalDocuments,createRetainedReleaseFiles} from '@notabenda/core/content'; import {createCatalogSelectionPlan} from '@notabenda/core/catalog/selection'; import {attachCatalogReview} from '@notabenda/core/catalog/release'; const catalog={schemaVersion:1,kind:'notabenda-service-catalog',id:'example-provider-reference',revision:'example-1',sources:[{id:'provider-docs',url:'https://docs.example.test/cedar-mail',revision:'reference-1',checkedOn:null,access:'reference-only',license:'Apache-2.0',note:'Example reference for the catalog-history demonstration.'}],providers:[{id:'cedar',revision:'provider-1',name:'Cedar Mail',aliases:[],sourceIds:['provider-docs'],review:'unreviewed'}],products:[{id:'cedar-email',revision:'product-1',providerId:'cedar',name:'Cedar email delivery',aliases:[],description:'Email delivery reference for the sample site.',categories:['email'],delivery:['backend'],sourceIds:['provider-docs'],review:'unreviewed',identifiers:[],storageHints:[]}]}; export function catalogReleaseExample(base){ const input=structuredClone(base);input.site.id='juniper-catalog-releases';input.services=[];input.storage=[];for(const [kind,doc] of Object.entries(input.documents))doc.route='/catalog-releases/'+kind; const {config,selection}=createCatalogSelectionPlan(input,catalog,{productId:'cedar-email',serviceId:'email-delivery',purposeIds:['enquiries'],provider:'Cedar Mail · operator-declared sample',location:'Region selected by the example operator',justification:'PRIVATE_CATALOG_EXAMPLE_REASON',confirmed:true}); const first=attachCatalogReview(compileLegalDocuments(config,{mode:'preview'}),[selection]); const later=structuredClone(selection);later.reference.revision='example-2';later.reference.products[0].revision='product-2';later.reference.products[0].description='Revised catalog description of the same sample email service.'; const latest=attachCatalogReview(compileLegalDocuments(config,{mode:'preview'}),[later]); return {first,latest,files:{...latest.files,...createRetainedReleaseFiles([first.artifact],{siteId:config.site.id,mode:'preview'}),'catalog-releases/index.html':`Catalog release history · Juniper NotesSkip to content
Juniper Notes

Service catalog

Catalog references across releases

Compare the provider references retained with two policy releases. This catalog description update leaves the site's declared use and legal text unchanged.

Review the selected service

The operator selected an email delivery reference for its enquiries purpose. Each release keeps the selected product, provider, source and site-use facts in a separate archive.

Compare the retained references →

Compare policy wording separately

A reference change creates a new release identity. It does not by itself decide whether policy wording or consent must change.

Compare the privacy documents →

Integrate with your build

Finalize the compiled documents with attachCatalogReview, then create notices or offers from that final release. Store its private archive through your host-authorized backend.

Build and archive selected references →

`},releases:[{artifact:first.archive,metadata:{changeNote:'Initial selected catalog reference.'}},{artifact:latest.archive,metadata:{changeNote:'Update the retained catalog description; public site use and legal text are unchanged.'}}]}; }