Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types: add top level changelog, and share types across api nodes #938

Merged
merged 9 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
209 changes: 209 additions & 0 deletions fern/apis/fdr/definition/docs/v1/commons/commons.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,216 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

types:
FileId: string
PageId: string
Url: string
SubpackageId: string
EndpointId: string
WebSocketId: string
WebhookId: string

FileIdOrUrl:
union:
fileId: FileId
url: Url

RgbaColor:
properties:
r: integer
g: integer
b: integer
a: optional<double>

# SEO Config

MetadataConfig:
properties:
"og:site_name": optional<string>
"og:title": optional<string>
"og:description": optional<string>
"og:url": optional<string>
"og:image": optional<FileIdOrUrl>
"og:image:width": optional<double>
"og:image:height": optional<double>
"og:locale": optional<string>
"og:logo": optional<FileIdOrUrl>
"twitter:title": optional<string>
"twitter:description": optional<string>
"twitter:handle": optional<string>
"twitter:image": optional<FileIdOrUrl>
"twitter:site": optional<string>
"twitter:url": optional<string>
"twitter:card": optional<TwitterCardSetting>

RedirectConfig:
properties:
source: string
destination: string

TwitterCardSetting:
enum:
- summary
- summary_large_image
- app
- player

NavbarLink:
union:
filled: NavbarLinkMetadata
outlined: NavbarLinkMetadata
minimal: NavbarLinkMetadata
github: NavbarGithubMetadata

# deprecated
primary: NavbarLinkMetadata # -> outlined
secondary: NavbarLinkMetadata # -> minimal

NavbarLinkMetadata:
properties:
url: Url
text: optional<string>
icon: optional<string>
rightIcon: optional<string>
rounded: optional<boolean>

NavbarGithubMetadata:
properties:
url: Url # github repo url

FooterLink:
union:
github: Url
twitter: Url
x: Url
linkedin: Url
youtube: Url
instagram: Url
facebook: Url
discord: Url
slack: Url
hackernews: Url
medium: Url
website: Url

# Customization Config

CssConfig:
properties:
inline: optional<list<string>>

JsConfig:
properties:
remote: optional<list<JsRemoteConfig>>
files: list<JsFileConfig>
inline: optional<list<string>>

JsRemoteConfig:
properties:
url: Url
strategy: optional<JsScriptStrategy>

JsFileConfig:
properties:
fileId: FileId
strategy: optional<JsScriptStrategy>

JsScriptStrategy:
enum:
- beforeInteractive
- afterInteractive # default
- lazyOnload

IntegrationsConfig:
properties:
intercom: optional<string>

# Typography

DocsTypographyConfigV2:
properties:
headingsFont: optional<FontConfigV2>
bodyFont: optional<FontConfigV2>
codeFont: optional<FontConfigV2>

# TODO: add support for google fonts
FontConfigV2:
union:
custom: CustomFontConfig

CustomFontConfig:
properties:
name: string
variants: list<CustomFontConfigVariant>
display: optional<FontDisplay>
fallback: optional<list<string>>

# declarations
fontVariationSettings: optional<string>

CustomFontConfigVariant:
properties:
fontFile: FileId
weight: optional<list<string>>
style: optional<list<FontStyle>>

FontStyle:
enum:
- normal
- italic

FontDisplay:
enum:
- auto
- block
- swap
- fallback
- optional

# Deprecated

ThemedFileId:
availability: deprecated
properties:
dark: optional<FileId>
light: optional<FileId>

ColorsConfig:
availability: deprecated
properties:
accentPrimary: optional<RgbaColor>

ColorsConfigV2:
availability: deprecated
properties:
accentPrimary: optional<ColorConfig>
background: optional<ColorConfig>

ColorConfig:
availability: deprecated
union:
unthemed: ColorUnthemedConfig
themed: ColorThemedConfig

ColorUnthemedConfig:
availability: deprecated
properties:
color: optional<RgbaColor>

ColorThemedConfig:
availability: deprecated
properties:
dark: optional<RgbaColor>
light: optional<RgbaColor>

DocsTypographyConfig:
availability: deprecated
properties:
headingsFont: optional<FontConfig>
bodyFont: optional<FontConfig>
codeFont: optional<FontConfig>

FontConfig:
availability: deprecated
properties:
name: string
fontFile: FileId
64 changes: 38 additions & 26 deletions fern/apis/fdr/definition/docs/v1/db/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ imports:
apiReadV1: ../../../api/v1/read/__package__.yml
apiReadV1Endpoint: ../../../api/v1/read/endpoint.yml
docsReadV1: ../read/__package__.yml
commons: ../commons/commons.yml

