@prezly/sdk 11.5.0 → 11.6.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 = "11.4.0";
1
+ const VERSION = "11.5.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -47,6 +47,8 @@ export declare class Client {
47
47
  unpublish<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?: UnpublishRequest, options?: Options): Promise<StoryRecord>;
48
48
  schedule<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?: ScheduleRequest, options?: Options): Promise<StoryRecord>;
49
49
  unschedule<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?: UnscheduleRequest, options?: Options): Promise<StoryRecord>;
50
+ pin<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>;
51
+ unpin<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>;
50
52
  delete(id: StoryId): Promise<void>;
51
53
  }
52
54
  export {};
@@ -252,6 +252,30 @@ export class Client {
252
252
  });
253
253
  return story;
254
254
  }
255
+ async pin(id, options) {
256
+ const url = `${routing.storiesUrl}/${id}/pin`;
257
+ const include = options?.include;
258
+ const {
259
+ story
260
+ } = await this.apiClient.post(url, {
261
+ query: {
262
+ include: include
263
+ }
264
+ });
265
+ return story;
266
+ }
267
+ async unpin(id, options) {
268
+ const url = `${routing.storiesUrl}/${id}/unpin`;
269
+ const include = options?.include;
270
+ const {
271
+ story
272
+ } = await this.apiClient.post(url, {
273
+ query: {
274
+ include: include
275
+ }
276
+ });
277
+ return story;
278
+ }
255
279
  async delete(id) {
256
280
  const url = `${routing.storiesUrl}/${id}`;
257
281
  await this.apiClient.delete(url);
@@ -130,6 +130,8 @@ export interface Story {
130
130
  */
131
131
  publication_status: Story.PublicationStatus;
132
132
  visibility: Story.Visibility;
133
+ is_pinned: boolean;
134
+ pinned_by: UserRef | null;
133
135
  }
134
136
  export declare namespace Story {
135
137
  enum FormatVersion {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "11.5.0",
3
+ "version": "11.6.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",