@@ -70,6 +70,8 @@ pub struct ProviderNotice {
7070 pub archive_sha256 : String ,
7171 /// Provider terms URL.
7272 pub terms_url : String ,
73+ /// Every audited archive that contributed to this pack.
74+ pub sources : Vec < ProviderNoticeSource > ,
7375 /// User-visible attribution.
7476 pub attribution : String ,
7577 /// User-visible terms summary.
@@ -88,6 +90,30 @@ pub struct ProviderNoticeIcon {
8890 pub id : String ,
8991 /// Official provider product name.
9092 pub product_name : String ,
93+ /// Rights-owner source for this brand icon, when the archive is multi-brand.
94+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
95+ pub brand_source_url : Option < String > ,
96+ /// Rights-owner usage guidelines for this brand icon, when available.
97+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
98+ pub brand_guidelines_url : Option < String > ,
99+ /// Pack-local source ID, or `primary` for the primary source.
100+ pub source_id : String ,
101+ }
102+
103+ /// JavaScript-facing audited provider source.
104+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize ) ]
105+ #[ serde( rename_all = "camelCase" ) ]
106+ pub struct ProviderNoticeSource {
107+ /// Pack-local source ID.
108+ pub id : String ,
109+ /// Official source page.
110+ pub page_url : String ,
111+ /// Audited upstream release identifier.
112+ pub release : String ,
113+ /// Complete official source archive SHA-256.
114+ pub archive_sha256 : String ,
115+ /// Terms reviewed for this source.
116+ pub terms_url : String ,
91117}
92118
93119#[ derive( Deserialize ) ]
@@ -305,6 +331,11 @@ impl From<stack_engine::ProviderNotice> for ProviderNotice {
305331 source_release : notice. source_release ,
306332 archive_sha256 : notice. archive_sha256 ,
307333 terms_url : notice. terms_url ,
334+ sources : notice
335+ . sources
336+ . into_iter ( )
337+ . map ( ProviderNoticeSource :: from)
338+ . collect ( ) ,
308339 attribution : notice. attribution ,
309340 terms_summary : notice. terms_summary ,
310341 non_endorsement : notice. non_endorsement ,
@@ -322,6 +353,21 @@ impl From<stack_engine::ProviderNoticeIcon> for ProviderNoticeIcon {
322353 Self {
323354 id : icon. id ,
324355 product_name : icon. product_name ,
356+ brand_source_url : icon. brand_source_url ,
357+ brand_guidelines_url : icon. brand_guidelines_url ,
358+ source_id : icon. source_id ,
359+ }
360+ }
361+ }
362+
363+ impl From < stack_engine:: ProviderNoticeSource > for ProviderNoticeSource {
364+ fn from ( source : stack_engine:: ProviderNoticeSource ) -> Self {
365+ Self {
366+ id : source. id ,
367+ page_url : source. page_url ,
368+ release : source. release ,
369+ archive_sha256 : source. archive_sha256 ,
370+ terms_url : source. terms_url ,
325371 }
326372 }
327373}
@@ -466,6 +512,17 @@ export interface RenderResult {
466512export interface ProviderNoticeIcon {
467513 readonly id: string;
468514 readonly productName: string;
515+ readonly brandSourceUrl?: string;
516+ readonly brandGuidelinesUrl?: string;
517+ readonly sourceId: string;
518+ }
519+
520+ export interface ProviderNoticeSource {
521+ readonly id: string;
522+ readonly pageUrl: string;
523+ readonly release: string;
524+ readonly archiveSha256: string;
525+ readonly termsUrl: string;
469526}
470527
471528export interface ProviderNotice {
@@ -476,6 +533,7 @@ export interface ProviderNotice {
476533 readonly sourceRelease: string;
477534 readonly archiveSha256: string;
478535 readonly termsUrl: string;
536+ readonly sources: readonly ProviderNoticeSource[];
479537 readonly attribution: string;
480538 readonly termsSummary: string;
481539 readonly nonEndorsement: string;
@@ -631,6 +689,17 @@ fn provider_notices_to_js(notices: Vec<ProviderNotice>) -> Result<JsValue, JsVal
631689 set ( & item, "sourceRelease" , notice. source_release . into ( ) ) ?;
632690 set ( & item, "archiveSha256" , notice. archive_sha256 . into ( ) ) ?;
633691 set ( & item, "termsUrl" , notice. terms_url . into ( ) ) ?;
692+ let sources = Array :: new ( ) ;
693+ for source in notice. sources {
694+ let source_item = Object :: new ( ) ;
695+ set ( & source_item, "id" , source. id . into ( ) ) ?;
696+ set ( & source_item, "pageUrl" , source. page_url . into ( ) ) ?;
697+ set ( & source_item, "release" , source. release . into ( ) ) ?;
698+ set ( & source_item, "archiveSha256" , source. archive_sha256 . into ( ) ) ?;
699+ set ( & source_item, "termsUrl" , source. terms_url . into ( ) ) ?;
700+ sources. push ( & source_item) ;
701+ }
702+ set ( & item, "sources" , sources. into ( ) ) ?;
634703 set ( & item, "attribution" , notice. attribution . into ( ) ) ?;
635704 set ( & item, "termsSummary" , notice. terms_summary . into ( ) ) ?;
636705 set ( & item, "nonEndorsement" , notice. non_endorsement . into ( ) ) ?;
@@ -639,6 +708,17 @@ fn provider_notices_to_js(notices: Vec<ProviderNotice>) -> Result<JsValue, JsVal
639708 let icon_item = Object :: new ( ) ;
640709 set ( & icon_item, "id" , icon. id . into ( ) ) ?;
641710 set ( & icon_item, "productName" , icon. product_name . into ( ) ) ?;
711+ if let Some ( brand_source_url) = icon. brand_source_url {
712+ set ( & icon_item, "brandSourceUrl" , brand_source_url. into ( ) ) ?;
713+ }
714+ if let Some ( brand_guidelines_url) = icon. brand_guidelines_url {
715+ set (
716+ & icon_item,
717+ "brandGuidelinesUrl" ,
718+ brand_guidelines_url. into ( ) ,
719+ ) ?;
720+ }
721+ set ( & icon_item, "sourceId" , icon. source_id . into ( ) ) ?;
642722 icons. push ( & icon_item) ;
643723 }
644724 set ( & item, "icons" , icons. into ( ) ) ?;
0 commit comments