Skip to content

Commit

Permalink
feat: isAuthenticatedPagesDiscoverable feature flag (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Oct 10, 2024
1 parent 7f41717 commit b5ee8b9
Show file tree
Hide file tree
Showing 49 changed files with 579 additions and 149 deletions.
2 changes: 2 additions & 0 deletions fern/apis/fdr/definition/commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ types:

PropertyKey: string

AudienceId: string

EndpointIdentifier:
properties:
path: EndpointPathLiteral
Expand Down
16 changes: 15 additions & 1 deletion fern/apis/fdr/definition/navigation/latest/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,21 @@ types:
type: optional<Slug>
docs: The slug that should be used in the canonical URL rel. If not provided, the `slug` will be used.
icon: optional<string>
hidden: optional<boolean>
hidden:
type: optional<boolean>
docs: If true, this node will not be displayed in the sidebar, and noindex will be considered true.
authed:
type: optional<boolean>
docs: |
If true, this node is only visible to authenticated users.
If false, this node is only visible to all users (including anonymous).
audience:
type: optional<list<commons.AudienceId>>
availability: in-development
docs: |
The audience(s) that this node is intended for. If not provided, the node is intended for all audiences.
If provided, the node is only intended for the specified audience(s). OR logic is used for multiple audiences on a single node.
AND logic is used when evaluating audiences up the tree.
WithPage:
properties:
Expand Down
6 changes: 6 additions & 0 deletions packages/commons/fdr-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface VersionSwitcherInfo {
index: number;
availability: FernNavigation.Availability | undefined;
pointsTo: FernNavigation.Slug | undefined;
hidden: boolean | undefined;
authed: boolean | undefined;
}

interface SidebarTabGroup {
Expand All @@ -22,6 +24,8 @@ interface SidebarTabGroup {
index: number;
slug: FernNavigation.Slug;
pointsTo: FernNavigation.Slug | undefined;
hidden: boolean | undefined;
authed: boolean | undefined;
}

interface SidebarTabLink {
Expand All @@ -38,6 +42,8 @@ interface SidebarTabChangelog {
icon: string | undefined;
index: number;
slug: FernNavigation.Slug;
hidden: boolean | undefined;
authed: boolean | undefined;
}

export type SidebarTab = SidebarTabGroup | SidebarTabLink | SidebarTabChangelog;
2 changes: 2 additions & 0 deletions packages/fdr-sdk/src/__test__/__snapshots__/hume.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ exports[`hume > gets navigation root for /reference/expression-measurement-api/s

exports[`hume > gets navigation root for /support 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": false,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ exports[`no-version-no-tabs > gets navigation root for /docs 1`] = `

exports[`no-version-no-tabs > gets navigation root for /docs/api/page-6 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand All @@ -45,6 +47,8 @@ exports[`no-version-no-tabs > gets navigation root for /docs/api/section-1 1`] =

exports[`no-version-no-tabs > gets navigation root for /docs/api/section-2 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ exports[`no-version-yes-tabs > gets navigation root for /docs/api 1`] = `

exports[`no-version-yes-tabs > gets navigation root for /docs/api/page-2 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand All @@ -48,6 +50,8 @@ exports[`no-version-yes-tabs > gets navigation root for /docs/api/section-1 1`]

exports[`no-version-yes-tabs > gets navigation root for /docs/api/tab-1 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand All @@ -66,6 +70,8 @@ exports[`no-version-yes-tabs > gets navigation root for /docs/api/tab-1 3`] = `"

exports[`no-version-yes-tabs > gets navigation root for /docs/api/tab-2 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ exports[`polytomic > gets navigation root for /2023-04-25/not-found 1`] = `

exports[`polytomic > gets navigation root for /2024-02-08/guides/introduction 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": false,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ exports[`primer > gets navigation root for /docs/api/introduction/getting-starte
exports[`primer > gets navigation root for /docs/api/v2.1/api-reference/client-session-api/retrieve-client-side-token 1`] = `
{
"apiDefinitionId": "7ed504c0-fc2e-4a52-b3fd-b277869eda14",
"audience": undefined,
"authed": undefined,
"availability": undefined,
"canonicalSlug": "docs/api/v2.3/api-reference/client-session-api/retrieve-client-side-token",
"endpointId": "subpackage_clientSessionApi.retrieveClientSideToken",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ exports[`uploadcare > gets navigation root for /docs/file-management 1`] = `

exports[`uploadcare > gets navigation root for /docs/file-management/overview 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down Expand Up @@ -118,6 +120,8 @@ exports[`uploadcare > gets navigation root for /docs/introduction 1`] = `

exports[`uploadcare > gets navigation root for /docs/introduction/intro 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-1 3`]

exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-1/page-5 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand All @@ -92,6 +94,8 @@ exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-1/sect

exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-1/version-1 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand All @@ -117,6 +121,8 @@ exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-2 1`]

exports[`yes-version-no-tabs > gets navigation root for /docs/api/version-2/version-1 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ exports[`yes-version-yes-tabs > gets navigation root for /docs/api/version-1 1`]

exports[`yes-version-yes-tabs > gets navigation root for /docs/api/version-1/section-2 1`] = `
{
"audience": undefined,
"authed": undefined,
"canonicalSlug": undefined,
"hidden": undefined,
"icon": undefined,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/fdr-sdk/src/navigation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export * from "../client/generated/api/resources/commons";
export * from "./ApiDefinitionHolder";
export * as migrate from "./migrators";
export * as utils from "./utils";
export * from "./utils/pruneNavigationTree";
export * from "./versions";
export { ApiDefinitionHolder, ApiDefinitionPruner, ApiTypeIdVisitor, NodeCollector };
Loading

0 comments on commit b5ee8b9

Please sign in to comment.