Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

Commit 4f4ec0c

Browse files
authored
Merge pull request #405 from prezly/feature/cross-site-translations
Add cross_site_translations field and newsroom param to translate
2 parents afa7573 + 5766e5a commit 4f4ec0c

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prezly/sdk",
3-
"version": "26.3.1",
3+
"version": "26.4.0",
44
"description": "Prezly API SDK",
55
"type": "module",
66
"main": "dist/index.cjs",

src/endpoints/Stories/Client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export function createClient(api: DeferredJobsApiClient) {
228228
payload: TranslateRequest = {},
229229
options?: Exactly<Options, IncludeOptions & { formats?: Formats }>,
230230
): Promise<ExtendedStory & InferExtraFields<Options>> {
231-
const { culture, auto = false } = payload ?? {};
231+
const { culture, auto = false, newsroom } = payload ?? {};
232232
const { include, formats } = options ?? {};
233233

234234
const url = `${routing.storiesUrl}/${id}/translate`;
@@ -241,6 +241,7 @@ export function createClient(api: DeferredJobsApiClient) {
241241
payload: {
242242
culture,
243243
auto,
244+
newsroom,
244245
},
245246
});
246247

src/endpoints/Stories/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ export type UnscheduleRequest = UnpublishRequest;
311311
export interface TranslateRequest {
312312
culture?: CultureRef['code'];
313313
auto?: boolean;
314+
newsroom?: Newsroom['uuid'] | Newsroom['id'];
314315
}
315316

316317
export interface MoveRequest {
@@ -361,6 +362,7 @@ const ALL_EXTRA_FIELDS_SHAPE = {
361362
'campaigns.count': true,
362363
'pitches.count': true,
363364
'coverage.count': true,
365+
cross_site_translations: true,
364366
} satisfies Record<keyof Story.ExtraFields, boolean>;
365367

366368
export const ALL_EXTRA_FIELDS = Object.keys(

src/types/Story.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ export namespace Story {
303303
* Number of coverage entries linked to this story.
304304
*/
305305
'coverage.count': number;
306+
307+
/**
308+
* Translations of this story that exist in other newsrooms (cross-site translations).
309+
*/
310+
cross_site_translations: StoryRef[];
306311
}
307312

308313
/*

0 commit comments

Comments
 (0)