From 5766e5abb663002bddb4f32ce3b528a45f263d0f Mon Sep 17 00:00:00 2001 From: Jesse Wynants Date: Thu, 7 May 2026 10:09:47 +0200 Subject: [PATCH] 26.4.0 - Add cross_site_translations to Story.ExtraFields - Add newsroom param to Story translate request --- package.json | 2 +- src/endpoints/Stories/Client.ts | 3 ++- src/endpoints/Stories/types.ts | 2 ++ src/types/Story.ts | 5 +++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b68e65d..dfe9942 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@prezly/sdk", - "version": "26.3.1", + "version": "26.4.0", "description": "Prezly API SDK", "type": "module", "main": "dist/index.cjs", diff --git a/src/endpoints/Stories/Client.ts b/src/endpoints/Stories/Client.ts index afc5669..652a718 100644 --- a/src/endpoints/Stories/Client.ts +++ b/src/endpoints/Stories/Client.ts @@ -228,7 +228,7 @@ export function createClient(api: DeferredJobsApiClient) { payload: TranslateRequest = {}, options?: Exactly, ): Promise> { - const { culture, auto = false } = payload ?? {}; + const { culture, auto = false, newsroom } = payload ?? {}; const { include, formats } = options ?? {}; const url = `${routing.storiesUrl}/${id}/translate`; @@ -241,6 +241,7 @@ export function createClient(api: DeferredJobsApiClient) { payload: { culture, auto, + newsroom, }, }); diff --git a/src/endpoints/Stories/types.ts b/src/endpoints/Stories/types.ts index 35d2b2c..ac520aa 100644 --- a/src/endpoints/Stories/types.ts +++ b/src/endpoints/Stories/types.ts @@ -311,6 +311,7 @@ export type UnscheduleRequest = UnpublishRequest; export interface TranslateRequest { culture?: CultureRef['code']; auto?: boolean; + newsroom?: Newsroom['uuid'] | Newsroom['id']; } export interface MoveRequest { @@ -361,6 +362,7 @@ const ALL_EXTRA_FIELDS_SHAPE = { 'campaigns.count': true, 'pitches.count': true, 'coverage.count': true, + cross_site_translations: true, } satisfies Record; export const ALL_EXTRA_FIELDS = Object.keys( diff --git a/src/types/Story.ts b/src/types/Story.ts index c5d0495..361cda0 100644 --- a/src/types/Story.ts +++ b/src/types/Story.ts @@ -303,6 +303,11 @@ export namespace Story { * 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[]; } /*