@prezly/sdk 11.0.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeferredJobsApiClient } from '../../api';
|
|
2
2
|
import type { ExtendedStory, Story } from '../../types';
|
|
3
|
-
import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsafeResponse, CreateRequest, IncludeOptions, ListOptions, ListResponse, MoveRequest, PublishRequest, RevertRequest, ScheduleRequest, SearchOptions, UnpublishRequest, UnscheduleRequest, UpdateRequest } from './types';
|
|
3
|
+
import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsafeResponse, CreateRequest, IncludeOptions, ListOptions, ListResponse, MoveRequest, PublishRequest, RevertRequest, ScheduleRequest, SearchOptions, TranslateRequest, UnpublishRequest, UnscheduleRequest, UpdateRequest } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
|
|
6
6
|
*/
|
|
@@ -30,6 +30,7 @@ export declare class Client {
|
|
|
30
30
|
get<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(ids: Story['id'][], options?: Options): Promise<StoryRecord[]>;
|
|
31
31
|
create<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(payload: CreateRequest, options?: Options): Promise<StoryRecord>;
|
|
32
32
|
duplicate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, options?: Options): Promise<StoryRecord>;
|
|
33
|
+
translate<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include>, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: TranslateRequest, options?: Options): Promise<StoryRecord>;
|
|
33
34
|
move<Include extends readonly (keyof Story.ExtraFields)[], Options extends IncludeOptions<Include> & {
|
|
34
35
|
force?: true;
|
|
35
36
|
}, StoryRecord extends ExtendedStory = Options['include'] extends Include ? ExtendedStory & Pick<Story.ExtraFields, Options['include'][number]> : ExtendedStory>(id: StoryId, payload: MoveRequest, options?: Options): Promise<ChangeNewsroomSuccessResponse<StoryRecord> | ChangeNewsroomUnsafeResponse>;
|
|
@@ -115,6 +115,19 @@ export class Client {
|
|
|
115
115
|
});
|
|
116
116
|
return story;
|
|
117
117
|
}
|
|
118
|
+
async translate(id, payload, options) {
|
|
119
|
+
const include = options?.include;
|
|
120
|
+
const url = `${routing.storiesUrl}/${id}/translate`;
|
|
121
|
+
const {
|
|
122
|
+
story
|
|
123
|
+
} = await this.apiClient.post(url, {
|
|
124
|
+
query: {
|
|
125
|
+
include: include
|
|
126
|
+
},
|
|
127
|
+
payload
|
|
128
|
+
});
|
|
129
|
+
return story;
|
|
130
|
+
}
|
|
118
131
|
async move(id, payload, options) {
|
|
119
132
|
const include = options?.include;
|
|
120
133
|
const force = options?.force;
|
|
@@ -142,10 +142,13 @@ export interface UnpublishRequest {
|
|
|
142
142
|
visibility?: Story.Visibility.PUBLIC | Story.Visibility.PRIVATE | Story.Visibility.CONFIDENTIAL;
|
|
143
143
|
}
|
|
144
144
|
export interface ScheduleRequest {
|
|
145
|
-
publish_at
|
|
145
|
+
publish_at: Iso8601DateTime;
|
|
146
146
|
visibility?: Story.Visibility.PUBLIC | Story.Visibility.EMBARGO;
|
|
147
147
|
}
|
|
148
148
|
export declare type UnscheduleRequest = UnpublishRequest;
|
|
149
|
+
export interface TranslateRequest {
|
|
150
|
+
culture: CultureRef['code'];
|
|
151
|
+
}
|
|
149
152
|
export interface MoveRequest {
|
|
150
153
|
newsroom: Newsroom['uuid'] | Newsroom['id'];
|
|
151
154
|
}
|