Skip to content

Commit

Permalink
feat: add ApiReferenceNode to fdr read/write/db (apiV2) (#1003)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Jun 11, 2024
1 parent f72f343 commit 2e949e3
Show file tree
Hide file tree
Showing 319 changed files with 2,561 additions and 807 deletions.
161 changes: 161 additions & 0 deletions fern/apis/fdr/definition/algolia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
commons: ./commons.yml
apiReadV1Endpoint: ./api/v1/read/endpoint.yml
navigation: ./navigation/__package__.yml

types:
AlgoliaSearchIndex: string
Breadcrumbs: list<string>
IndexSegmentId: string

AlgoliaRecord:
audiences:
- read
union:
page-v3: AlgoliaPageRecordV3
endpoint-v3: AlgoliaEndpointRecordV3
websocket-v3: AlgoliaWebSocketRecordV3
webhook-v3: AlgoliaWebhookRecordV3

# deprecated
endpoint: AlgoliaEndpointRecord
page: AlgoliaPageRecord
endpoint-v2: AlgoliaEndpointRecordV2
page-v2: AlgoliaPageRecordV2

AlgoliaRecordVersionV3:
properties:
id: commons.VersionId
slug: navigation.Slug

AlgoliaPageRecordV3:
properties:
title: string
content: optional<string>
breadcrumbs: Breadcrumbs
slug: navigation.Slug
version: optional<AlgoliaRecordVersionV3>
indexSegmentId: IndexSegmentId

AlgoliaEndpointRecordV3:
extends: AlgoliaPageRecordV3
properties:
method: apiReadV1Endpoint.HttpMethod
endpointPath: list<apiReadV1Endpoint.EndpointPathPart>
isResponseStream: optional<boolean>

AlgoliaWebSocketRecordV3:
extends: AlgoliaPageRecordV3
properties:
endpointPath: list<apiReadV1Endpoint.EndpointPathPart>

AlgoliaWebhookRecordV3:
extends: AlgoliaPageRecordV3
properties:
method: apiReadV1Endpoint.HttpMethod
endpointPath: list<apiReadV1Endpoint.EndpointPathPart>

IndexSegment:
properties:
id: IndexSegmentId
searchApiKey: string

SingleAlgoliaIndexInfo:
union:
unversioned: UnversionedSingleAlgoliaIndexInfo
versioned: VersionedSingleAlgoliaIndexInfo

UnversionedSingleAlgoliaIndexInfo:
properties:
indexSegment: IndexSegment

VersionedSingleAlgoliaIndexInfo:
properties:
indexSegmentsByVersionId: map<commons.VersionId, IndexSegment>

SearchInfo:
union:
legacyMultiAlgoliaIndex:
docs: The legacy search storage where each docs website got its own algolia index.
type: LegacyMultiAlgoliaIndexInfo
singleAlgoliaIndex:
docs: Every docs website is indexed in a global Algolia Index
type: SingleAlgoliaIndexInfo

# Deprecated

LegacyMultiAlgoliaIndexInfo:
availability: deprecated
properties:
algoliaIndex: optional<string>

AlgoliaEndpointRecord:
availability: deprecated
properties:
title: string
subtitle: string
path: string # path does not include version slug
version: optional<commons.VersionId>
versionSlug: optional<string>
indexSegmentId: optional<string>

AlgoliaPageRecord:
availability: deprecated
properties:
title: string
subtitle: string
path: string # path does not include version slug
version: optional<commons.VersionId>
versionSlug: optional<string>
indexSegmentId: optional<string>

AlgoliaRecordEndpointPath:
availability: deprecated
properties:
parts: list<apiReadV1Endpoint.EndpointPathPart>

AlgoliaRecordPathPart:
availability: deprecated
properties:
name: string
urlSlug: string
skipUrlSlug: optional<boolean>

AlgoliaRecordPath:
availability: deprecated
docs: The path corresponding to a search record represented as a list of parts. If the docs are versioned, the version prefix must be added when building the string representation of the path.
properties:
parts: list<AlgoliaRecordPathPart>

AlgoliaRecordEndpointSummary:
availability: deprecated
properties:
name: optional<string>
description: optional<string>
method: apiReadV1Endpoint.HttpMethod
path: AlgoliaRecordEndpointPath

AlgoliaRecordVersion:
availability: deprecated
properties:
id: commons.VersionId
urlSlug: string

AlgoliaEndpointRecordV2:
availability: deprecated
properties:
endpoint: AlgoliaRecordEndpointSummary
path: AlgoliaRecordPath
version: optional<AlgoliaRecordVersion>
indexSegmentId: IndexSegmentId

AlgoliaPageRecordV2:
availability: deprecated
properties:
title: string
content: string
path: AlgoliaRecordPath
version: optional<AlgoliaRecordVersion>
indexSegmentId: IndexSegmentId
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

types:
ApiDefinitionId: uuid
VersionId: string

OrgId:
type: string
Expand Down
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/docs/v1/db/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ types:
union:
page: docsReadV1.PageMetadata
api: ApiSection
apiV2: docsReadV1.ApiSectionV2
section: DocsSection
link: docsReadV1.LinkMetadata
changelog: docsReadV1.ChangelogSection
Expand Down
120 changes: 10 additions & 110 deletions fern/apis/fdr/definition/docs/v1/read/__package__.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
algolia: ../../../algolia.yml
rootCommons: ../../../commons.yml
apiReadV1: ../../../api/v1/read/__package__.yml
apiReadV1Endpoint: ../../../api/v1/read/endpoint.yml
commons: ../commons/commons.yml
navigation: ../../../navigation/__package__.yml

service:
base-path: /registry/docs
Expand Down Expand Up @@ -55,58 +56,21 @@ types:

Height: double

AlgoliaSearchIndex: string

LoadDocsForUrlResponse:
properties:
baseUrl: string
definition: DocsDefinition

VersionId: string

IndexSegmentId: string

IndexSegment:
properties:
id: IndexSegmentId
searchApiKey: string

LegacyMultiAlgoliaIndexInfo:
properties:
algoliaIndex: optional<string>

SingleAlgoliaIndexInfo:
union:
unversioned: UnversionedSingleAlgoliaIndexInfo
versioned: VersionedSingleAlgoliaIndexInfo

UnversionedSingleAlgoliaIndexInfo:
properties:
indexSegment: IndexSegment

VersionedSingleAlgoliaIndexInfo:
properties:
indexSegmentsByVersionId: map<VersionId, IndexSegment>

SearchInfo:
union:
legacyMultiAlgoliaIndex:
docs: The legacy search storage where each docs website got its own algolia index.
type: LegacyMultiAlgoliaIndexInfo
singleAlgoliaIndex:
docs: Every docs website is indexed in a global Algolia Index
type: SingleAlgoliaIndexInfo

DocsDefinition:
properties:
algoliaSearchIndex: optional<AlgoliaSearchIndex>
algoliaSearchIndex: optional<algolia.AlgoliaSearchIndex>
pages: map<commons.PageId, PageContent>
apis: map<rootCommons.ApiDefinitionId, apiReadV1.ApiDefinition>
files: map<commons.FileId, commons.Url>
filesV2: map<commons.FileId, File>
id: optional<rootCommons.DocsConfigId>
config: DocsConfig
search: SearchInfo
search: algolia.SearchInfo

PageContent:
properties:
Expand Down Expand Up @@ -251,7 +215,7 @@ types:

VersionedNavigationConfigData:
properties:
version: VersionId
version: rootCommons.VersionId
urlSlug: string
availability: optional<VersionAvailability>
config: UnversionedNavigationConfig
Expand Down Expand Up @@ -305,6 +269,7 @@ types:
union:
page: PageMetadata
api: ApiSection
apiV2: ApiSectionV2
section: DocsSection
link: LinkMetadata
changelog: ChangelogSection
Expand Down Expand Up @@ -343,6 +308,10 @@ types:
longScrolling: optional<boolean>
flattened: optional<boolean>

ApiSectionV2:
properties:
node: navigation.ApiReferenceNode

ApiNavigationConfigRoot:
availability: deprecated
properties:
Expand Down Expand Up @@ -425,75 +394,6 @@ types:
name: string
url: string

AlgoliaEndpointRecord:
properties:
title: string
subtitle: string
path: string # path does not include version slug
version: optional<VersionId>
versionSlug: optional<string>
indexSegmentId: optional<string>

AlgoliaPageRecord:
properties:
title: string
subtitle: string
path: string # path does not include version slug
version: optional<VersionId>
versionSlug: optional<string>
indexSegmentId: optional<string>

AlgoliaRecordEndpointPath:
properties:
parts: list<apiReadV1Endpoint.EndpointPathPart>

AlgoliaRecordPathPart:
properties:
name: string
urlSlug: string
skipUrlSlug: optional<boolean>

AlgoliaRecordPath:
docs: The path corresponding to a search record represented as a list of parts. If the docs are versioned, the version prefix must be added when building the string representation of the path.
properties:
parts: list<AlgoliaRecordPathPart>

AlgoliaRecordEndpointSummary:
properties:
name: optional<string>
description: optional<string>
method: apiReadV1Endpoint.HttpMethod
path: AlgoliaRecordEndpointPath

AlgoliaRecordVersion:
properties:
id: VersionId
urlSlug: string

AlgoliaEndpointRecordV2:
properties:
endpoint: AlgoliaRecordEndpointSummary
path: AlgoliaRecordPath
version: optional<AlgoliaRecordVersion>
indexSegmentId: string

AlgoliaPageRecordV2:
properties:
title: string
content: string
path: AlgoliaRecordPath
version: optional<AlgoliaRecordVersion>
indexSegmentId: string

AlgoliaRecord:
audiences:
- read
union:
endpoint: AlgoliaEndpointRecord
page: AlgoliaPageRecord
endpoint-v2: AlgoliaEndpointRecordV2
page-v2: AlgoliaPageRecordV2

errors:
DomainNotRegisteredError:
status-code: 404
6 changes: 6 additions & 0 deletions fern/apis/fdr/definition/docs/v1/write/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
imports:
rootCommons: ../../../commons.yml
commons: ../commons/commons.yml
navigation: ../../../navigation/__package__.yml

service:
base-path: /registry/docs
Expand Down Expand Up @@ -252,6 +253,7 @@ types:
union:
page: PageMetadata
api: ApiSection
apiV2: ApiSectionV2
section: DocsSection
link: LinkMetadata
changelog: ChangelogSectionV2
Expand Down Expand Up @@ -301,6 +303,10 @@ types:
longScrolling: optional<boolean>
flattened: optional<boolean>

ApiSectionV2:
properties:
node: navigation.ApiReferenceNode

ApiNavigationConfigRoot:
availability: deprecated
properties:
Expand Down
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/navigation/__package__.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export: navigation
2 changes: 2 additions & 0 deletions fern/apis/fdr/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
navigation: ../navigation
Loading

0 comments on commit 2e949e3

Please sign in to comment.