@sevenfold/setto-client 0.34.0 → 0.35.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/blog/index.d.ts +2 -0
- package/dist/blog.js +13 -0
- package/dist/blog.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/media.d.ts +16 -0
- package/dist/lib/optimized-image.d.ts +14 -2
- package/dist/setto-client.js +27 -2
- package/dist/setto-client.js.map +1 -1
- package/package.json +1 -1
package/dist/blog/index.d.ts
CHANGED
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
* step uses it to read posts.
|
|
7
7
|
*/
|
|
8
8
|
export * from './contract';
|
|
9
|
+
/** The host a post's images must come from: pass it as `imageHosts`. */
|
|
10
|
+
export { SETTO_MEDIA_HOST, isSettoMediaUrl } from '../lib/media';
|
|
9
11
|
export { validateBlogPost, parseBlogPost } from './validate';
|
|
10
12
|
export type { BlogIssue, BlogPost, BlogValidationResult, BlogValidateOptions } from './validate';
|
package/dist/blog.js
CHANGED
|
@@ -78,6 +78,17 @@ function parseBlogPostPath(path2) {
|
|
|
78
78
|
function blogPostRoute(slug) {
|
|
79
79
|
return `${BLOG_ROUTE}/${slug}`;
|
|
80
80
|
}
|
|
81
|
+
const SETTO_MEDIA_HOST = "3adyw42hy72dtzjo.public.blob.vercel-storage.com";
|
|
82
|
+
const SETTO_MEDIA_BLOG_PREFIX = "/blog/";
|
|
83
|
+
function isSettoMediaUrl(src) {
|
|
84
|
+
if (!src) return false;
|
|
85
|
+
try {
|
|
86
|
+
const url = new URL(src);
|
|
87
|
+
return url.protocol === "https:" && url.hostname === SETTO_MEDIA_HOST && !url.username && !url.password && url.port === "" && url.pathname.startsWith(SETTO_MEDIA_BLOG_PREFIX);
|
|
88
|
+
} catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
81
92
|
const emptyOptions$1 = {};
|
|
82
93
|
function toString$1(value2, options) {
|
|
83
94
|
const settings = emptyOptions$1;
|
|
@@ -23937,10 +23948,12 @@ export {
|
|
|
23937
23948
|
BLOG_TAGS_MAX,
|
|
23938
23949
|
BLOG_TAG_MAX,
|
|
23939
23950
|
BLOG_TITLE_MAX,
|
|
23951
|
+
SETTO_MEDIA_HOST,
|
|
23940
23952
|
YOUTUBE_ID_PATTERN,
|
|
23941
23953
|
blogPostPath,
|
|
23942
23954
|
blogPostRoute,
|
|
23943
23955
|
isBlogComponentName,
|
|
23956
|
+
isSettoMediaUrl,
|
|
23944
23957
|
isValidBlogLocale,
|
|
23945
23958
|
isValidBlogSlug,
|
|
23946
23959
|
parseBlogPost,
|