@upstart.gg/sdk 0.0.97 → 0.0.99
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/shared/ajv.d.ts.map +1 -1
- package/dist/shared/ajv.js +1 -1
- package/dist/shared/attributes.d.ts +1 -1
- package/dist/shared/attributes.d.ts.map +1 -1
- package/dist/shared/attributes.js +1 -1
- package/dist/shared/brick-manifest.js +1 -1
- package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
- package/dist/shared/bricks/manifests/all-manifests.js +1 -1
- package/dist/shared/bricks/manifests/button.manifest.js +1 -1
- package/dist/shared/bricks/manifests/card.manifest.js +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
- package/dist/shared/bricks/manifests/container.manifest.js +1 -1
- package/dist/shared/bricks/manifests/divider.manifest.js +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
- package/dist/shared/bricks/manifests/form.manifest.js +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
- package/dist/shared/bricks/manifests/image.manifest.js +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
- package/dist/shared/bricks/manifests/map.manifest.js +1 -1
- package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
- package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
- package/dist/shared/bricks/manifests/text.manifest.js +1 -1
- package/dist/shared/bricks/manifests/timeline.manifest.js +1 -1
- package/dist/shared/bricks/manifests/video.manifest.js +1 -1
- package/dist/shared/bricks.js +1 -1
- package/dist/shared/{chunk-CCNU3J56.js → chunk-4VVETQA6.js} +1 -1
- package/dist/shared/{chunk-Z7SYP6FG.js → chunk-5SSQU3VZ.js} +1 -1
- package/dist/shared/{chunk-2FHWS73Y.js → chunk-BQ5JAQ2K.js} +1 -1
- package/dist/shared/{chunk-GGJBTPGW.js → chunk-C3U3EMYW.js} +1 -1
- package/dist/shared/chunk-F2NL2BBM.js +3 -0
- package/dist/shared/{chunk-5HYPCOSS.js → chunk-FEI3PT7G.js} +1 -1
- package/dist/shared/{chunk-V6BCYHZH.js → chunk-FRGTJHVS.js} +1 -1
- package/dist/shared/{chunk-QPATZM3I.js → chunk-H6OG7OSG.js} +1 -1
- package/dist/shared/{chunk-NLZBY65T.js → chunk-KLNXIBFA.js} +1 -1
- package/dist/shared/chunk-M52N2CTG.js +3 -0
- package/dist/shared/{chunk-MITJPRGD.js → chunk-MNSCJBRC.js} +1 -1
- package/dist/shared/{chunk-6QS5PKLA.js → chunk-MT3RY7IH.js} +1 -1
- package/dist/shared/{chunk-PK3R5VOF.js → chunk-NRZCKO72.js} +1 -1
- package/dist/shared/{chunk-ENU4SEHO.js → chunk-NUYYQ3JH.js} +1 -1
- package/dist/shared/{chunk-VLGLD6GR.js → chunk-O24ODVIU.js} +1 -1
- package/dist/shared/{chunk-3FJVF357.js → chunk-OXN26QKE.js} +1 -1
- package/dist/shared/{chunk-5K5C6XFX.js → chunk-QXIZOPDX.js} +1 -1
- package/dist/shared/chunk-SIUWBV6O.js +3 -0
- package/dist/shared/{chunk-DCH2FI6T.js → chunk-T2OZONYR.js} +1 -1
- package/dist/shared/{chunk-RDBEWW4G.js → chunk-T5NMTWQA.js} +1 -1
- package/dist/shared/{chunk-BTKLQQZA.js → chunk-T5PGA3H3.js} +1 -1
- package/dist/shared/{chunk-3RHYJ6E7.js → chunk-UMM353HT.js} +1 -1
- package/dist/shared/{chunk-SUG225LF.js → chunk-URNBJWDN.js} +1 -1
- package/dist/shared/{chunk-5EOWW7BX.js → chunk-XO7VLVOB.js} +1 -1
- package/dist/shared/{chunk-SLSIAUYV.js → chunk-Z5MZDCKB.js} +1 -1
- package/dist/shared/{chunk-RPBQZW5I.js → chunk-ZPKOMXCX.js} +1 -1
- package/dist/shared/datasources/external/facebook/posts/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/instagram/feed/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/mastodon/account/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/mastodon/status/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/threads/media/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/tiktok/video/fetcher.d.ts.map +1 -1
- package/dist/shared/datasources/external/youtube/list/fetcher.d.ts.map +1 -1
- package/dist/shared/page.js +1 -1
- package/dist/shared/site.js +1 -1
- package/package.json +3 -3
- package/src/shared/ajv.ts +2 -4
- package/src/shared/attributes.ts +4 -16
- package/src/shared/datasources/external/facebook/posts/fetcher.ts +0 -9
- package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +0 -18
- package/src/shared/datasources/external/instagram/feed/fetcher.ts +2 -3
- package/src/shared/datasources/external/mastodon/account/fetcher.ts +2 -3
- package/src/shared/datasources/external/mastodon/status/fetcher.ts +0 -9
- package/src/shared/datasources/external/rss/fetcher.ts +2 -3
- package/src/shared/datasources/external/threads/media/fetcher.ts +2 -3
- package/src/shared/datasources/external/tiktok/video/fetcher.ts +0 -9
- package/src/shared/datasources/external/youtube/list/fetcher.ts +0 -8
- package/dist/shared/chunk-4MPRHJWO.js +0 -3
- package/dist/shared/chunk-H24R3IWA.js +0 -3
- package/dist/shared/chunk-Y36SM2AO.js +0 -3
|
@@ -18,12 +18,11 @@ const fetchMastodonAccount: DatasourceFetcher<MastodonAccountSchema, null, Masto
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const account = (await response.json()) as MastodonAccountSchema;
|
|
21
|
-
const
|
|
22
|
-
const isValid = validate(account);
|
|
21
|
+
const isValid = ajv.validate<MastodonAccountSchema>(mastodonAccountSchema, account);
|
|
23
22
|
|
|
24
23
|
if (!isValid) {
|
|
25
24
|
throw new Error(
|
|
26
|
-
`fetchMastodonAccount Error: Invalid Mastodon account response data: ${serializeAjvErrors(
|
|
25
|
+
`fetchMastodonAccount Error: Invalid Mastodon account response data: ${serializeAjvErrors(ajv.errors)}`,
|
|
27
26
|
);
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -30,15 +30,6 @@ const fetchMastodonStatus: DatasourceFetcher<
|
|
|
30
30
|
|
|
31
31
|
const statuses = (await response.json()) as MastodonStatusArraySchema;
|
|
32
32
|
|
|
33
|
-
const validate = ajv.compile<MastodonStatusArraySchema>(mastodonStatusArraySchema);
|
|
34
|
-
const isValid = validate(statuses);
|
|
35
|
-
|
|
36
|
-
if (!isValid) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
`fetchMastodonStatus Error: Invalid Mastodon status response data: ${serializeAjvErrors(validate.errors)}`,
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
33
|
return statuses;
|
|
43
34
|
};
|
|
44
35
|
|
|
@@ -17,11 +17,10 @@ const fetchRss: DatasourceFetcher<RssSchema, null, RssOptions> = async ({ option
|
|
|
17
17
|
pubDate: item.pubDate ? item.pubDate.toISOString() : new Date().toISOString(),
|
|
18
18
|
})) ?? [];
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const isValid = validate(newFeed);
|
|
20
|
+
const isValid = ajv.validate<RssSchema>(rssSchema, newFeed);
|
|
22
21
|
|
|
23
22
|
if (!isValid) {
|
|
24
|
-
throw new Error(`fetchRss Error: Invalid Feed data (${url}): ${serializeAjvErrors(
|
|
23
|
+
throw new Error(`fetchRss Error: Invalid Feed data (${url}): ${serializeAjvErrors(ajv.errors)}`);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
return newFeed;
|
|
@@ -48,12 +48,11 @@ const fetchThreadsMediaDatasource: DatasourceFetcher<
|
|
|
48
48
|
|
|
49
49
|
const media = (await response.json()) as ThreadsMediaSchema;
|
|
50
50
|
|
|
51
|
-
const
|
|
52
|
-
const isValid = validate(media);
|
|
51
|
+
const isValid = ajv.validate<ThreadsMediaSchema>(threadsMediaSchema, media);
|
|
53
52
|
|
|
54
53
|
if (!isValid) {
|
|
55
54
|
throw new Error(
|
|
56
|
-
`fetchThreadsMediaDatasource Error: Invalid Threads response data: ${serializeAjvErrors(
|
|
55
|
+
`fetchThreadsMediaDatasource Error: Invalid Threads response data: ${serializeAjvErrors(ajv.errors)}`,
|
|
57
56
|
);
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -34,15 +34,6 @@ const fetchTiktokVideoDatasource: DatasourceFetcher<
|
|
|
34
34
|
}
|
|
35
35
|
const data = (await response.json()) as TiktokVideoListSchema;
|
|
36
36
|
|
|
37
|
-
const validate = ajv.compile<TiktokVideoListSchema>(tiktokVideoListSchema);
|
|
38
|
-
const isValid = validate(data);
|
|
39
|
-
|
|
40
|
-
if (!isValid) {
|
|
41
|
-
throw new Error(
|
|
42
|
-
`fetchTiktokVideoDatasource Error: Invalid TikTok response data: ${serializeAjvErrors(validate.errors)}`,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
37
|
return data;
|
|
47
38
|
};
|
|
48
39
|
|
|
@@ -31,14 +31,6 @@ const fetchYoutubeList: DatasourceFetcher<
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const data = (await response.json()) as YoutubeListSchema;
|
|
34
|
-
const validate = ajv.compile<YoutubeListSchema>(youtubeListSchema);
|
|
35
|
-
const isValid = validate(data);
|
|
36
|
-
|
|
37
|
-
if (!isValid) {
|
|
38
|
-
throw new Error(
|
|
39
|
-
`fetchYoutubeList Error: Invalid Youtube response data: ${serializeAjvErrors(validate.errors)}`,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
34
|
|
|
43
35
|
return data;
|
|
44
36
|
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as h}from"./chunk-VBWC36L2.js";import{a as p}from"./chunk-VTFWVTPI.js";import{a as l}from"./chunk-P5DZK4TS.js";import{c as g}from"./chunk-74EL657O.js";import{a as d}from"./chunk-WAAKB6OB.js";import{a as u}from"./chunk-ALFOZHAH.js";import{a as y}from"./chunk-DFSQR6QC.js";import{a as m}from"./chunk-YZ5Y4WE6.js";import{a as n,c as i}from"./chunk-HYVQXAK5.js";import{a as c}from"./chunk-LKVQQQTI.js";import{a as f}from"./chunk-CAVNF3BU.js";import{a as s}from"./chunk-VA5LFJVE.js";import{a as o}from"./chunk-ZMDHKAWL.js";import O from"ajv";import F from"ajv-formats";var e=new O({useDefaults:!0,strictSchema:!1,validateSchema:!1,coerceTypes:!0,allErrors:!0,inlineRefs:!1});e.addSchema(o(),"styles:preset");e.addSchema(n(),"styles:background");e.addSchema(i(),"styles:backgroundColor");e.addSchema(m(),"styles:basicAlign");e.addSchema(d(),"styles:containerLayout");e.addSchema(s(),"styles:hidden");e.addSchema(c(),"styles:border");e.addSchema(l(),"styles:padding");e.addSchema(f(),"styles:color");e.addSchema(y(),"styles:shadow");e.addSchema(u(),"styles:cssLength");e.addSchema(p(),"assets:image");e.addSchema(h(),"content:textContent");e.addSchema(g(),"content:urlOrPageId");var k=["date-time","time","date","email","hostname","ipv4","ipv6","uri","uri-reference","uuid","uri-template","json-pointer","relative-json-pointer","regex"];F(e,[...k]);e.addFormat("date-object",{validate:t=>t instanceof Date&&!Number.isNaN(t.getTime()),async:!1});e.addFormat("richtext",{validate:t=>typeof t=="string",async:!1});e.addFormat("markdown",{validate:t=>typeof t=="string",async:!1});e.addFormat("multiline",{validate:t=>typeof t=="string",async:!1});e.addFormat("password",{validate:t=>typeof t=="string",async:!1});function B(t){return!t||t.length===0?"Unknown validation error":t.map(a=>{let{instancePath:r,message:S,params:b}=a,j=r||"root",v=Object.entries(b||{}).map(([T,x])=>`${T}: ${x}`).join(", ");return`${j} ${S} (${v})`}).join("; ")}function G(t){let a=t.type==="object"?{}:t.type==="array"?[]:null;return e.compile(t)(a),a}export{e as a,k as b,B as c,G as d};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{a as k,b as J}from"./chunk-RDBEWW4G.js";import{a as p,b as D}from"./chunk-VLGLD6GR.js";import{a as s,b as B}from"./chunk-BTKLQQZA.js";import{b as n,c as j}from"./chunk-PK3R5VOF.js";import{a as o,b as W}from"./chunk-5K5C6XFX.js";import{b as l,c as w}from"./chunk-5HYPCOSS.js";import{a as d,b as G}from"./chunk-MITJPRGD.js";import{a as E,b as F}from"./chunk-GGJBTPGW.js";import{a as u,b as I}from"./chunk-6QS5PKLA.js";import{a as m,b as R}from"./chunk-3RHYJ6E7.js";import{a as r,b as L}from"./chunk-V6BCYHZH.js";import{a as y,b as q}from"./chunk-Z7SYP6FG.js";import{b as i,c as h}from"./chunk-SUG225LF.js";import{a as g,b as H}from"./chunk-RPBQZW5I.js";import{a as x,b as z}from"./chunk-NLZBY65T.js";import{a as f,b as P}from"./chunk-5EOWW7BX.js";import{a,b as v}from"./chunk-2FHWS73Y.js";import{a as M,b as C}from"./chunk-CCNU3J56.js";import{a as t,b}from"./chunk-DCH2FI6T.js";import{a as c,b as A}from"./chunk-SLSIAUYV.js";import{b as e}from"./chunk-ENU4SEHO.js";var oe={[m.type]:m,[a.type]:a,[s.type]:s,[p.type]:p,[r.type]:r,[o.type]:o,[f.type]:f,[d.type]:d,[n.type]:n,[y.type]:y,[l.type]:l,[x.type]:x,[c.type]:c,[M.type]:M,[E.type]:E,[i.type]:i,[g.type]:g,[u.type]:u,[k.type]:k,[t.type]:t},fe={[m.type]:e(m),[a.type]:e(a),[s.type]:e(s),[p.type]:e(p),[r.type]:e(r),[d.type]:e(d),[o.type]:e(o),[f.type]:e(f),[n.type]:e(n),[y.type]:e(y),[l.type]:e(l),[x.type]:e(x),[c.type]:e(c),[M.type]:e(M),[E.type]:e(E),[i.type]:e(i),[g.type]:e(g),[u.type]:e(u),[k.type]:e(k),[t.type]:e(t)},ne={[m.type]:R,[a.type]:v,[s.type]:B,[p.type]:D,[r.type]:L,[o.type]:W,[f.type]:P,[d.type]:G,[n.type]:j,[y.type]:q,[l.type]:w,[x.type]:z,[c.type]:A,[M.type]:C,[E.type]:F,[i.type]:h,[g.type]:H,[u.type]:I,[k.type]:J,[t.type]:b};export{oe as a,fe as b,ne as c};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
import{b as g}from"./chunk-CTRS76PX.js";import{a as c}from"./chunk-G7LX3UKQ.js";import{a as p}from"./chunk-ATDJCXC2.js";import{a as n,d as l}from"./chunk-4MPRHJWO.js";import{a as i}from"./chunk-74EL657O.js";import{b as s}from"./chunk-HYVQXAK5.js";import{e}from"./chunk-BJSO43AS.js";import{Type as t}from"@sinclair/typebox";function T(a){for(let r in a)if(r.startsWith("$"))throw new Error(`Attribute names starting with '$' (like "${r}") are reserved for internal use. Please rename it.`);return t.Object(a)}function P(a){return t.Composite([a,o])}var d={$pageLanguage:c("Language","en",{options:[{value:"ar",title:"Arabic"},{value:"zh",title:"Chinese"},{value:"cs",title:"Czech"},{value:"nl",title:"Dutch"},{value:"en",title:"English"},{value:"fr",title:"French"},{value:"de",title:"German"},{value:"he",title:"Hebrew"},{value:"hi",title:"Hindi"},{value:"it",title:"Italian"},{value:"ja",title:"Japanese"},{value:"ko",title:"Korean"},{value:"fa",title:"Persian"},{value:"pl",title:"Polish"},{value:"pt",title:"Portuguese"},{value:"ru",title:"Russian"},{value:"es",title:"Spanish"},{value:"tr",title:"Turkish"},{value:"vi",title:"Vietnamese"}],"ai:guidelines":"Choose a value based on the site description. If the site is in multiple languages, use 'en'.","ui:group":"meta","ui:group:title":"Meta tags"}),$bodyBackground:e(s({default:{color:"#ffffff"},title:"Body Background",description:"Applies to the body element of the page (while $pageBackground applies to the page container)","ui:field":"background","ui:group":"layout","ui:group:title":"Page Layout","ui:group:order":3})),$pageBackground:e(s({title:"Page Background",defaultValue:{color:"base-100"}})),$pageOgImage:e(i("Social share image","",{description:"Image shown when page is shared on social media","ai:guidelines":"Don't generate this property/image, it is automatically generated.","ui:group":"meta","ui:field":"image"})),$robotsIndexing:e(p("Allow search engines to index this site",!0,{description:"Disabling this will prevent search engines from indexing this site","ai:guidelines":"Don't generate this property/image, it is automatically generated.","ui:group":"seo","ui:group:title":"SEO","ui:scope":"site"})),$siteOgImage:e(i("Social share image","",{description:"Image shown when this site is shared on social media","ai:guidelines":"Don't generate this image, it is automatically generated.","ui:field":"image","ui:group":"meta","ui:group:title":"Meta tags","ui:scope":"site"})),$pagePath:i("Page path","/",{description:"The URL path of the page","ui:group":"location","ui:group:title":"Location","ui:field":"path"}),$pageTitle:i("Title","Untitled",{"ui:group":"meta","ui:group:title":"Meta tags",description:"The title of the page. Appears in the browser tab and search results"}),$pageDescription:i("Description","",{"ui:widget":"textarea","ui:group":"meta","ui:group:title":"Meta tags",description:"A short description of the page. Used by search engines","ui:multiline":!0}),$pageKeywords:i("Keywords","",{"ui:group":"meta","ui:group:title":"Meta tags",description:"Keywords related to the page. Used by search engines","ui:multiline":!0}),$pageLastUpdated:e(g("Last updated",{"ui:hidden":!0,"ai:guidelines":"Don't generate this property."})),$siteHeadTags:e(t.String({title:"Head tags",description:"Add custom tags to the <head> of your site. Useful for analytics tags, custom scripts, etc.","ai:guidelines":"Don't include meta tags here, they are automatically generated.","ui:multiline":!0,"ui:textarea-class":"h-40 !font-mono","ui:placeholder":"<script src='https://example.com/script.js'></script>","ui:premium":!0,"ui:scope":"site","ui:group":"external-scripts","ui:group:title":"External scripts"})),$siteBodyTags:e(t.String({title:"Body tags",description:"Add custom tags to the <body> of your site. Useful for analytics tags, custom scripts, etc.","ui:multiline":!0,"ui:premium":!0,"ui:textarea-class":"h-40 !font-mono","ui:placeholder":"<script src='https://example.com/script.js'></script>","ui:scope":"site","ui:group":"external-scripts","ui:group:title":"External scripts"}))},o=t.Object(d,{additionalProperties:!0}),B=t.Pick(o,["$bodyBackground","$pageBackground"]),L=t.Pick(o,["$pageTitle","$pageDescription","$pageKeywords","$pageLanguage","$pagePath","$bodyBackground","$pageBackground"]);function O(a=t.Object({}),r={}){let u=structuredClone(r);return n.compile(a)(u),{...l(o),...u}}export{T as a,P as b,o as c,B as d,L as e,O as f};
|