From f7937423b9ec2eb50dde0d14750b29c74d1e6db0 Mon Sep 17 00:00:00 2001 From: Jesse Wynants Date: Wed, 22 Apr 2026 10:10:48 +0200 Subject: [PATCH 1/2] Add optional `hub` field to Newsroom type Mirrors the additive `hub` field introduced by prezly/prezly#18567, which exposes the parent HUB and active siblings (each with `cultures`) on child-newsroom API responses so themes can render cross-site language pickers. Field is marked optional so the SDK release is not gated on backend deploy order. --- src/types/Newsroom.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/types/Newsroom.ts b/src/types/Newsroom.ts index 0cab21e..e8fc903 100644 --- a/src/types/Newsroom.ts +++ b/src/types/Newsroom.ts @@ -81,6 +81,7 @@ export interface NewsroomRef { export interface Newsroom extends NewsroomRef { is_hub: boolean; + hub?: { parent: Newsroom.HubPeer; siblings: Newsroom.HubPeer[] } | null; // extended details cultures: CultureRef[]; campaigns_number: number; @@ -140,6 +141,10 @@ export interface Newsroom extends NewsroomRef { } export namespace Newsroom { + export interface HubPeer extends NewsroomRef { + cultures: CultureRef[]; + } + export enum Status { ACTIVE = 'active', // i.e. "Live" INACTIVE = 'inactive', // i.e. "Not live" From 33e6a4936d908259a0d0cd310d9e2fde12d6f8ae Mon Sep 17 00:00:00 2001 From: Jesse Wynants Date: Wed, 22 Apr 2026 14:07:48 +0200 Subject: [PATCH 2/2] Address review: make hub non-nullable-optional, type is_default on cultures - `hub` is always present on the API response (null when no parent HUB), so the field should not be optional. - HubPeer `cultures` entries include an extra `is_default: boolean` not present on the base `CultureRef`. --- src/types/Newsroom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/Newsroom.ts b/src/types/Newsroom.ts index e8fc903..a2e1fa8 100644 --- a/src/types/Newsroom.ts +++ b/src/types/Newsroom.ts @@ -81,7 +81,7 @@ export interface NewsroomRef { export interface Newsroom extends NewsroomRef { is_hub: boolean; - hub?: { parent: Newsroom.HubPeer; siblings: Newsroom.HubPeer[] } | null; + hub: { parent: Newsroom.HubPeer; siblings: Newsroom.HubPeer[] } | null; // extended details cultures: CultureRef[]; campaigns_number: number; @@ -142,7 +142,7 @@ export interface Newsroom extends NewsroomRef { export namespace Newsroom { export interface HubPeer extends NewsroomRef { - cultures: CultureRef[]; + cultures: (CultureRef & { is_default: boolean })[]; } export enum Status {