@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.
@@ -1,3 +1,3 @@
1
- const VERSION = "10.1.0-0";
1
+ const VERSION = "10.2.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "10.2.0",
3
+ "version": "10.3.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",