@prezly/sdk 11.2.1 → 11.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 +1 -1
- package/dist/endpoints/Stories/types.d.ts +7 -1
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/types/Story.d.ts +8 -0
- package/dist/types/Story.js +14 -0
- package/package.json +1 -1
package/dist/api/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Category, CategoryRef, CultureRef, ExtendedStory, Newsroom, NewsroomContactRef, Pagination, Query, Story
|
|
1
|
+
import type { Category, CategoryRef, CultureRef, ExtendedStory, Newsroom, NewsroomContactRef, Pagination, Query, Story } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Uploadcare image JSON string.
|
|
4
4
|
*/
|
|
@@ -12,6 +12,12 @@ declare type Html = string;
|
|
|
12
12
|
* String containing Prezly Content Format JSON structure.
|
|
13
13
|
*/
|
|
14
14
|
declare type PrezlyContentFormat = string;
|
|
15
|
+
interface BaseWarning {
|
|
16
|
+
text: string;
|
|
17
|
+
scope: string;
|
|
18
|
+
field: string;
|
|
19
|
+
value: unknown;
|
|
20
|
+
}
|
|
15
21
|
interface ChangingNewsroomUnsafeOperationWarning extends BaseWarning {
|
|
16
22
|
scope: 'room_id';
|
|
17
23
|
field: 'room_id';
|
package/dist/http/index.d.ts
CHANGED
package/dist/http/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from '@prezly/uploads';
|
|
2
2
|
export { type Client as PrezlyClient, createClient as createPrezlyClient } from './Client';
|
|
3
|
-
export type
|
|
3
|
+
export { type HeadersMap, ApiError } from './http';
|
|
4
4
|
export * from './endpoints';
|
|
5
5
|
export * from './types';
|
package/dist/index.js
CHANGED
package/dist/types/Story.d.ts
CHANGED
|
@@ -223,6 +223,14 @@ export declare namespace Story {
|
|
|
223
223
|
function isScheduledEmbargo(story: Pick<Story, 'lifecycle_status'>): boolean;
|
|
224
224
|
function isPublished(status: LifecycleStatus): boolean;
|
|
225
225
|
function isPublished(story: Pick<Story, 'lifecycle_status'>): boolean;
|
|
226
|
+
function isLegacyHtmlFormat(format: FormatVersion): format is FormatVersion.HTML;
|
|
227
|
+
function isLegacyHtmlFormat<T extends Pick<Story, 'format_version'>>(story: T): story is T & {
|
|
228
|
+
format_version: FormatVersion.HTML;
|
|
229
|
+
};
|
|
230
|
+
function isSlateFormat(format: FormatVersion): format is FormatVersion.SLATEJS;
|
|
231
|
+
function isSlateFormat<T extends Pick<Story, 'format_version'>>(story: Pick<Story, 'format_version'>): story is T & {
|
|
232
|
+
format_version: FormatVersion.SLATEJS;
|
|
233
|
+
};
|
|
226
234
|
}
|
|
227
235
|
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'> {
|
|
228
236
|
}
|
package/dist/types/Story.js
CHANGED
|
@@ -65,4 +65,18 @@ export let Story;
|
|
|
65
65
|
return arg === LifecycleStatus.PUBLISHED;
|
|
66
66
|
}
|
|
67
67
|
_Story.isPublished = isPublished;
|
|
68
|
+
function isLegacyHtmlFormat(arg) {
|
|
69
|
+
if (typeof arg === 'object') {
|
|
70
|
+
return isLegacyHtmlFormat(arg.format_version);
|
|
71
|
+
}
|
|
72
|
+
return arg === FormatVersion.HTML;
|
|
73
|
+
}
|
|
74
|
+
_Story.isLegacyHtmlFormat = isLegacyHtmlFormat;
|
|
75
|
+
function isSlateFormat(arg) {
|
|
76
|
+
if (typeof arg === 'object') {
|
|
77
|
+
return isSlateFormat(arg.format_version);
|
|
78
|
+
}
|
|
79
|
+
return arg === FormatVersion.SLATEJS;
|
|
80
|
+
}
|
|
81
|
+
_Story.isSlateFormat = isSlateFormat;
|
|
68
82
|
})(Story || (Story = {}));
|