@prezly/sdk 10.2.0 → 10.3.0
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
|
@@ -29,6 +29,7 @@ export declare class Client {
|
|
|
29
29
|
*/
|
|
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
|
+
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>;
|
|
32
33
|
update<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: UpdateRequest, options?: Options): Promise<StoryRecord>;
|
|
33
34
|
/**
|
|
34
35
|
* This operation is only allowed for V3 stories
|
|
@@ -101,6 +101,18 @@ export class Client {
|
|
|
101
101
|
});
|
|
102
102
|
return story;
|
|
103
103
|
}
|
|
104
|
+
async duplicate(id, options) {
|
|
105
|
+
const include = options?.include;
|
|
106
|
+
const url = `${routing.storiesUrl}/${id}/duplicate`;
|
|
107
|
+
const {
|
|
108
|
+
story
|
|
109
|
+
} = await this.apiClient.post(url, {
|
|
110
|
+
query: {
|
|
111
|
+
include: include
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return story;
|
|
115
|
+
}
|
|
104
116
|
async update(id, payload, options) {
|
|
105
117
|
const url = `${routing.storiesUrl}/${id}`;
|
|
106
118
|
const include = options?.include;
|