@prezly/sdk 16.6.0 → 16.7.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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEFAULT_USER_AGENT = void 0;
7
- const VERSION = "16.5.0";
7
+ const VERSION = "16.6.0";
8
8
  const URL = 'https://github.com/prezly/javascript-sdk';
9
9
  const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
10
10
  exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
@@ -1,3 +1,3 @@
1
- const VERSION = "16.5.0";
1
+ const VERSION = "16.6.0";
2
2
  const URL = 'https://github.com/prezly/javascript-sdk';
3
3
  export const DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
@@ -13,6 +13,7 @@ exports.Story = Story;
13
13
  FormatVersion[FormatVersion["HTML"] = 1] = "HTML";
14
14
  FormatVersion[FormatVersion["SLATEJS_V3"] = 3] = "SLATEJS_V3";
15
15
  FormatVersion[FormatVersion["SLATEJS_V4"] = 4] = "SLATEJS_V4";
16
+ FormatVersion[FormatVersion["SLATEJS_V5"] = 5] = "SLATEJS_V5";
16
17
  })(FormatVersion || (FormatVersion = {}));
17
18
  _Story.FormatVersion = FormatVersion;
18
19
  let Status;
@@ -111,7 +112,7 @@ exports.Story = Story;
111
112
  if (typeof arg === 'object' && arg !== null) {
112
113
  return isSlateFormat(arg.format_version);
113
114
  }
114
- return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4;
115
+ return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4 || arg === FormatVersion.SLATEJS_V5;
115
116
  }
116
117
  _Story.isSlateFormat = isSlateFormat;
117
118
  function isSlateV3Format(arg) {
@@ -128,4 +129,11 @@ exports.Story = Story;
128
129
  return arg === FormatVersion.SLATEJS_V4;
129
130
  }
130
131
  _Story.isSlateV4Format = isSlateV4Format;
132
+ function isSlateV5Format(arg) {
133
+ if (typeof arg === 'object' && arg !== null) {
134
+ return arg.format_version === FormatVersion.SLATEJS_V5;
135
+ }
136
+ return arg === FormatVersion.SLATEJS_V5;
137
+ }
138
+ _Story.isSlateV5Format = isSlateV5Format;
131
139
  })(Story || (exports.Story = Story = {}));
@@ -139,7 +139,8 @@ export declare namespace Story {
139
139
  enum FormatVersion {
140
140
  HTML = 1,
141
141
  SLATEJS_V3 = 3,
142
- SLATEJS_V4 = 4
142
+ SLATEJS_V4 = 4,
143
+ SLATEJS_V5 = 5
143
144
  }
144
145
  enum Status {
145
146
  UNINITIALIZED = "uninitialized",
@@ -274,9 +275,9 @@ export declare namespace Story {
274
275
  function isLegacyHtmlFormat<T extends Pick<Story, 'format_version'>>(story: T): story is T & {
275
276
  format_version: FormatVersion.HTML;
276
277
  };
277
- function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4;
278
+ function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5;
278
279
  function isSlateFormat<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
279
- format_version: FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4;
280
+ format_version: FormatVersion.SLATEJS_V3 | FormatVersion.SLATEJS_V4 | FormatVersion.SLATEJS_V5;
280
281
  };
281
282
  function isSlateV3Format(format: FormatVersion): format is FormatVersion.SLATEJS_V3;
282
283
  function isSlateV3Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
@@ -286,6 +287,10 @@ export declare namespace Story {
286
287
  function isSlateV4Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
287
288
  format_version: FormatVersion.SLATEJS_V4;
288
289
  };
290
+ function isSlateV5Format(format: FormatVersion): format is FormatVersion.SLATEJS_V5;
291
+ function isSlateV5Format<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
292
+ format_version: FormatVersion.SLATEJS_V5;
293
+ };
289
294
  }
290
295
  export interface ExtendedStory extends Story, Pick<Story.ExtraFields, 'thumbnail_image' | 'header_image' | 'preview_image' | 'social_image' | 'social_text' | 'tag_names' | 'content' | 'attached_gallery_content' | 'referenced_entities'> {
291
296
  }
@@ -6,6 +6,7 @@ export let Story;
6
6
  FormatVersion[FormatVersion["HTML"] = 1] = "HTML";
7
7
  FormatVersion[FormatVersion["SLATEJS_V3"] = 3] = "SLATEJS_V3";
8
8
  FormatVersion[FormatVersion["SLATEJS_V4"] = 4] = "SLATEJS_V4";
9
+ FormatVersion[FormatVersion["SLATEJS_V5"] = 5] = "SLATEJS_V5";
9
10
  })(FormatVersion || (FormatVersion = {}));
10
11
  _Story.FormatVersion = FormatVersion;
11
12
  let Status;
@@ -104,7 +105,7 @@ export let Story;
104
105
  if (typeof arg === 'object' && arg !== null) {
105
106
  return isSlateFormat(arg.format_version);
106
107
  }
107
- return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4;
108
+ return arg === FormatVersion.SLATEJS_V3 || arg === FormatVersion.SLATEJS_V4 || arg === FormatVersion.SLATEJS_V5;
108
109
  }
109
110
  _Story.isSlateFormat = isSlateFormat;
110
111
  function isSlateV3Format(arg) {
@@ -121,4 +122,11 @@ export let Story;
121
122
  return arg === FormatVersion.SLATEJS_V4;
122
123
  }
123
124
  _Story.isSlateV4Format = isSlateV4Format;
125
+ function isSlateV5Format(arg) {
126
+ if (typeof arg === 'object' && arg !== null) {
127
+ return arg.format_version === FormatVersion.SLATEJS_V5;
128
+ }
129
+ return arg === FormatVersion.SLATEJS_V5;
130
+ }
131
+ _Story.isSlateV5Format = isSlateV5Format;
124
132
  })(Story || (Story = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/sdk",
3
- "version": "16.6.0",
3
+ "version": "16.7.0",
4
4
  "description": "Prezly API SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",