From c3323a52d0d72fce411ed5fa260952361faa8ecb Mon Sep 17 00:00:00 2001 From: Ivan Voskoboinyk Date: Wed, 14 Jan 2026 16:18:46 +0100 Subject: [PATCH] [DEV-22267] Declare new optional include @ Stories API `coverage.count` --- src/endpoints/Stories/types.ts | 12 +++++------- src/types/Story.ts | 5 +++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/endpoints/Stories/types.ts b/src/endpoints/Stories/types.ts index e01add36..35d2b2c0 100644 --- a/src/endpoints/Stories/types.ts +++ b/src/endpoints/Stories/types.ts @@ -329,10 +329,7 @@ export interface ChangeNewsroomUnsafeResponse { warnings: ChangeNewsroomWarning[]; } -const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record< - keyof Omit, - boolean -> = { +const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = { thumbnail_image: true, header_image: true, preview_image: true, @@ -342,9 +339,9 @@ const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record< content: true, attached_gallery_content: true, referenced_entities: true, -}; // satisfies Record, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta +} satisfies Record, boolean>; -const ALL_EXTRA_FIELDS_SHAPE: Record = { +const ALL_EXTRA_FIELDS_SHAPE = { thumbnail_image: true, header_image: true, preview_image: true, @@ -363,7 +360,8 @@ const ALL_EXTRA_FIELDS_SHAPE: Record = { referenced_entities: true, 'campaigns.count': true, 'pitches.count': true, -}; // satisfies Record; // TODO: Use Typescript `satisfies` operator, when it's out of beta + 'coverage.count': true, +} satisfies Record; export const ALL_EXTRA_FIELDS = Object.keys( ALL_EXTRA_FIELDS_SHAPE, diff --git a/src/types/Story.ts b/src/types/Story.ts index a7f65b81..c5d04952 100644 --- a/src/types/Story.ts +++ b/src/types/Story.ts @@ -298,6 +298,11 @@ export namespace Story { * Number of pitches linked to this story. */ 'pitches.count': number; + + /** + * Number of coverage entries linked to this story. + */ + 'coverage.count': number; } /*