@upstart.gg/sdk 0.0.129 → 0.0.131
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/ai/schemas.d.ts +13 -0
- package/dist/shared/ai/schemas.d.ts.map +1 -0
- package/dist/shared/ai/schemas.js +3 -0
- package/dist/shared/ai/types.d.ts +164 -0
- package/dist/shared/ai/types.d.ts.map +1 -0
- package/dist/shared/{chunk-EJGNYD4V.js → ai/types.js} +0 -1
- package/dist/shared/ajv.d.ts +2 -1
- package/dist/shared/ajv.d.ts.map +1 -1
- package/dist/shared/ajv.js +1 -1
- package/dist/shared/attributes.d.ts +300 -12
- package/dist/shared/attributes.d.ts.map +1 -1
- package/dist/shared/attributes.js +1 -1
- package/dist/shared/brick-manifest.d.ts +3 -1
- package/dist/shared/brick-manifest.d.ts.map +1 -1
- package/dist/shared/brick-manifest.js +1 -1
- package/dist/shared/bricks/manifests/accordion.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/accordion.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/accordion.manifest.js +1 -1
- package/dist/shared/bricks/manifests/all-manifests.d.ts +4 -1
- package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/all-manifests.js +1 -1
- package/dist/shared/bricks/manifests/box.manifest.d.ts +6 -4
- package/dist/shared/bricks/manifests/box.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/box.manifest.js +1 -1
- package/dist/shared/bricks/manifests/button.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/button.manifest.js +1 -1
- package/dist/shared/bricks/manifests/card.manifest.d.ts +6 -5
- package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/card.manifest.js +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts +6 -5
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/carousel.manifest.js +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.d.ts +40 -5
- package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/footer.manifest.js +1 -1
- package/dist/shared/bricks/manifests/form.manifest.d.ts +6 -5
- package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/form.manifest.js +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/hero.manifest.js +1 -1
- package/dist/shared/bricks/manifests/html.manifest.d.ts +3 -2
- package/dist/shared/bricks/manifests/html.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/html.manifest.js +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.d.ts +3 -2
- package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/icon.manifest.js +1 -1
- package/dist/shared/bricks/manifests/image.manifest.d.ts +10 -6
- package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/image.manifest.js +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts +7 -6
- package/dist/shared/bricks/manifests/images-gallery.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/images-gallery.manifest.js +1 -1
- package/dist/shared/bricks/manifests/map.manifest.d.ts +5 -4
- package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/map.manifest.js +1 -1
- package/dist/shared/bricks/manifests/navbar.manifest.d.ts +42 -8
- package/dist/shared/bricks/manifests/navbar.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/navbar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/sidebar.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/sidebar.manifest.js +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts +5 -4
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/social-links.manifest.js +1 -1
- package/dist/shared/bricks/manifests/spacer.manifest.d.ts +3 -2
- package/dist/shared/bricks/manifests/spacer.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/spacer.manifest.js +1 -1
- package/dist/shared/bricks/manifests/testimonials.manifest.d.ts +6 -5
- package/dist/shared/bricks/manifests/testimonials.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/testimonials.manifest.js +1 -1
- package/dist/shared/bricks/manifests/text.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/text.manifest.js +1 -1
- package/dist/shared/bricks/manifests/video.manifest.d.ts +4 -3
- package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -1
- package/dist/shared/bricks/manifests/video.manifest.js +1 -1
- package/dist/shared/bricks/props/align.d.ts.map +1 -1
- package/dist/shared/bricks/props/align.js +1 -1
- package/dist/shared/bricks/props/background.d.ts +6 -9
- package/dist/shared/bricks/props/background.d.ts.map +1 -1
- package/dist/shared/bricks/props/background.js +1 -1
- package/dist/shared/bricks/props/border.d.ts.map +1 -1
- package/dist/shared/bricks/props/border.js +1 -1
- package/dist/shared/bricks/props/color-preset.d.ts +3 -4
- package/dist/shared/bricks/props/color-preset.d.ts.map +1 -1
- package/dist/shared/bricks/props/color-preset.js +1 -1
- package/dist/shared/bricks/props/color.js +1 -1
- package/dist/shared/bricks/props/common.d.ts +6 -6
- package/dist/shared/bricks/props/common.d.ts.map +1 -1
- package/dist/shared/bricks/props/common.js +1 -1
- package/dist/shared/bricks/props/css-length.d.ts.map +1 -1
- package/dist/shared/bricks/props/css-length.js +1 -1
- package/dist/shared/bricks/props/datasource.d.ts +1 -1
- package/dist/shared/bricks/props/datasource.js +1 -1
- package/dist/shared/bricks/props/date.d.ts.map +1 -1
- package/dist/shared/bricks/props/date.js +1 -1
- package/dist/shared/bricks/props/direction.d.ts.map +1 -1
- package/dist/shared/bricks/props/direction.js +1 -1
- package/dist/shared/bricks/props/dynamic.d.ts.map +1 -1
- package/dist/shared/bricks/props/dynamic.js +1 -1
- package/dist/shared/bricks/props/effects.d.ts +0 -1
- package/dist/shared/bricks/props/effects.d.ts.map +1 -1
- package/dist/shared/bricks/props/effects.js +1 -1
- package/dist/shared/bricks/props/file.d.ts.map +1 -1
- package/dist/shared/bricks/props/file.js +1 -1
- package/dist/shared/bricks/props/geolocation.js +1 -1
- package/dist/shared/bricks/props/helpers.d.ts +2 -2
- package/dist/shared/bricks/props/helpers.js +1 -1
- package/dist/shared/bricks/props/image.d.ts +4 -4
- package/dist/shared/bricks/props/image.d.ts.map +1 -1
- package/dist/shared/bricks/props/image.js +1 -1
- package/dist/shared/bricks/props/position.d.ts +0 -2
- package/dist/shared/bricks/props/position.d.ts.map +1 -1
- package/dist/shared/bricks/props/position.js +1 -1
- package/dist/shared/bricks/props/string.js +1 -1
- package/dist/shared/bricks/props/tags.d.ts.map +1 -1
- package/dist/shared/bricks/props/tags.js +1 -1
- package/dist/shared/bricks/props/text.js +1 -1
- package/dist/shared/bricks/props/types.d.ts +1 -2
- package/dist/shared/bricks/props/types.d.ts.map +1 -1
- package/dist/shared/bricks.d.ts +189 -18
- package/dist/shared/bricks.d.ts.map +1 -1
- package/dist/shared/bricks.js +1 -1
- package/dist/shared/chunk-2CYAFF56.js +3 -0
- package/dist/shared/chunk-2NLDX5FG.js +3 -0
- package/dist/shared/chunk-3FPFR5RA.js +3 -0
- package/dist/shared/chunk-3P36LG6T.js +3 -0
- package/dist/shared/chunk-3QOAHMV4.js +5 -0
- package/dist/shared/chunk-4GIZ6WSG.js +3 -0
- package/dist/shared/chunk-5WY7LYXK.js +3 -0
- package/dist/shared/chunk-5X5SX5N7.js +4 -0
- package/dist/shared/chunk-6L3Z5SZQ.js +3 -0
- package/dist/shared/{chunk-UU2MSQXY.js → chunk-6PGAWO4H.js} +1 -1
- package/dist/shared/chunk-6R76KIHZ.js +3 -0
- package/dist/shared/chunk-7UBMXMNJ.js +3 -0
- package/dist/shared/chunk-AB3IMRXZ.js +3 -0
- package/dist/shared/chunk-AMQAGDFH.js +3 -0
- package/dist/shared/chunk-ARMM6B47.js +3 -0
- package/dist/shared/chunk-ARYG4XMX.js +3 -0
- package/dist/shared/chunk-AZHH3XJJ.js +3 -0
- package/dist/shared/chunk-COT2ROEH.js +34 -0
- package/dist/shared/chunk-DHSWVVMI.js +3 -0
- package/dist/shared/chunk-DKNOZLA6.js +3 -0
- package/dist/shared/chunk-EVDZ2KND.js +6 -0
- package/dist/shared/chunk-F4JNKU7J.js +3 -0
- package/dist/shared/chunk-GC5OWY2Z.js +3 -0
- package/dist/shared/chunk-GXNHF6J5.js +3 -0
- package/dist/shared/chunk-HP7CZB2F.js +3 -0
- package/dist/shared/chunk-HSRXUIVM.js +3 -0
- package/dist/shared/chunk-ILIWVWHC.js +8 -0
- package/dist/shared/chunk-JRCVYDCD.js +3 -0
- package/dist/shared/chunk-L2HOZVBC.js +3 -0
- package/dist/shared/chunk-LEWKHCRI.js +3 -0
- package/dist/shared/chunk-LT4CW2F7.js +3 -0
- package/dist/shared/chunk-MVCVVKBY.js +3 -0
- package/dist/shared/chunk-NKIEDT7V.js +3 -0
- package/dist/shared/chunk-NQKXDMQ5.js +3 -0
- package/dist/shared/chunk-NXIF3UMD.js +3 -0
- package/dist/shared/chunk-PW5HRVMD.js +3 -0
- package/dist/shared/chunk-PZYX3ACO.js +3 -0
- package/dist/shared/chunk-QDJQAZIA.js +8 -0
- package/dist/shared/chunk-QGFQA7OZ.js +4 -0
- package/dist/shared/chunk-RJZZWCBD.js +3 -0
- package/dist/shared/chunk-SAJY7H6N.js +3 -0
- package/dist/shared/chunk-SFDRAHYP.js +3 -0
- package/dist/shared/chunk-STDCM2KD.js +3 -0
- package/dist/shared/chunk-TCTVRT4O.js +3 -0
- package/dist/shared/chunk-TH5SONR6.js +3 -0
- package/dist/shared/chunk-UCR2UZOY.js +3 -0
- package/dist/shared/chunk-UDQWYGSO.js +3 -0
- package/dist/shared/{chunk-LSPN22SI.js → chunk-URRCKLAS.js} +3 -3
- package/dist/shared/{chunk-OIOYMECS.js → chunk-US53TNMK.js} +1 -1
- package/dist/shared/chunk-VDX2J22H.js +3 -0
- package/dist/shared/chunk-VE3S4LGT.js +3 -0
- package/dist/shared/chunk-VK26ZZFR.js +3 -0
- package/dist/shared/chunk-VLXZMESE.js +3 -0
- package/dist/shared/chunk-WAML3IGZ.js +3 -0
- package/dist/shared/chunk-WXKRIUTA.js +3 -0
- package/dist/shared/chunk-X62OEAE6.js +3 -0
- package/dist/shared/chunk-XED6ARVN.js +3 -0
- package/dist/shared/chunk-Y3X4F4YJ.js +3 -0
- package/dist/shared/chunk-Z4YKRLOX.js +3 -0
- package/dist/shared/context.d.ts +6 -15
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/datarecords/external/airtable/handler.d.ts +24 -7
- package/dist/shared/datarecords/external/airtable/handler.d.ts.map +1 -1
- package/dist/shared/datarecords/external/airtable/handler.js +3 -0
- package/dist/shared/datarecords/external/airtable/oauth/config.js +3 -0
- package/dist/shared/datarecords/external/airtable/types.d.ts +40 -0
- package/dist/shared/datarecords/external/airtable/types.d.ts.map +1 -0
- package/dist/shared/datarecords/external/airtable/types.js +3 -0
- package/dist/shared/datarecords/external/generic-webhook/handler.js +3 -0
- package/dist/shared/datarecords/external/generic-webhook/options.js +3 -0
- package/dist/shared/datarecords/external/google/sheets/client.d.ts +14 -0
- package/dist/shared/datarecords/external/google/sheets/client.d.ts.map +1 -0
- package/dist/shared/datarecords/external/google/sheets/client.js +3 -0
- package/dist/shared/datarecords/external/google/sheets/handler.d.ts +27 -5
- package/dist/shared/datarecords/external/google/sheets/handler.d.ts.map +1 -1
- package/dist/shared/datarecords/external/google/sheets/handler.js +7 -0
- package/dist/shared/datarecords/external/google/sheets/{options.d.ts → types.d.ts} +1 -1
- package/dist/shared/datarecords/external/google/sheets/types.d.ts.map +1 -0
- package/dist/shared/datarecords/external/google/sheets/types.js +3 -0
- package/dist/shared/datarecords/external/notion/handler.d.ts +31 -0
- package/dist/shared/datarecords/external/notion/handler.d.ts.map +1 -0
- package/dist/shared/datarecords/external/notion/handler.js +3 -0
- package/dist/shared/datarecords/external/notion/oauth/config.js +3 -0
- package/dist/shared/datarecords/external/notion/{options.d.ts → types.d.ts} +11 -1
- package/dist/shared/datarecords/external/notion/types.d.ts.map +1 -0
- package/dist/shared/datarecords/external/notion/types.js +3 -0
- package/dist/shared/datarecords/types.d.ts +17 -18
- package/dist/shared/datarecords/types.d.ts.map +1 -1
- package/dist/shared/datarecords/types.js +1 -1
- package/dist/shared/datarecords.d.ts +2 -2
- package/dist/shared/datarecords.d.ts.map +1 -1
- package/dist/shared/datarecords.js +1 -1
- package/dist/shared/datasources/external/facebook/posts/fetcher.js +3 -0
- package/dist/shared/datasources/external/facebook/posts/schema.js +3 -0
- package/dist/shared/datasources/external/http-json/fetcher.js +3 -0
- package/dist/shared/datasources/external/http-json/options.js +3 -0
- package/dist/shared/datasources/external/http-json/schema.js +3 -0
- package/dist/shared/datasources/external/instagram/feed/fetcher.js +3 -0
- package/dist/shared/datasources/external/instagram/feed/schema.js +3 -0
- package/dist/shared/datasources/external/mastodon/account/fetcher.js +3 -0
- package/dist/shared/datasources/external/mastodon/account/schema.js +3 -0
- package/dist/shared/datasources/external/mastodon/options.js +3 -0
- package/dist/shared/datasources/external/mastodon/status/fetcher.js +3 -0
- package/dist/shared/datasources/external/mastodon/status/sample.array.js +3 -0
- package/dist/shared/datasources/external/mastodon/status/sample.single.js +3 -0
- package/dist/shared/datasources/external/mastodon/status/schema.d.ts.map +1 -1
- package/dist/shared/datasources/external/mastodon/status/schema.js +3 -0
- package/dist/shared/datasources/external/meta/options.js +3 -0
- package/dist/shared/datasources/external/rss/fetcher.js +3 -0
- package/dist/shared/datasources/external/rss/options.js +3 -0
- package/dist/shared/datasources/external/rss/schema.js +3 -0
- package/dist/shared/datasources/external/threads/media/fetcher.js +3 -0
- package/dist/shared/datasources/external/threads/media/schema.js +3 -0
- package/dist/shared/datasources/external/tiktok/video/fetcher.js +3 -0
- package/dist/shared/datasources/external/tiktok/video/options.js +3 -0
- package/dist/shared/datasources/external/tiktok/video/schema.js +3 -0
- package/dist/shared/datasources/external/youtube/list/fetcher.js +3 -0
- package/dist/shared/datasources/external/youtube/list/options.js +3 -0
- package/dist/shared/datasources/external/youtube/list/schema.js +3 -0
- package/dist/shared/datasources/fetcher.js +2 -0
- package/dist/shared/datasources/internal/blog/schema.js +3 -0
- package/dist/shared/datasources/internal/changelog/schema.js +3 -0
- package/dist/shared/datasources/internal/contact-info/schema.js +3 -0
- package/dist/shared/datasources/internal/cv/schema.js +3 -0
- package/dist/shared/datasources/internal/faq/schema.js +3 -0
- package/dist/shared/datasources/internal/job-board/schema.js +3 -0
- package/dist/shared/datasources/internal/links/schema.js +3 -0
- package/dist/shared/datasources/internal/recipes/schema.js +3 -0
- package/dist/shared/datasources/internal/restaurant/schema.js +3 -0
- package/dist/shared/datasources/samples.js +3 -0
- package/dist/shared/datasources/schemas.d.ts +0 -49
- package/dist/shared/datasources/schemas.d.ts.map +1 -1
- package/dist/shared/datasources/schemas.js +1 -1
- package/dist/shared/datasources/types.d.ts +53 -130
- package/dist/shared/datasources/types.d.ts.map +1 -1
- package/dist/shared/datasources/types.js +1 -1
- package/dist/shared/datasources/utils.js +3 -0
- package/dist/shared/datasources.d.ts +7 -4
- package/dist/shared/datasources.d.ts.map +1 -1
- package/dist/shared/datasources.js +1 -1
- package/dist/shared/errors.js +1 -1
- package/dist/shared/images.d.ts +1 -12
- package/dist/shared/images.d.ts.map +1 -1
- package/dist/shared/images.js +1 -1
- package/dist/shared/index.js +3 -0
- package/dist/shared/manifest.js +3 -0
- package/dist/shared/page.d.ts +155 -50
- package/dist/shared/page.d.ts.map +1 -1
- package/dist/shared/page.js +1 -1
- package/dist/shared/site.d.ts +322 -113
- package/dist/shared/site.d.ts.map +1 -1
- package/dist/shared/site.js +1 -1
- package/dist/shared/sitemap.d.ts +313 -13
- package/dist/shared/sitemap.d.ts.map +1 -1
- package/dist/shared/sitemap.js +1 -1
- package/dist/shared/social-icons.js +3 -0
- package/dist/shared/theme.d.ts +41 -4
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +1 -1
- package/dist/shared/utils/invariant.js +1 -1
- package/dist/shared/utils/llm.d.ts +19 -0
- package/dist/shared/utils/llm.d.ts.map +1 -0
- package/dist/shared/utils/llm.js +3 -0
- package/dist/shared/utils/schema.d.ts +6 -1
- package/dist/shared/utils/schema.d.ts.map +1 -1
- package/dist/shared/utils/schema.js +1 -1
- package/dist/shared/utils/tests/schema.test.d.ts +2 -0
- package/dist/shared/utils/tests/schema.test.d.ts.map +1 -0
- package/dist/shared/utils/typed-ref.d.ts +1 -6
- package/dist/shared/utils/typed-ref.d.ts.map +1 -1
- package/dist/shared/utils/typed-ref.js +1 -1
- package/package.json +19 -19
- package/src/shared/ai/schemas.ts +33 -0
- package/src/shared/ai/types.ts +151 -0
- package/src/shared/ajv.ts +123 -0
- package/src/shared/analytics/init.ts +14 -0
- package/src/shared/analytics/track.ts +21 -0
- package/src/shared/analytics/types.ts +13 -0
- package/src/shared/attributes.ts +396 -0
- package/src/shared/brick-manifest.ts +119 -0
- package/src/shared/bricks/manifests/accordion.manifest.ts +482 -0
- package/src/shared/bricks/manifests/all-manifests.ts +121 -0
- package/src/shared/bricks/manifests/box.manifest.ts +551 -0
- package/src/shared/bricks/manifests/button.manifest.ts +208 -0
- package/src/shared/bricks/manifests/card.manifest.ts +320 -0
- package/src/shared/bricks/manifests/carousel.manifest.ts +708 -0
- package/src/shared/bricks/manifests/footer.manifest.ts +509 -0
- package/src/shared/bricks/manifests/form.manifest.ts +226 -0
- package/src/shared/bricks/manifests/hero.manifest.ts +365 -0
- package/src/shared/bricks/manifests/html.manifest.ts +127 -0
- package/src/shared/bricks/manifests/icon.manifest.ts +164 -0
- package/src/shared/bricks/manifests/image.manifest.ts +378 -0
- package/src/shared/bricks/manifests/images-gallery.manifest.ts +822 -0
- package/src/shared/bricks/manifests/map.manifest.ts +215 -0
- package/src/shared/bricks/manifests/navbar.manifest.ts +361 -0
- package/src/shared/bricks/manifests/sidebar.manifest.ts +88 -0
- package/src/shared/bricks/manifests/social-links.manifest.ts +497 -0
- package/src/shared/bricks/manifests/spacer.manifest.ts +54 -0
- package/src/shared/bricks/manifests/testimonials.manifest.ts +480 -0
- package/src/shared/bricks/manifests/tests/header.manifest.test.ts +10 -0
- package/src/shared/bricks/manifests/text.manifest.ts +245 -0
- package/src/shared/bricks/manifests/video.manifest.ts +115 -0
- package/src/shared/bricks/props/align.ts +63 -0
- package/src/shared/bricks/props/background.ts +79 -0
- package/src/shared/bricks/props/boolean.ts +7 -0
- package/src/shared/bricks/props/border.ts +86 -0
- package/src/shared/bricks/props/color-preset.ts +390 -0
- package/src/shared/bricks/props/color.ts +40 -0
- package/src/shared/bricks/props/common.ts +64 -0
- package/src/shared/bricks/props/css-length.ts +32 -0
- package/src/shared/bricks/props/datarecord.ts +11 -0
- package/src/shared/bricks/props/datasource.ts +82 -0
- package/src/shared/bricks/props/date.ts +21 -0
- package/src/shared/bricks/props/direction.ts +21 -0
- package/src/shared/bricks/props/dynamic.ts +112 -0
- package/src/shared/bricks/props/effects.ts +71 -0
- package/src/shared/bricks/props/enum.ts +38 -0
- package/src/shared/bricks/props/file.ts +10 -0
- package/src/shared/bricks/props/geolocation.ts +36 -0
- package/src/shared/bricks/props/helpers.ts +73 -0
- package/src/shared/bricks/props/image.ts +96 -0
- package/src/shared/bricks/props/number.ts +8 -0
- package/src/shared/bricks/props/position.ts +11 -0
- package/src/shared/bricks/props/string.ts +72 -0
- package/src/shared/bricks/props/tags.ts +26 -0
- package/src/shared/bricks/props/tests/background.test.ts +90 -0
- package/src/shared/bricks/props/tests/border.test.ts +12 -0
- package/src/shared/bricks/props/tests/effects.test.ts +37 -0
- package/src/shared/bricks/props/tests/helpers.test.ts +98 -0
- package/src/shared/bricks/props/tests/image.test.ts +71 -0
- package/src/shared/bricks/props/tests/string.test.ts +80 -0
- package/src/shared/bricks/props/text.ts +107 -0
- package/src/shared/bricks/props/types.ts +72 -0
- package/src/shared/bricks.ts +1237 -0
- package/src/shared/context.ts +32 -0
- package/src/shared/datarecords/external/airtable/handler.ts +501 -0
- package/src/shared/datarecords/external/airtable/oauth/config.ts +11 -0
- package/src/shared/datarecords/external/airtable/types.ts +63 -0
- package/src/shared/datarecords/external/generic-webhook/handler.ts +10 -0
- package/src/shared/datarecords/external/generic-webhook/options.ts +13 -0
- package/src/shared/datarecords/external/google/oauth/config.ts +30 -0
- package/src/shared/datarecords/external/google/sheets/client.ts +112 -0
- package/src/shared/datarecords/external/google/sheets/handler.ts +253 -0
- package/src/shared/datarecords/external/google/sheets/types.ts +10 -0
- package/src/shared/datarecords/external/notion/handler.ts +469 -0
- package/src/shared/datarecords/external/notion/oauth/config.ts +7 -0
- package/src/shared/datarecords/external/notion/types.ts +28 -0
- package/src/shared/datarecords/types.ts +165 -0
- package/src/shared/datarecords.ts +5 -0
- package/src/shared/datasources/README.md +3 -0
- package/src/shared/datasources/external/facebook/posts/fetcher.ts +52 -0
- package/src/shared/datasources/external/facebook/posts/sample.ts +35 -0
- package/src/shared/datasources/external/facebook/posts/schema.ts +33 -0
- package/src/shared/datasources/external/facebook/posts/tests/fetcher.test.ts +73 -0
- package/src/shared/datasources/external/http-json/fetcher.ts +31 -0
- package/src/shared/datasources/external/http-json/options.ts +8 -0
- package/src/shared/datasources/external/http-json/schema.ts +6 -0
- package/src/shared/datasources/external/http-json/tests/fetcher.test.ts +70 -0
- package/src/shared/datasources/external/instagram/feed/fetcher.ts +33 -0
- package/src/shared/datasources/external/instagram/feed/sample.ts +22 -0
- package/src/shared/datasources/external/instagram/feed/schema.ts +23 -0
- package/src/shared/datasources/external/instagram/feed/tests/fetcher.test.ts +64 -0
- package/src/shared/datasources/external/mastodon/account/fetcher.ts +24 -0
- package/src/shared/datasources/external/mastodon/account/sample.ts +33 -0
- package/src/shared/datasources/external/mastodon/account/schema.ts +45 -0
- package/src/shared/datasources/external/mastodon/account/tests/fetcher.test.ts +47 -0
- package/src/shared/datasources/external/mastodon/options.ts +6 -0
- package/src/shared/datasources/external/mastodon/status/fetcher.ts +35 -0
- package/src/shared/datasources/external/mastodon/status/sample.array.ts +59 -0
- package/src/shared/datasources/external/mastodon/status/sample.single.ts +55 -0
- package/src/shared/datasources/external/mastodon/status/schema.ts +125 -0
- package/src/shared/datasources/external/mastodon/status/tests/fetcher.test.ts +74 -0
- package/src/shared/datasources/external/meta/oauth/config.ts +16 -0
- package/src/shared/datasources/external/meta/options.ts +7 -0
- package/src/shared/datasources/external/rss/fetcher.ts +31 -0
- package/src/shared/datasources/external/rss/options.ts +7 -0
- package/src/shared/datasources/external/rss/sample.ts +22 -0
- package/src/shared/datasources/external/rss/schema.ts +42 -0
- package/src/shared/datasources/external/threads/media/fetcher.ts +53 -0
- package/src/shared/datasources/external/threads/media/sample.ts +44 -0
- package/src/shared/datasources/external/threads/media/schema.ts +37 -0
- package/src/shared/datasources/external/tiktok/oauth/config.ts +17 -0
- package/src/shared/datasources/external/tiktok/video/fetcher.ts +39 -0
- package/src/shared/datasources/external/tiktok/video/options.ts +8 -0
- package/src/shared/datasources/external/tiktok/video/sample.ts +26 -0
- package/src/shared/datasources/external/tiktok/video/schema.ts +27 -0
- package/src/shared/datasources/external/youtube/list/fetcher.ts +37 -0
- package/src/shared/datasources/external/youtube/list/options.ts +11 -0
- package/src/shared/datasources/external/youtube/list/sample.ts +33 -0
- package/src/shared/datasources/external/youtube/list/schema.ts +38 -0
- package/src/shared/datasources/external/youtube/oauth/config.ts +15 -0
- package/src/shared/datasources/fetcher.ts +16 -0
- package/src/shared/datasources/internal/blog/schema.ts +69 -0
- package/src/shared/datasources/internal/changelog/schema.ts +48 -0
- package/src/shared/datasources/internal/contact-info/schema.ts +20 -0
- package/src/shared/datasources/internal/cv/schema.ts +217 -0
- package/src/shared/datasources/internal/faq/schema.ts +27 -0
- package/src/shared/datasources/internal/job-board/schema.ts +228 -0
- package/src/shared/datasources/internal/links/schema.ts +15 -0
- package/src/shared/datasources/internal/recipes/schema.ts +42 -0
- package/src/shared/datasources/internal/restaurant/schema.ts +225 -0
- package/src/shared/datasources/samples.ts +26 -0
- package/src/shared/datasources/schemas.ts +48 -0
- package/src/shared/datasources/types.ts +490 -0
- package/src/shared/datasources/utils.ts +17 -0
- package/src/shared/datasources.ts +57 -0
- package/src/shared/env.ts +23 -0
- package/src/shared/errors.ts +1 -0
- package/src/shared/images.ts +44 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/layout-constants.ts +19 -0
- package/src/shared/manifest.ts +50 -0
- package/src/shared/oauth.ts +16 -0
- package/src/shared/page.ts +36 -0
- package/src/shared/prompt.ts +9 -0
- package/src/shared/responsive.ts +5 -0
- package/src/shared/site.ts +59 -0
- package/src/shared/sitemap.ts +98 -0
- package/src/shared/social-icons.ts +307 -0
- package/src/shared/tests/attributes.test.ts +31 -0
- package/src/shared/theme.ts +244 -0
- package/src/shared/themes/README.md +34 -0
- package/src/shared/themes/color-system.ts +146 -0
- package/src/shared/themes/tests/color-system.test.ts +170 -0
- package/src/shared/utils/canvas-data-uri.ts +2 -0
- package/src/shared/utils/invariant.ts +25 -0
- package/src/shared/utils/json-date.ts +8 -0
- package/src/shared/utils/llm.ts +282 -0
- package/src/shared/utils/merge.ts +12 -0
- package/src/shared/utils/object-hash.ts +7 -0
- package/src/shared/utils/schema.ts +359 -0
- package/src/shared/utils/string-enum.ts +12 -0
- package/src/shared/utils/tests/schema.test.ts +724 -0
- package/src/shared/utils/try-catch.ts +12 -0
- package/src/shared/utils/typed-ref.ts +53 -0
- package/dist/shared/bricks/props/container.d.ts +0 -11
- package/dist/shared/bricks/props/container.d.ts.map +0 -1
- package/dist/shared/bricks/props/container.js +0 -3
- package/dist/shared/bricks/props/gap.d.ts +0 -9
- package/dist/shared/bricks/props/gap.d.ts.map +0 -1
- package/dist/shared/bricks/props/gap.js +0 -3
- package/dist/shared/bricks/props/padding.d.ts +0 -5
- package/dist/shared/bricks/props/padding.d.ts.map +0 -1
- package/dist/shared/bricks/props/padding.js +0 -3
- package/dist/shared/bricks/props/tests/padding.d.ts +0 -2
- package/dist/shared/bricks/props/tests/padding.d.ts.map +0 -1
- package/dist/shared/chunk-2IYSJYNE.js +0 -3
- package/dist/shared/chunk-3EM3B4DX.js +0 -3
- package/dist/shared/chunk-4TH3C76A.js +0 -3
- package/dist/shared/chunk-5N6MBJJ4.js +0 -3
- package/dist/shared/chunk-6FITVVZX.js +0 -3
- package/dist/shared/chunk-6K3KZDFC.js +0 -3
- package/dist/shared/chunk-6WCGUAQN.js +0 -3
- package/dist/shared/chunk-7DMUDZ4H.js +0 -3
- package/dist/shared/chunk-ACVLF55Q.js +0 -3
- package/dist/shared/chunk-AQPN5SE2.js +0 -3
- package/dist/shared/chunk-BZGNY7LB.js +0 -3
- package/dist/shared/chunk-C2S243PB.js +0 -8
- package/dist/shared/chunk-C3VGP4CA.js +0 -3
- package/dist/shared/chunk-CT3EI7YN.js +0 -3
- package/dist/shared/chunk-DQXDGV67.js +0 -3
- package/dist/shared/chunk-E22E4XWE.js +0 -3
- package/dist/shared/chunk-ETYYRWLK.js +0 -3
- package/dist/shared/chunk-EYPREFMH.js +0 -3
- package/dist/shared/chunk-FKNNTHWX.js +0 -5
- package/dist/shared/chunk-HHO3ONTQ.js +0 -3
- package/dist/shared/chunk-I46VBMLF.js +0 -3
- package/dist/shared/chunk-IIFTGWFZ.js +0 -3
- package/dist/shared/chunk-JS4K5JRM.js +0 -5
- package/dist/shared/chunk-KHFNN4P3.js +0 -3
- package/dist/shared/chunk-LFQZRGHS.js +0 -3
- package/dist/shared/chunk-LGP6GWIY.js +0 -3
- package/dist/shared/chunk-NLEWXPVM.js +0 -3
- package/dist/shared/chunk-NNI225RG.js +0 -3
- package/dist/shared/chunk-QISTDGPP.js +0 -3
- package/dist/shared/chunk-QSZWDE3D.js +0 -3
- package/dist/shared/chunk-RGLVKILY.js +0 -3
- package/dist/shared/chunk-SLRU4CT6.js +0 -4
- package/dist/shared/chunk-T3LIA4YB.js +0 -3
- package/dist/shared/chunk-T4LMBG2G.js +0 -3
- package/dist/shared/chunk-TATG6SFZ.js +0 -3
- package/dist/shared/chunk-TF3JVVRU.js +0 -3
- package/dist/shared/chunk-TTTXV7TJ.js +0 -6
- package/dist/shared/chunk-TWBY2GOR.js +0 -3
- package/dist/shared/chunk-UHF6IEKV.js +0 -3
- package/dist/shared/chunk-UMHXXXVP.js +0 -3
- package/dist/shared/chunk-VGRYSAXA.js +0 -3
- package/dist/shared/chunk-VPFCY4DH.js +0 -3
- package/dist/shared/chunk-VTBI7WX3.js +0 -3
- package/dist/shared/chunk-VZPXXFVX.js +0 -3
- package/dist/shared/chunk-WU6Q4WYD.js +0 -3
- package/dist/shared/chunk-X43MB5WD.js +0 -3
- package/dist/shared/chunk-YBGPPF7T.js +0 -3
- package/dist/shared/chunk-ZQGNYK5I.js +0 -8
- package/dist/shared/chunk-ZTDUXSWH.js +0 -3
- package/dist/shared/datarecords/external/airtable/elements.d.ts +0 -21
- package/dist/shared/datarecords/external/airtable/elements.d.ts.map +0 -1
- package/dist/shared/datarecords/external/airtable/options.d.ts +0 -10
- package/dist/shared/datarecords/external/airtable/options.d.ts.map +0 -1
- package/dist/shared/datarecords/external/google/sheets/options.d.ts.map +0 -1
- package/dist/shared/datarecords/external/notion/options.d.ts.map +0 -1
- package/dist/shared/utils/schema-resolver.d.ts +0 -3
- package/dist/shared/utils/schema-resolver.d.ts.map +0 -1
- package/dist/shared/utils/schema-resolver.js +0 -3
package/dist/shared/theme.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const themeSchema: import("@sinclair/typebox").TObject<{
|
|
|
8
8
|
name: import("@sinclair/typebox").TString;
|
|
9
9
|
description: import("@sinclair/typebox").TString;
|
|
10
10
|
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
11
|
-
browserColorScheme: import("@sinclair/typebox").
|
|
11
|
+
browserColorScheme: import("@sinclair/typebox").TUnsafe<"light" | "dark">;
|
|
12
12
|
colors: import("@sinclair/typebox").TObject<{
|
|
13
13
|
primary: import("@sinclair/typebox").TString;
|
|
14
14
|
secondary: import("@sinclair/typebox").TString;
|
|
@@ -41,12 +41,12 @@ export declare const themeSchema: import("@sinclair/typebox").TObject<{
|
|
|
41
41
|
}>;
|
|
42
42
|
}>;
|
|
43
43
|
export type Theme = Static<typeof themeSchema>;
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const themesArray: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
45
45
|
id: import("@sinclair/typebox").TString;
|
|
46
46
|
name: import("@sinclair/typebox").TString;
|
|
47
47
|
description: import("@sinclair/typebox").TString;
|
|
48
48
|
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
49
|
-
browserColorScheme: import("@sinclair/typebox").
|
|
49
|
+
browserColorScheme: import("@sinclair/typebox").TUnsafe<"light" | "dark">;
|
|
50
50
|
colors: import("@sinclair/typebox").TObject<{
|
|
51
51
|
primary: import("@sinclair/typebox").TString;
|
|
52
52
|
secondary: import("@sinclair/typebox").TString;
|
|
@@ -78,7 +78,44 @@ export declare const themeArray: import("@sinclair/typebox").TArray<import("@sin
|
|
|
78
78
|
}>>;
|
|
79
79
|
}>;
|
|
80
80
|
}>>;
|
|
81
|
-
export
|
|
81
|
+
export declare function getThemesArrayForLLM(): import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
82
|
+
id: import("@sinclair/typebox").TString;
|
|
83
|
+
name: import("@sinclair/typebox").TString;
|
|
84
|
+
description: import("@sinclair/typebox").TString;
|
|
85
|
+
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
86
|
+
browserColorScheme: import("@sinclair/typebox").TUnsafe<"light" | "dark">;
|
|
87
|
+
colors: import("@sinclair/typebox").TObject<{
|
|
88
|
+
primary: import("@sinclair/typebox").TString;
|
|
89
|
+
secondary: import("@sinclair/typebox").TString;
|
|
90
|
+
accent: import("@sinclair/typebox").TString;
|
|
91
|
+
neutral: import("@sinclair/typebox").TString;
|
|
92
|
+
base100: import("@sinclair/typebox").TString;
|
|
93
|
+
base200: import("@sinclair/typebox").TString;
|
|
94
|
+
base300: import("@sinclair/typebox").TString;
|
|
95
|
+
}>;
|
|
96
|
+
typography: import("@sinclair/typebox").TObject<{
|
|
97
|
+
base: import("@sinclair/typebox").TNumber;
|
|
98
|
+
heading: import("@sinclair/typebox").TObject<{
|
|
99
|
+
type: import("@sinclair/typebox").TUnsafe<"stack" | "theme" | "google">;
|
|
100
|
+
family: import("@sinclair/typebox").TString;
|
|
101
|
+
}>;
|
|
102
|
+
body: import("@sinclair/typebox").TObject<{
|
|
103
|
+
type: import("@sinclair/typebox").TUnsafe<"stack" | "theme" | "google">;
|
|
104
|
+
family: import("@sinclair/typebox").TString;
|
|
105
|
+
}>;
|
|
106
|
+
alternatives: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
107
|
+
body: import("@sinclair/typebox").TObject<{
|
|
108
|
+
type: import("@sinclair/typebox").TUnsafe<"stack" | "theme" | "google">;
|
|
109
|
+
family: import("@sinclair/typebox").TString;
|
|
110
|
+
}>;
|
|
111
|
+
heading: import("@sinclair/typebox").TObject<{
|
|
112
|
+
type: import("@sinclair/typebox").TUnsafe<"stack" | "theme" | "google">;
|
|
113
|
+
family: import("@sinclair/typebox").TString;
|
|
114
|
+
}>;
|
|
115
|
+
}>>;
|
|
116
|
+
}>;
|
|
117
|
+
}>>;
|
|
118
|
+
export type ThemesArray = Static<typeof themesArray>;
|
|
82
119
|
export type FontType = Theme["typography"]["body"];
|
|
83
120
|
export declare const defaultTheme: Theme;
|
|
84
121
|
export declare function isDefaultTheme(theme: Theme): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/shared/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/shared/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMtD,eAAO,MAAM,UAAU;;;GAgBtB,CAAC;AAsCF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGvB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAC/C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0B,CAAC;AAEnD,wBAAgB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEnC;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEpD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAmBhD"}
|
package/dist/shared/theme.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f,g}from"./chunk-TCTVRT4O.js";import"./chunk-F4JNKU7J.js";import"./chunk-3FPFR5RA.js";import"./chunk-7UBMXMNJ.js";import"./chunk-US53TNMK.js";import"./chunk-VK26ZZFR.js";import"./chunk-MVCVVKBY.js";import"./chunk-AB3IMRXZ.js";import"./chunk-GC5OWY2Z.js";import"./chunk-DHSWVVMI.js";import"./chunk-Z4YKRLOX.js";import"./chunk-SFDRAHYP.js";import"./chunk-JRCVYDCD.js";import"./chunk-DKNOZLA6.js";import"./chunk-HSRXUIVM.js";import"./chunk-5WY7LYXK.js";import"./chunk-SFKZAUPW.js";export{e as defaultTheme,a as fontStacks,d as getThemesArrayForLLM,f as isDefaultTheme,g as processTheme,b as themeSchema,c as themesArray};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import{a}from"../chunk-WXKRIUTA.js";export{a as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TObject, TSchema } from "@sinclair/typebox";
|
|
2
|
+
import type Ajv from "ajv";
|
|
3
|
+
/**
|
|
4
|
+
* Clean all properties from custom metadata recursively. Custom metadata are key that:
|
|
5
|
+
* - Either with the name "metadata"
|
|
6
|
+
* - Or starting with "ui:"
|
|
7
|
+
* Also removes properties that have "ai:hidden" set to true
|
|
8
|
+
*/
|
|
9
|
+
export declare function toLLMSchema<T extends TSchema = TObject>(schema: T, ajv?: Ajv): T;
|
|
10
|
+
/**
|
|
11
|
+
* Inlines referenced schemas from AJV into the schema's $defs section
|
|
12
|
+
* @param schema - The schema containing $ref references
|
|
13
|
+
* @param ajv - The AJV instance containing the referenced schemas
|
|
14
|
+
* @returns A new schema with references inlined in $defs
|
|
15
|
+
*/
|
|
16
|
+
export declare function inlineSchemaRefs<T extends TSchema>(schema: T, ajv: Ajv): T & {
|
|
17
|
+
$defs: Record<string, TSchema>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/llm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAEhF;AA0FD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GA2K/C,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAC7D"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
|
+
|
|
3
|
+
import{a,b}from"../chunk-F4JNKU7J.js";import"../chunk-3FPFR5RA.js";import"../chunk-7UBMXMNJ.js";import"../chunk-US53TNMK.js";import"../chunk-VK26ZZFR.js";import"../chunk-MVCVVKBY.js";import"../chunk-AB3IMRXZ.js";import"../chunk-GC5OWY2Z.js";import"../chunk-DHSWVVMI.js";import"../chunk-Z4YKRLOX.js";import"../chunk-SFDRAHYP.js";import"../chunk-JRCVYDCD.js";import"../chunk-DKNOZLA6.js";import"../chunk-HSRXUIVM.js";import"../chunk-5WY7LYXK.js";import"../chunk-SFKZAUPW.js";export{b as inlineSchemaRefs,a as toLLMSchema};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TArray, type TObject, type TSchema } from "@sinclair/typebox";
|
|
2
2
|
import type { PageAttributes } from "../attributes";
|
|
3
3
|
export declare function normalizeSchemaEnum(schema: TSchema): Array<{
|
|
4
4
|
const: string;
|
|
@@ -7,4 +7,9 @@ export declare function normalizeSchemaEnum(schema: TSchema): Array<{
|
|
|
7
7
|
export declare function getSchemaDefaults<T extends TObject | TArray>(schema: T, mode?: "mobile" | "desktop"): T extends TObject ? Record<string, unknown> : unknown[];
|
|
8
8
|
export type FieldFilter<T extends TSchema = TSchema, P extends Record<string, unknown> = Record<string, unknown>> = (propsSchema: T, formData: P, pageAttributes: PageAttributes) => boolean;
|
|
9
9
|
export declare function filterSchemaProperties(schema: TObject, filter: (prop: TSchema) => boolean): Record<string, TSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a JSON schema by following $ref references recursively.
|
|
12
|
+
* Handles nested objects, arrays, and complex schema structures.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveSchema<T extends TSchema = TSchema>(schema: T): T;
|
|
10
15
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAe5F;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,GAAG,MAAM,EAC1D,MAAM,EAAE,CAAC,EACT,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAC1B,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAwCzD;AAuCD,MAAM,MAAM,WAAW,CACrB,CAAC,SAAS,OAAO,GAAG,OAAO,EAC3B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACzD,CAAC,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC;AAE7E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,2BAgBzF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAEvE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
import{a,b,c}from"../chunk-
|
|
3
|
+
import{a,b,c,d}from"../chunk-LEWKHCRI.js";import"../chunk-F4JNKU7J.js";import"../chunk-3FPFR5RA.js";import"../chunk-7UBMXMNJ.js";import"../chunk-US53TNMK.js";import"../chunk-VK26ZZFR.js";import"../chunk-MVCVVKBY.js";import"../chunk-AB3IMRXZ.js";import"../chunk-GC5OWY2Z.js";import"../chunk-DHSWVVMI.js";import"../chunk-Z4YKRLOX.js";import"../chunk-SFDRAHYP.js";import"../chunk-JRCVYDCD.js";import"../chunk-DKNOZLA6.js";import"../chunk-HSRXUIVM.js";import"../chunk-5WY7LYXK.js";import"../chunk-SFKZAUPW.js";export{c as filterSchemaProperties,b as getSchemaDefaults,a as normalizeSchemaEnum,d as resolveSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/tests/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type SchemaOptions } from "@sinclair/typebox";
|
|
2
2
|
import type { alignItems, alignSelf, justifyContent } from "../bricks/props/align";
|
|
3
|
-
import type { basicGap } from "../bricks/props/gap";
|
|
4
3
|
import type { background, backgroundColor } from "../bricks/props/background";
|
|
5
4
|
import type { border, rounding } from "../bricks/props/border";
|
|
6
5
|
import type { borderColor, color } from "../bricks/props/color";
|
|
@@ -9,8 +8,7 @@ import type { cssLength } from "../bricks/props/css-length";
|
|
|
9
8
|
import type { shadow, textShadow } from "../bricks/props/effects";
|
|
10
9
|
import type { fontSize, fontSizeXL, textContent } from "../bricks/props/text";
|
|
11
10
|
import type { icon, urlOrPageId } from "../bricks/props/string";
|
|
12
|
-
import type {
|
|
13
|
-
import type { colorPreset, gradientDirection } from "../bricks/props/color-preset";
|
|
11
|
+
import type { colorPreset } from "../bricks/props/color-preset";
|
|
14
12
|
import type { image } from "../bricks/props/image";
|
|
15
13
|
import type { direction } from "../bricks/props/direction";
|
|
16
14
|
import type { loop, queryUse } from "../bricks/props/dynamic";
|
|
@@ -25,15 +23,12 @@ export interface SchemaTypeMap {
|
|
|
25
23
|
"styles:fontSizeXL": ReturnType<typeof fontSizeXL>;
|
|
26
24
|
"styles:hidden": ReturnType<typeof hidden>;
|
|
27
25
|
"styles:border": ReturnType<typeof border>;
|
|
28
|
-
"styles:padding": ReturnType<typeof padding>;
|
|
29
26
|
"styles:color": ReturnType<typeof color>;
|
|
30
27
|
"styles:borderColor": ReturnType<typeof borderColor>;
|
|
31
28
|
"styles:direction": ReturnType<typeof direction>;
|
|
32
|
-
"styles:gradientDirection": ReturnType<typeof gradientDirection>;
|
|
33
29
|
"styles:shadow": ReturnType<typeof shadow>;
|
|
34
30
|
"styles:textShadow": ReturnType<typeof textShadow>;
|
|
35
31
|
"styles:cssLength": ReturnType<typeof cssLength>;
|
|
36
|
-
"styles:basicGap": ReturnType<typeof basicGap>;
|
|
37
32
|
"styles:rounding": ReturnType<typeof rounding>;
|
|
38
33
|
"presets:color": ReturnType<typeof colorPreset>;
|
|
39
34
|
"assets:image": ReturnType<typeof image>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-ref.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/typed-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"typed-ref.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/typed-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA+B,MAAM,mBAAmB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,mBAAmB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACnD,wBAAwB,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;IAC7D,uBAAuB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC3D,mBAAmB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACnD,kBAAkB,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;IACjD,iBAAiB,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;IAC/C,mBAAmB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACnD,eAAe,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;IAC3C,eAAe,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;IAC3C,cAAc,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;IACzC,oBAAoB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IACrD,kBAAkB,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;IACjD,eAAe,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;IAC3C,mBAAmB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACnD,kBAAkB,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;IACjD,iBAAiB,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;IAC/C,eAAe,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IAChD,cAAc,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;IACzC,cAAc,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IAC/C,qBAAqB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IACtD,cAAc,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;IACxC,kBAAkB,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;IAChD,aAAa,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;IACvC,cAAc,EAAE,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;CAGzC;AAGD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,aAAa,EACpD,EAAE,EAAE,CAAC,EACL,OAAO,GAAE,aAAkB,GAC1B,aAAa,CAAC,CAAC,CAAC,CAGlB"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upstart.gg/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.131",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
|
-
"dist"
|
|
6
|
+
"dist",
|
|
7
|
+
"src"
|
|
7
8
|
],
|
|
8
9
|
"sideEffects": true,
|
|
9
10
|
"exports": {
|
|
@@ -15,24 +16,18 @@
|
|
|
15
16
|
"types": "./dist/shared/*.d.ts",
|
|
16
17
|
"import": "./dist/shared/*.js"
|
|
17
18
|
},
|
|
18
|
-
"./builder/*": {
|
|
19
|
-
"import": "./dist/node/builder/*.js"
|
|
20
|
-
},
|
|
21
|
-
"./cli/*": {
|
|
22
|
-
"import": "./dist/node/cli/*.js"
|
|
23
|
-
},
|
|
24
19
|
"./*": {
|
|
25
20
|
"types": "./dist/shared/*.d.ts",
|
|
26
21
|
"import": "./dist/shared/*.js"
|
|
27
22
|
}
|
|
28
23
|
},
|
|
29
24
|
"dependencies": {
|
|
25
|
+
"@apidevtools/json-schema-ref-parser": "14.2.0",
|
|
30
26
|
"@date-fns/utc": "1.2.0",
|
|
27
|
+
"@notionhq/client": "4.0.2",
|
|
31
28
|
"@radix-ui/themes": "3.2.1",
|
|
32
29
|
"@rowanmanning/feed-parser": "2.1.0",
|
|
33
|
-
"@sinclair/typebox": "0.
|
|
34
|
-
"ajv": "8.17.1",
|
|
35
|
-
"ajv-formats": "3.0.1",
|
|
30
|
+
"@sinclair/typebox": "0.34.41",
|
|
36
31
|
"chroma-js": "3.1.2",
|
|
37
32
|
"date-fns": "3.6.0",
|
|
38
33
|
"debug": "4.3.6",
|
|
@@ -40,20 +35,23 @@
|
|
|
40
35
|
"get-port": "7.1.0",
|
|
41
36
|
"http-errors-enhanced": "2.0.8",
|
|
42
37
|
"immer": "10.1.1",
|
|
43
|
-
"lodash-es": "4.17.21",
|
|
44
38
|
"nanoid": "5.1.5",
|
|
45
39
|
"react-hotkeys-hook": "4.5.1",
|
|
46
|
-
"react-icons": "5.5.0",
|
|
47
40
|
"react-selecto": "1.26.3",
|
|
48
41
|
"usehooks-ts": "3.1.0",
|
|
49
42
|
"zundo": "2.3.0",
|
|
50
43
|
"zustand": "4.5.5",
|
|
51
|
-
"@upstart.gg/style-system": "0.0.
|
|
44
|
+
"@upstart.gg/style-system": "0.0.131"
|
|
52
45
|
},
|
|
53
46
|
"peerDependencies": {
|
|
54
47
|
"@headlessui/react": "^2.2.1",
|
|
55
48
|
"react": "18.3.0-canary-3d9b20132-20240124",
|
|
56
|
-
"react-dom": "18.3.0-canary-3d9b20132-20240124"
|
|
49
|
+
"react-dom": "18.3.0-canary-3d9b20132-20240124",
|
|
50
|
+
"ai": "^5.0.0",
|
|
51
|
+
"ajv": "^8.17.1",
|
|
52
|
+
"ajv-formats": "^3.0.1",
|
|
53
|
+
"lodash-es": "^4.17.21",
|
|
54
|
+
"react-icons": "^5.5.0"
|
|
57
55
|
},
|
|
58
56
|
"devDependencies": {
|
|
59
57
|
"@cloudflare/workers-types": "4.20240806.0",
|
|
@@ -69,7 +67,10 @@
|
|
|
69
67
|
"concurrently": "8.2.2",
|
|
70
68
|
"express": "^4.21.2",
|
|
71
69
|
"rimraf": "6.0.1",
|
|
72
|
-
"tsup": "^8.5.0"
|
|
70
|
+
"tsup": "^8.5.0",
|
|
71
|
+
"ajv": "^8.17.1",
|
|
72
|
+
"ajv-formats": "^3.0.1",
|
|
73
|
+
"lodash-es": "^4.17.21"
|
|
73
74
|
},
|
|
74
75
|
"author": "Matthias Etienne",
|
|
75
76
|
"publishConfig": {
|
|
@@ -77,9 +78,8 @@
|
|
|
77
78
|
},
|
|
78
79
|
"scripts": {
|
|
79
80
|
"build": "tsup",
|
|
80
|
-
"build:
|
|
81
|
-
"
|
|
82
|
-
"dev": "NODE_OPTIONS='--max-old-space-size=12384' tsup --watch",
|
|
81
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
82
|
+
"dev": "tsup --watch",
|
|
83
83
|
"sizetest": "pnpm build && du -sh dist",
|
|
84
84
|
"lint": "biome check --write . && tsc --noEmit",
|
|
85
85
|
"ci:lint": "tsc --noEmit",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Static, Type } from "@sinclair/typebox";
|
|
2
|
+
|
|
3
|
+
export const waitingMessageSchema = Type.Object({
|
|
4
|
+
waitingMessage: Type.String({
|
|
5
|
+
description:
|
|
6
|
+
"Message to display, in the user language, while the agent is creating / editing content. Example: 'Creating themes', 'Creating section', 'Searching images'. Don't use triple dots at the end.",
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type WaitingMessageSchema = Static<typeof waitingMessageSchema>;
|
|
11
|
+
|
|
12
|
+
export const askUserChoiceInput = Type.Object({
|
|
13
|
+
context: Type.String({
|
|
14
|
+
description:
|
|
15
|
+
"The context of the choice. Should be a lowercased word or slug. For example, if the choice is regarding a question about the Sitemap simple, then use 'sitemap'. ",
|
|
16
|
+
}),
|
|
17
|
+
question: Type.Optional(
|
|
18
|
+
Type.String({
|
|
19
|
+
description: "The question to present to the user if not already sent to the user.",
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
choices: Type.Array(Type.String(), {
|
|
23
|
+
description: "The list of choices to present to the user. Can be a maximum of 6 choices.",
|
|
24
|
+
maxItems: 6,
|
|
25
|
+
}),
|
|
26
|
+
allowMultiple: Type.Optional(
|
|
27
|
+
Type.Boolean({
|
|
28
|
+
description: "Whether to allow multiple choices to be selected",
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export type AskUserChoiceInput = Static<typeof askUserChoiceInput>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Define your custom message type once
|
|
2
|
+
import type { UIMessage } from "ai";
|
|
3
|
+
import type { Theme } from "../theme";
|
|
4
|
+
import type { Sitemap } from "../sitemap";
|
|
5
|
+
import type { VersionedPage } from "../page";
|
|
6
|
+
import type { PageAttributes, SiteAttributes } from "../attributes";
|
|
7
|
+
import type { Brick, Section } from "../bricks";
|
|
8
|
+
import type { AskUserChoiceInput, WaitingMessageSchema } from "./schemas";
|
|
9
|
+
import type { Datarecord, InternalDatarecord } from "../datarecords/types";
|
|
10
|
+
import type { InternalDatasource } from "../datasources/types";
|
|
11
|
+
import type { ImageSearchResultsType } from "../images";
|
|
12
|
+
import type { NavbarProps } from "../bricks/manifests/navbar.manifest";
|
|
13
|
+
import type { FooterProps } from "../bricks/manifests/footer.manifest";
|
|
14
|
+
// ... import your tool and data part types
|
|
15
|
+
|
|
16
|
+
export type Tools = {
|
|
17
|
+
askUserChoice: {
|
|
18
|
+
input: AskUserChoiceInput;
|
|
19
|
+
output: string | string[]; // The user's choice(s
|
|
20
|
+
};
|
|
21
|
+
listThemes: {
|
|
22
|
+
input: null; // Just type the waiting message for now
|
|
23
|
+
output: Theme[];
|
|
24
|
+
};
|
|
25
|
+
createSection: {
|
|
26
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
27
|
+
output: Section;
|
|
28
|
+
};
|
|
29
|
+
getSection: {
|
|
30
|
+
input: { id: string }; // Just type the waiting message for now
|
|
31
|
+
output: Section | string; // Error string if not found
|
|
32
|
+
};
|
|
33
|
+
listSections: {
|
|
34
|
+
input: null; // Just type the waiting message for now
|
|
35
|
+
output: Section[];
|
|
36
|
+
};
|
|
37
|
+
createThemes: {
|
|
38
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
39
|
+
output: Theme[];
|
|
40
|
+
};
|
|
41
|
+
getCurrentTheme: {
|
|
42
|
+
input: null; // Just type the waiting message for now
|
|
43
|
+
output: Theme; // Theme or message if no theme applied yet
|
|
44
|
+
};
|
|
45
|
+
createSitemap: {
|
|
46
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
47
|
+
output: Sitemap;
|
|
48
|
+
};
|
|
49
|
+
getSitemap: {
|
|
50
|
+
input: null; // Just type the waiting message for now
|
|
51
|
+
output: Sitemap;
|
|
52
|
+
};
|
|
53
|
+
createPage: {
|
|
54
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
55
|
+
output: VersionedPage;
|
|
56
|
+
};
|
|
57
|
+
editPage: {
|
|
58
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
59
|
+
output: VersionedPage;
|
|
60
|
+
};
|
|
61
|
+
getCurrentPage: {
|
|
62
|
+
input: null; // Just type the waiting message for now
|
|
63
|
+
output: VersionedPage;
|
|
64
|
+
};
|
|
65
|
+
createNavbar: {
|
|
66
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
67
|
+
output: NavbarProps;
|
|
68
|
+
};
|
|
69
|
+
createFooter: {
|
|
70
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
71
|
+
output: FooterProps;
|
|
72
|
+
};
|
|
73
|
+
createBrick: {
|
|
74
|
+
input: WaitingMessageSchema & { sectionId: string; index: number }; // Just type the waiting message for now
|
|
75
|
+
output: Brick;
|
|
76
|
+
};
|
|
77
|
+
listImages: {
|
|
78
|
+
input: null; // Just type the waiting message for now
|
|
79
|
+
output: ImageSearchResultsType;
|
|
80
|
+
};
|
|
81
|
+
listSiteQueries: {
|
|
82
|
+
input: null; // Just type the waiting message for now
|
|
83
|
+
output: NonNullable<SiteAttributes["queries"]>;
|
|
84
|
+
};
|
|
85
|
+
createSiteQueries: {
|
|
86
|
+
input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
|
|
87
|
+
output: NonNullable<SiteAttributes["queries"]>;
|
|
88
|
+
};
|
|
89
|
+
editSiteQueries: {
|
|
90
|
+
input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
|
|
91
|
+
output: NonNullable<SiteAttributes["queries"]>;
|
|
92
|
+
};
|
|
93
|
+
createPageQueries: {
|
|
94
|
+
input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
|
|
95
|
+
output: NonNullable<PageAttributes["queries"]>;
|
|
96
|
+
};
|
|
97
|
+
editPageQueries: {
|
|
98
|
+
input: WaitingMessageSchema & { instructions: string }; // Just type the waiting message for now
|
|
99
|
+
output: NonNullable<PageAttributes["queries"]>;
|
|
100
|
+
};
|
|
101
|
+
createSiteAttributes: {
|
|
102
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
103
|
+
output: SiteAttributes;
|
|
104
|
+
};
|
|
105
|
+
getSiteAttributes: {
|
|
106
|
+
input: null; // Just type the waiting message for now
|
|
107
|
+
output: SiteAttributes;
|
|
108
|
+
};
|
|
109
|
+
createDatasource: {
|
|
110
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
111
|
+
output: InternalDatasource;
|
|
112
|
+
};
|
|
113
|
+
listDatasources: {
|
|
114
|
+
input: null; // Just type the waiting message for now
|
|
115
|
+
output: InternalDatasource[];
|
|
116
|
+
};
|
|
117
|
+
createDatarecord: {
|
|
118
|
+
input: WaitingMessageSchema; // Just type the waiting message for now
|
|
119
|
+
output: Datarecord;
|
|
120
|
+
};
|
|
121
|
+
listDatarecords: {
|
|
122
|
+
input: null; // Just type the waiting message for now
|
|
123
|
+
output: Datarecord[];
|
|
124
|
+
};
|
|
125
|
+
searchImages: {
|
|
126
|
+
input: WaitingMessageSchema & { query: string }; // Just type the waiting message for now
|
|
127
|
+
output: ImageSearchResultsType;
|
|
128
|
+
};
|
|
129
|
+
deleteBrick: {
|
|
130
|
+
input: { id: string; waitingMessage: string }; // Just type the waiting message for now
|
|
131
|
+
output: boolean | string; // true if deleted, error message if failed
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
type Metadata = {
|
|
136
|
+
creditsUsed: number;
|
|
137
|
+
userLanguage: string; // ISO code of the user's language, e.g. "en", "fr", "es"
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// For now, let's keep it simple
|
|
141
|
+
type Data = {
|
|
142
|
+
themes: Theme[];
|
|
143
|
+
sitemap: Sitemap;
|
|
144
|
+
page: VersionedPage;
|
|
145
|
+
brick: {
|
|
146
|
+
sectionId: string;
|
|
147
|
+
brick: Brick;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type UpstartUIMessage = UIMessage<Metadata, Data, Tools>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import Ajv, { type ErrorObject } from "ajv";
|
|
2
|
+
import addFormats from "ajv-formats";
|
|
3
|
+
import { alignItems, alignSelf, justifyContent } from "./bricks/props/align";
|
|
4
|
+
import { background, backgroundColor } from "./bricks/props/background";
|
|
5
|
+
import { border, rounding } from "./bricks/props/border";
|
|
6
|
+
import { borderColor, color } from "./bricks/props/color";
|
|
7
|
+
import { hidden } from "./bricks/props/common";
|
|
8
|
+
import { cssLength } from "./bricks/props/css-length";
|
|
9
|
+
import { shadow, textShadow } from "./bricks/props/effects";
|
|
10
|
+
import { fontSize, textContent } from "./bricks/props/text";
|
|
11
|
+
import { icon, urlOrPageId } from "./bricks/props/string";
|
|
12
|
+
import { colorPreset } from "./bricks/props/color-preset";
|
|
13
|
+
import { image } from "./bricks/props/image";
|
|
14
|
+
import { direction } from "./bricks/props/direction";
|
|
15
|
+
import { loop, queryUse } from "./bricks/props/dynamic";
|
|
16
|
+
import { tags } from "./bricks/props/tags";
|
|
17
|
+
|
|
18
|
+
export type { AnySchemaObject, JSONSchemaType, JSONType, SchemaObject } from "ajv";
|
|
19
|
+
|
|
20
|
+
export const jsonStringsSupportedFormats = ["date-time", "date", "email", "url"] as const;
|
|
21
|
+
|
|
22
|
+
export function createAJVInstance() {
|
|
23
|
+
const ajv = new Ajv({
|
|
24
|
+
useDefaults: true,
|
|
25
|
+
strictSchema: false,
|
|
26
|
+
validateSchema: false,
|
|
27
|
+
coerceTypes: true,
|
|
28
|
+
allErrors: true,
|
|
29
|
+
inlineRefs: true,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
ajv.addSchema(background(), "styles:background");
|
|
33
|
+
ajv.addSchema(backgroundColor(), "styles:backgroundColor");
|
|
34
|
+
ajv.addSchema(justifyContent(), "styles:justifyContent");
|
|
35
|
+
ajv.addSchema(alignItems(), "styles:alignItems");
|
|
36
|
+
ajv.addSchema(alignSelf(), "styles:alignSelf");
|
|
37
|
+
ajv.addSchema(rounding(), "styles:rounding");
|
|
38
|
+
ajv.addSchema(fontSize(), "styles:fontSize");
|
|
39
|
+
ajv.addSchema(hidden(), "styles:hidden");
|
|
40
|
+
ajv.addSchema(direction(), "styles:direction");
|
|
41
|
+
ajv.addSchema(border(), "styles:border");
|
|
42
|
+
ajv.addSchema(color(), "styles:color");
|
|
43
|
+
ajv.addSchema(borderColor(), "styles:borderColor");
|
|
44
|
+
ajv.addSchema(shadow(), "styles:shadow");
|
|
45
|
+
ajv.addSchema(textShadow(), "styles:textShadow");
|
|
46
|
+
ajv.addSchema(cssLength(), "styles:cssLength");
|
|
47
|
+
ajv.addSchema(image(), "assets:image");
|
|
48
|
+
ajv.addSchema(icon(), "assets:icon");
|
|
49
|
+
ajv.addSchema(textContent(), "content:text");
|
|
50
|
+
ajv.addSchema(urlOrPageId(), "content:urlOrPageId");
|
|
51
|
+
ajv.addSchema(loop(), "content:loop");
|
|
52
|
+
ajv.addSchema(queryUse(), "content:queryUse");
|
|
53
|
+
ajv.addSchema(colorPreset(), "presets:color");
|
|
54
|
+
ajv.addSchema(tags(), "content:tags");
|
|
55
|
+
|
|
56
|
+
// Add formats to Ajv
|
|
57
|
+
addFormats(ajv, [...jsonStringsSupportedFormats]);
|
|
58
|
+
|
|
59
|
+
ajv.addFormat("slug", {
|
|
60
|
+
validate: (data: string) => typeof data === "string",
|
|
61
|
+
async: false,
|
|
62
|
+
type: "string",
|
|
63
|
+
});
|
|
64
|
+
ajv.addFormat("image", {
|
|
65
|
+
validate: (data: string) => typeof data === "string",
|
|
66
|
+
async: false,
|
|
67
|
+
type: "string",
|
|
68
|
+
});
|
|
69
|
+
ajv.addFormat("file", {
|
|
70
|
+
validate: (data: string) => typeof data === "string",
|
|
71
|
+
async: false,
|
|
72
|
+
type: "string",
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
ajv.addFormat("nanoid", {
|
|
76
|
+
validate: (data: string) => typeof data === "string",
|
|
77
|
+
async: false,
|
|
78
|
+
type: "string",
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
ajv.addFormat("richtext", {
|
|
82
|
+
validate: (data: string) => typeof data === "string",
|
|
83
|
+
async: false,
|
|
84
|
+
type: "string",
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
ajv.addFormat("markdown", {
|
|
88
|
+
validate: (data: string) => typeof data === "string",
|
|
89
|
+
async: false,
|
|
90
|
+
type: "string",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
ajv.addFormat("multiline", {
|
|
94
|
+
validate: (data: string) => typeof data === "string",
|
|
95
|
+
async: false,
|
|
96
|
+
type: "string",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
ajv.addFormat("password", {
|
|
100
|
+
validate: (data: string) => typeof data === "string",
|
|
101
|
+
async: false,
|
|
102
|
+
type: "string",
|
|
103
|
+
});
|
|
104
|
+
return ajv;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const ajv = createAJVInstance();
|
|
108
|
+
|
|
109
|
+
export function serializeAjvErrors(errors: ErrorObject[] | null | undefined): string {
|
|
110
|
+
if (!errors || errors.length === 0) {
|
|
111
|
+
return "Unknown validation error";
|
|
112
|
+
}
|
|
113
|
+
return errors
|
|
114
|
+
.map((error) => {
|
|
115
|
+
const { instancePath, message, params } = error;
|
|
116
|
+
const path = instancePath || "root";
|
|
117
|
+
const details = Object.entries(params || {})
|
|
118
|
+
.map(([key, value]) => `${key}: ${value}`)
|
|
119
|
+
.join(", ");
|
|
120
|
+
return `${path} ${message} (${details})`;
|
|
121
|
+
})
|
|
122
|
+
.join("; ");
|
|
123
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function init() {
|
|
2
|
+
window.upstartQueue = window.upstartQueue || [];
|
|
3
|
+
document.addEventListener("visibilitychange", function logData() {
|
|
4
|
+
if (document.visibilityState === "hidden") {
|
|
5
|
+
const payload = JSON.stringify(window.upstartQueue);
|
|
6
|
+
if (navigator.sendBeacon?.(window.location.pathname, payload)) {
|
|
7
|
+
console.debug("beacon sent", payload);
|
|
8
|
+
window.upstartQueue = [];
|
|
9
|
+
} else {
|
|
10
|
+
console.debug("beacon failed", payload);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BeaconPayload } from "./types";
|
|
2
|
+
|
|
3
|
+
export function track(type: BeaconPayload["e"], data: BeaconPayload["d"] = {}) {
|
|
4
|
+
const payload: BeaconPayload = {
|
|
5
|
+
e: type,
|
|
6
|
+
t: Date.now(),
|
|
7
|
+
d: data,
|
|
8
|
+
};
|
|
9
|
+
window.upstartQueue.push(payload);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
document.addEventListener(
|
|
13
|
+
"click",
|
|
14
|
+
function (e) {
|
|
15
|
+
const target = e.target as HTMLElement;
|
|
16
|
+
track("click", {
|
|
17
|
+
buttonId: target.id,
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
true,
|
|
21
|
+
);
|