Skip to content

Commit 4fc4b2d

Browse files
authored
Merge pull request #399 from prezly/feature/dev-22267-stories-api-return-coverage-count
[DEV-22267] Declare new optional include @ Stories API `coverage.count`
2 parents 6d3578e + c3323a5 commit 4fc4b2d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/endpoints/Stories/types.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,7 @@ export interface ChangeNewsroomUnsafeResponse {
329329
warnings: ChangeNewsroomWarning[];
330330
}
331331

332-
const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record<
333-
keyof Omit<ExtendedStory, keyof Story>,
334-
boolean
335-
> = {
332+
const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE = {
336333
thumbnail_image: true,
337334
header_image: true,
338335
preview_image: true,
@@ -342,9 +339,9 @@ const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record<
342339
content: true,
343340
attached_gallery_content: true,
344341
referenced_entities: true,
345-
}; // satisfies Record<keyof Omit<ExtendedStory, keyof Story>, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
342+
} satisfies Record<keyof Omit<ExtendedStory, keyof Story>, boolean>;
346343

347-
const ALL_EXTRA_FIELDS_SHAPE: Record<keyof Story.ExtraFields, boolean> = {
344+
const ALL_EXTRA_FIELDS_SHAPE = {
348345
thumbnail_image: true,
349346
header_image: true,
350347
preview_image: true,
@@ -363,7 +360,8 @@ const ALL_EXTRA_FIELDS_SHAPE: Record<keyof Story.ExtraFields, boolean> = {
363360
referenced_entities: true,
364361
'campaigns.count': true,
365362
'pitches.count': true,
366-
}; // satisfies Record<keyof Story.OnDemandFields, boolean>; // TODO: Use Typescript `satisfies` operator, when it's out of beta
363+
'coverage.count': true,
364+
} satisfies Record<keyof Story.ExtraFields, boolean>;
367365

368366
export const ALL_EXTRA_FIELDS = Object.keys(
369367
ALL_EXTRA_FIELDS_SHAPE,

src/types/Story.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ export namespace Story {
298298
* Number of pitches linked to this story.
299299
*/
300300
'pitches.count': number;
301+
302+
/**
303+
* Number of coverage entries linked to this story.
304+
*/
305+
'coverage.count': number;
301306
}
302307

303308
/*

0 commit comments

Comments
 (0)