types:
DocsDefinitionDb:
Expand All @@ -14,27 +15,29 @@ types:
v3: DocsDefinitionDbV3

DocsDefinitionDbV1:
availability: deprecated
properties:
pages: map<docsReadV1.PageId, docsReadV1.PageContent>
pages: map<commons.PageId, docsReadV1.PageContent>
referencedApis: set<rootCommons.ApiDefinitionId>
files: map<docsReadV1.FileId, DbFileInfo>
files: map<commons.FileId, DbFileInfo>
config: DocsDbConfig
colors: optional<docsReadV1.ColorsConfig>
colors: optional<commons.ColorsConfig>

DocsDefinitionDbV2:
availability: deprecated
properties:
pages: map<docsReadV1.PageId, docsReadV1.PageContent>
pages: map<commons.PageId, docsReadV1.PageContent>
referencedApis: set<rootCommons.ApiDefinitionId>
files: map<docsReadV1.FileId, DbFileInfo>
files: map<commons.FileId, DbFileInfo>
config: DocsDbConfig
colors: optional<docsReadV1.ColorsConfig>
typography: optional<docsReadV1.DocsTypographyConfig>
colors: optional<commons.ColorsConfig>
typography: optional<commons.DocsTypographyConfig>

DocsDefinitionDbV3:
properties:
pages: map<docsReadV1.PageId, docsReadV1.PageContent>
pages: map<commons.PageId, docsReadV1.PageContent>
referencedApis: set<rootCommons.ApiDefinitionId>
files: map<docsReadV1.FileId, DbFileInfoV2>
files: map<commons.FileId, DbFileInfoV2>
config: DocsDbConfig

DocsDbConfig:
Expand All @@ -43,46 +46,46 @@ types:

# navigation
navigation: NavigationConfig
navbarLinks: optional<list<docsReadV1.NavbarLink>>
footerLinks: optional<list<docsReadV1.FooterLink>>
navbarLinks: optional<list<commons.NavbarLink>>
footerLinks: optional<list<commons.FooterLink>>

# logo
logoHeight: optional<docsReadV1.Height>
logoHref: optional<docsReadV1.Url>
favicon: optional<docsReadV1.FileId>
logoHref: optional<commons.Url>
favicon: optional<commons.FileId>

# seo
metadata: optional<docsReadV1.MetadataConfig>
redirects: optional<list<docsReadV1.RedirectConfig>>
metadata: optional<commons.MetadataConfig>
redirects: optional<list<commons.RedirectConfig>>

# styles
backgroundImage: optional<docsReadV1.FileId>
backgroundImage: optional<commons.FileId>
colorsV3: optional<docsReadV1.ColorsConfigV3>
layout: optional<docsReadV1.DocsLayoutConfig>
typographyV2: optional<docsReadV1.DocsTypographyConfigV2>
typographyV2: optional<commons.DocsTypographyConfigV2>

# integrations
integrations: optional<docsReadV1.IntegrationsConfig>
integrations: optional<commons.IntegrationsConfig>

# css and js
css: optional<docsReadV1.CssConfig>
js: optional<docsReadV1.JsConfig>
css: optional<commons.CssConfig>
js: optional<commons.JsConfig>

# deprecated
logo:
type: optional<docsReadV1.FileId>
type: optional<commons.FileId>
availability: deprecated
logoV2:
type: optional<docsReadV1.LogoV2>
type: optional<commons.ThemedFileId>
availability: deprecated
colors:
type: optional<docsReadV1.ColorsConfig>
type: optional<commons.ColorsConfig>
availability: deprecated
colorsV2:
type: optional<docsReadV1.ColorsConfigV2>
type: optional<commons.ColorsConfigV2>
availability: deprecated
typography:
type: optional<docsReadV1.DocsTypographyConfig>
type: optional<commons.DocsTypographyConfig>
availability: deprecated

DbFileInfoV2:
Expand Down Expand Up @@ -116,14 +119,22 @@ types:

UnversionedTabbedNavigationConfig:
properties:
tabs: list<NavigationTab>
tabs: optional<list<NavigationTab>>
tabsV2: optional<list<NavigationTabV2>>

NavigationTab:
availability: deprecated
discriminated: false
union:
- NavigationTabGroup
- docsReadV1.NavigationTabLink

NavigationTabV2:
union:
group: NavigationTabGroup
link: docsReadV1.NavigationTabLink
changelog: docsReadV1.ChangelogSection

NavigationTabGroup:
properties:
title: string
Expand Down Expand Up @@ -152,6 +163,7 @@ types:
api: ApiSection
section: DocsSection
link: docsReadV1.LinkMetadata
changelog: docsReadV1.ChangelogSection

ApiSection:
properties:
Expand Down
Loading
Loading