import type { Category } from './Category'; import type { OEmbedInfo } from './common'; import type { CoverageEntry } from './CoverageEntry'; import type { CultureRef } from './Culture'; import { type NewsroomRef } from './Newsroom'; import type { SEOSettings } from './SEOSettings'; import type { UserRef } from './User'; type Html = string; type Json = string; export interface StoryRef { uuid: string; /** * @deprecated Please use `uuid` as an identifier instead. * @see uuid */ id: number; title: string; slug: string; status: Story.Status; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ lifecycle_status: Story.LifecycleStatus; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ publication_status: Story.PublicationStatus; visibility: Story.Visibility; thumbnail_url: string; created_at: string; updated_at: string; published_at: string | null; scheduled_at: string | null; culture: CultureRef; author: UserRef | null; newsroom: NewsroomRef; oembed: OEmbedInfo; links: { newsroom_view: string | null; }; } export interface Story { uuid: string; /** * @deprecated Please use `uuid` as an identifier instead. * @see uuid */ id: number; title: string; subtitle: string; intro: string; summary: string; /** * The effective Story slug. * Calculated as `custom_slug ?? auto_slug`. */ slug: string; /** * Automatically generated Story slug. */ auto_slug: string; /** * Custom-set Story slug. */ custom_slug: string | null; format_version: Story.FormatVersion; culture: CultureRef; author: UserRef | null; links: { short: string | null; newsroom_view: string | null; newsroom_preview: string; }; newsroom: NewsroomRef; categories: Category[]; translations: StoryRef[]; /** * Translations of this story that exist in other newsrooms (cross-site translations). * Only present when requested via the `cross_site_translations` include. */ cross_site_translations?: StoryRef[]; oembed: OEmbedInfo; coverage_number: number; auto_matched_coverage_number: number; language: string; last_coverage_at: string | null; thumbnail_url: string; created_at: string; updated_at: string; published_at: string | null; scheduled_at: string | null; status: Story.Status; /** * @deprecated Please use `status` instead. */ lifecycle_status: Story.Status; /** * @deprecated Please use `newsroom.status` instead. * @see newsroom * @see Newsroom.Status */ is_archived: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ is_finalized: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ is_published: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ is_draft: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ is_embargo: boolean; /** * @deprecated Please use `visibility` instead. * @see visibility * @see Story.Visibility */ is_private: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ is_scheduled: boolean; is_sharable: boolean; is_analytics_available: boolean; is_shared_to_prpro: boolean; is_demo: boolean; /** * @deprecated Please use `status` instead. * @see status * @see Story.Status */ publication_status: Story.PublicationStatus; visibility: Story.Visibility; is_pinned: boolean; pinned_by: UserRef | null; seo_settings: SEOSettings; uploadcare_assets_group_uuid: string | null; } export declare namespace Story { enum FormatVersion { HTML = 1, SLATEJS_V3 = 3, SLATEJS_V4 = 4, SLATEJS_V5 = 5, SLATEJS_V6 = 6 } enum Status { UNINITIALIZED = "uninitialized", DRAFT = "draft", SCHEDULED = "scheduled", EMBARGO = "embargo", PUBLISHED = "published" } /** * @deprecated Please use `Status` instead. * @see Status */ const LifecycleStatus: typeof Status; type LifecycleStatus = Status; /** * @deprecated Please use `Status` instead. * @see Status */ enum PublicationStatus { NEW = "new", DRAFT = "draft", PUBLISHED = "published" } enum Visibility { PUBLIC = "public", EMBARGO = "embargo", PRIVATE = "private", CONFIDENTIAL = "confidential" } interface ExtraFields { /** * Uploadcare image JSON. */ thumbnail_image: string | null; /** * Uploadcare image JSON. */ header_image: string | null; /** * Uploadcare image JSON. */ preview_image: string | null; /** * Uploadcare image JSON. */ social_image: string | null; social_text: string; tag_names: string[]; /** * Depending on `format_version` this field can contain: * - HTML content for v1 stories (deprecated) * - JSON-encoded structured content for v3 stories (see Prezly Content Format). */ content: Html | Json; /** * Only supported on v3 stories with JSON-encoded structured content. */ autosaved_content: Json | null; /** * Auto-incrementing version number updated on every update. * Used for detecting multiple users editing the same story simultaneously. */ content_version: number; /** * User who performed the latest update on the story. */ last_modifying_user: UserRef | null; /** * Contains attached gallery slate content. * Always `null` for v3 stories. */ attached_gallery_content: Json | null; /** * Contains attached videos slate content. * Always `null` for v3 stories. */ attached_videos_content: Json | null; /** * Contains attached bookmarks slate content. * Always `null` for v3 stories. */ attached_bookmarks_content: Json | null; /** * Contains attached files slate content. * Always `null` for v3 stories. */ attached_attachments_content: Json | null; /** * Contains attached contacts slate content. * Always `null` for v3 stories. */ attached_contacts_content: Json | null; referenced_entities: { stories: Record; coverages: Record; }; /** * Number of campaigns linked to this story. */ 'campaigns.count': number; /** * Number of pitches linked to this story. */ 'pitches.count': number; /** * Number of coverage entries linked to this story. */ 'coverage.count': number; /** * Translations of this story that exist in other newsrooms (cross-site translations). */ cross_site_translations: StoryRef[]; } function isActiveNewsroom(story: Pick): boolean; function isInactiveNewsroom(story: Pick): boolean; function isArchivedNewsroom(story: Pick): boolean; function isUninitialized(status: Status): status is Status.UNINITIALIZED; function isUninitialized>(story: T): story is T & { status: Status.UNINITIALIZED; }; function isDraft(status: Status): status is Status.DRAFT; function isDraft>(story: T): story is T & { status: Status.DRAFT; }; function isUninitializedOrDraft(status: Status): status is Status.UNINITIALIZED | Status.DRAFT; function isUninitializedOrDraft>(story: T): story is T & { status: Status.UNINITIALIZED | Status.DRAFT; }; function isScheduled(status: Status): status is Status.SCHEDULED; function isScheduled>(story: T): story is T & { status: Status.SCHEDULED; }; function isScheduledEmbargo(status: Status): status is Status.EMBARGO; function isScheduledEmbargo>(story: T): story is T & { status: Status.EMBARGO; }; function isPublished(status: Status): status is Status.PUBLISHED; function isPublished>(story: T): story is T & { status: Status.PUBLISHED; }; function isLegacyHtmlFormat(format: FormatVersion): format is FormatVersion.HTML; function isLegacyHtmlFormat>(story: T): story is T & { format_version: FormatVersion.HTML; }; function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5 | FormatVersion.SLATEJS_V6; function isSlateFormat>(story: Pick): story is T & { format_version: FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5 | FormatVersion.SLATEJS_V6; }; function isSlateV3Format(format: FormatVersion): format is FormatVersion.SLATEJS_V3; function isSlateV3Format>(story: Pick): story is T & { format_version: FormatVersion.SLATEJS_V3; }; function isSlateV4Format(format: FormatVersion): format is FormatVersion.SLATEJS_V4; function isSlateV4Format>(story: Pick): story is T & { format_version: FormatVersion.SLATEJS_V4; }; function isSlateV5Format(format: FormatVersion): format is FormatVersion.SLATEJS_V5; function isSlateV5Format>(story: Pick): story is T & { format_version: FormatVersion.SLATEJS_V5; }; function isSlateV6Format(format: FormatVersion): format is FormatVersion.SLATEJS_V6; function isSlateV6Format>(story: Pick): story is T & { format_version: FormatVersion.SLATEJS_V6; }; } export interface ExtendedStory extends Story, Pick { } export {};