diff --git a/fern/apis/fdr/definition/navigation/v1/__package__.yml b/fern/apis/fdr/definition/navigation/v1/__package__.yml index 8d111f5309..e782ba2192 100644 --- a/fern/apis/fdr/definition/navigation/v1/__package__.yml +++ b/fern/apis/fdr/definition/navigation/v1/__package__.yml @@ -2,6 +2,7 @@ imports: commons: ../../commons.yml + latest: ../latest/__package__.yml types: Slug: @@ -325,6 +326,7 @@ types: extends: - WithNodeId - WithPermissions + - latest.WithFeatureFlags properties: title: string slug: Slug diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts index 9454a536fa..4a237ac7a0 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/Client.ts @@ -165,6 +165,9 @@ export class Write { * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } @@ -192,6 +195,9 @@ export class Write { * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts index 9013997412..99fc2efc74 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/client/requests/RegisterDocsRequest.ts @@ -84,6 +84,9 @@ import * as FernRegistry from "../../../../../../../../index"; * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } @@ -111,6 +114,9 @@ import * as FernRegistry from "../../../../../../../../index"; * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts index 1409a0e827..30fdae66d3 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/Client.ts @@ -269,6 +269,9 @@ export class Write { * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } @@ -296,6 +299,9 @@ export class Write { * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts index 9013997412..99fc2efc74 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v2/resources/write/client/requests/RegisterDocsRequest.ts @@ -84,6 +84,9 @@ import * as FernRegistry from "../../../../../../../../index"; * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } @@ -111,6 +114,9 @@ import * as FernRegistry from "../../../../../../../../index"; * orphaned: { * "key": "value" * }, + * featureFlags: { + * "key": "value" + * }, * pointsTo: { * "key": "value" * } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts b/packages/fdr-sdk/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts index 3e3ace631a..dff2872e59 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts @@ -6,7 +6,8 @@ import * as FernRegistry from "../../../../../index"; export interface WithNodeMetadata extends FernRegistry.navigation.v1.WithNodeId, - FernRegistry.navigation.v1.WithPermissions { + FernRegistry.navigation.v1.WithPermissions, + FernRegistry.navigation.latest.WithFeatureFlags { title: string; slug: FernRegistry.navigation.v1.Slug; icon: string | undefined; diff --git a/packages/fdr-sdk/src/navigation/migrators/v1ToV2.ts b/packages/fdr-sdk/src/navigation/migrators/v1ToV2.ts index 5df221dcfa..9545b18a53 100644 --- a/packages/fdr-sdk/src/navigation/migrators/v1ToV2.ts +++ b/packages/fdr-sdk/src/navigation/migrators/v1ToV2.ts @@ -36,7 +36,7 @@ export class FernNavigationV1ToLatest { viewers: node.viewers, orphaned: node.orphaned, roles: node.roles, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; @@ -119,7 +119,7 @@ export class FernNavigationV1ToLatest { pointsTo: node.pointsTo ? FernNavigation.Slug(node.pointsTo) : undefined, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -146,7 +146,7 @@ export class FernNavigationV1ToLatest { noindex: node.noindex, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -186,7 +186,7 @@ export class FernNavigationV1ToLatest { pointsTo: node.pointsTo ? FernNavigation.Slug(node.pointsTo) : undefined, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -304,7 +304,7 @@ export class FernNavigationV1ToLatest { subtitle: node.subtitle, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -363,7 +363,7 @@ export class FernNavigationV1ToLatest { noindex: node.noindex, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -401,7 +401,7 @@ export class FernNavigationV1ToLatest { noindex: node.noindex, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -447,7 +447,7 @@ export class FernNavigationV1ToLatest { pointsTo: node.pointsTo ? FernNavigation.Slug(node.pointsTo) : undefined, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -480,7 +480,7 @@ export class FernNavigationV1ToLatest { noindex: node.noindex, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -504,7 +504,7 @@ export class FernNavigationV1ToLatest { year: node.year, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -528,7 +528,7 @@ export class FernNavigationV1ToLatest { month: node.month, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -554,7 +554,7 @@ export class FernNavigationV1ToLatest { noindex: node.noindex, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -594,7 +594,7 @@ export class FernNavigationV1ToLatest { availability: this.#availability(node.availability), viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -628,7 +628,7 @@ export class FernNavigationV1ToLatest { isResponseStream: node.isResponseStream, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -673,7 +673,7 @@ export class FernNavigationV1ToLatest { webSocketId: node.webSocketId, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; @@ -705,7 +705,7 @@ export class FernNavigationV1ToLatest { webhookId: node.webhookId, viewers: node.viewers, orphaned: node.orphaned, - featureFlags: undefined, + featureFlags: node.featureFlags, }; return latest; }; diff --git a/packages/fdr-sdk/src/navigation/versions/v1/converters/ApiReferenceNavigationConverter.ts b/packages/fdr-sdk/src/navigation/versions/v1/converters/ApiReferenceNavigationConverter.ts index bccc68cff3..4005d056bc 100644 --- a/packages/fdr-sdk/src/navigation/versions/v1/converters/ApiReferenceNavigationConverter.ts +++ b/packages/fdr-sdk/src/navigation/versions/v1/converters/ApiReferenceNavigationConverter.ts @@ -116,6 +116,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } @@ -158,6 +159,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } @@ -183,6 +185,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, })); } @@ -205,6 +208,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, })); } @@ -271,7 +275,6 @@ export class ApiReferenceNavigationConverter { package_.subpackages.forEach((subpackageId) => { const subpackage = this.api.subpackages[subpackageId]; if (subpackage == null) { - // eslint-disable-next-line no-console console.error( `Subpackage ${subpackageId} not found in ${this.apiDefinitionId}` ); @@ -307,6 +310,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; } ); @@ -385,6 +389,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }) ); @@ -392,7 +397,6 @@ export class ApiReferenceNavigationConverter { endpointId: (oldEndpointId) => { const endpoint = endpoints.get(oldEndpointId.value); if (endpoint == null) { - // eslint-disable-next-line no-console console.error( `Endpoint ${oldEndpointId.value} not found in ${targetSubpackageId}` ); @@ -410,7 +414,6 @@ export class ApiReferenceNavigationConverter { websocketId: (oldWebSocketId) => { const webSocket = webSockets.get(oldWebSocketId.value); if (webSocket == null) { - // eslint-disable-next-line no-console console.error( `WebSocket ${oldWebSocketId.value} not found in ${targetSubpackageId}` ); @@ -428,7 +431,6 @@ export class ApiReferenceNavigationConverter { webhookId: (oldWebhookId) => { const webhook = webhooks.get(oldWebhookId.value); if (webhook == null) { - // eslint-disable-next-line no-console console.error( `Webhook ${oldWebhookId.value} not found in ${targetSubpackageId}` ); @@ -446,7 +448,6 @@ export class ApiReferenceNavigationConverter { subpackage: ({ subpackageId, items, summaryPageId }) => { const subpackage = this.api.subpackages[subpackageId]; if (subpackage == null) { - // eslint-disable-next-line no-console console.error( `Subpackage ${subpackageId} not found in ${targetSubpackageId}` ); @@ -494,6 +495,7 @@ export class ApiReferenceNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }); }); }, diff --git a/packages/fdr-sdk/src/navigation/versions/v1/converters/ChangelogConverter.ts b/packages/fdr-sdk/src/navigation/versions/v1/converters/ChangelogConverter.ts index 7bb4087b01..4eb01a7973 100644 --- a/packages/fdr-sdk/src/navigation/versions/v1/converters/ChangelogConverter.ts +++ b/packages/fdr-sdk/src/navigation/versions/v1/converters/ChangelogConverter.ts @@ -66,6 +66,7 @@ export class ChangelogNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } @@ -102,6 +103,7 @@ export class ChangelogNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }) ), @@ -129,6 +131,7 @@ export class ChangelogNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, })) ), "month", @@ -157,6 +160,7 @@ export class ChangelogNavigationConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } diff --git a/packages/fdr-sdk/src/navigation/versions/v1/converters/NavigationConfigConverter.ts b/packages/fdr-sdk/src/navigation/versions/v1/converters/NavigationConfigConverter.ts index 0c5d44f87c..0a8d79e8fb 100644 --- a/packages/fdr-sdk/src/navigation/versions/v1/converters/NavigationConfigConverter.ts +++ b/packages/fdr-sdk/src/navigation/versions/v1/converters/NavigationConfigConverter.ts @@ -92,15 +92,14 @@ export class NavigationConfigConverter { viewers: undefined, orphaned: undefined, roles: undefined, + featureFlags: undefined, }; // tag all children of hidden nodes as hidden FernNavigation.V1.traverseDF(toRet, (node, parents) => { if ( FernNavigation.V1.hasMetadata(node) && - parents.some( - (p) => FernNavigation.V1.hasMetadata(p) && p.hidden === true - ) + parents.some((p) => FernNavigation.V1.hasMetadata(p) && p.hidden) ) { node.hidden = true; } @@ -145,6 +144,7 @@ export class NavigationConfigConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; } ); @@ -193,6 +193,7 @@ export class NavigationConfigConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } else if (tab.type === "link") { @@ -215,7 +216,7 @@ export class NavigationConfigConverter { } else if (tab.type === "changelogV3") { return tab.node as unknown as FernNavigation.V1.ChangelogNode; } else { - assertNever(tab as never); + assertNever(tab); } }), }), @@ -252,11 +253,13 @@ export class NavigationConfigConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }), authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }); } @@ -318,6 +321,7 @@ export class NavigationConfigConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }), link: (link) => @@ -368,6 +372,7 @@ export class NavigationConfigConverter { authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, }; }), api: (apiSection) => { diff --git a/packages/fdr-sdk/src/navigation/versions/v1/converters/__test__/groupByTime.test.ts b/packages/fdr-sdk/src/navigation/versions/v1/converters/__test__/groupByTime.test.ts index c7062aa31d..bc702dd686 100644 --- a/packages/fdr-sdk/src/navigation/versions/v1/converters/__test__/groupByTime.test.ts +++ b/packages/fdr-sdk/src/navigation/versions/v1/converters/__test__/groupByTime.test.ts @@ -20,6 +20,7 @@ describe("Grouping Functions", () => { viewers: undefined, orphaned: undefined, noindex: undefined, + featureFlags: undefined, }, { id: FernNavigation.V1.NodeId("entry-2"), @@ -34,6 +35,7 @@ describe("Grouping Functions", () => { viewers: undefined, orphaned: undefined, noindex: undefined, + featureFlags: undefined, }, { id: FernNavigation.V1.NodeId("entry-3"), @@ -48,6 +50,7 @@ describe("Grouping Functions", () => { viewers: undefined, orphaned: undefined, noindex: undefined, + featureFlags: undefined, }, { id: FernNavigation.V1.NodeId("entry-4"), @@ -62,6 +65,7 @@ describe("Grouping Functions", () => { viewers: undefined, orphaned: undefined, noindex: undefined, + featureFlags: undefined, }, ]; diff --git a/packages/fdr-sdk/src/navigation/versions/v1/converters/toRootNode.ts b/packages/fdr-sdk/src/navigation/versions/v1/converters/toRootNode.ts index ddef66afca..23de59f5fa 100644 --- a/packages/fdr-sdk/src/navigation/versions/v1/converters/toRootNode.ts +++ b/packages/fdr-sdk/src/navigation/versions/v1/converters/toRootNode.ts @@ -69,6 +69,7 @@ export function toRootNode( authed: undefined, viewers: undefined, orphaned: undefined, + featureFlags: undefined, id: FernNavigation.V1.NodeId("root"), pointsTo: undefined, roles: undefined, diff --git a/packages/parsers/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts b/packages/parsers/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts index 3e3ace631a..dff2872e59 100644 --- a/packages/parsers/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts +++ b/packages/parsers/src/client/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.ts @@ -6,7 +6,8 @@ import * as FernRegistry from "../../../../../index"; export interface WithNodeMetadata extends FernRegistry.navigation.v1.WithNodeId, - FernRegistry.navigation.v1.WithPermissions { + FernRegistry.navigation.v1.WithPermissions, + FernRegistry.navigation.latest.WithFeatureFlags { title: string; slug: FernRegistry.navigation.v1.Slug; icon: string | undefined; diff --git a/servers/fdr/src/api/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.d.ts b/servers/fdr/src/api/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.d.ts index af375cae07..a455289606 100644 --- a/servers/fdr/src/api/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.d.ts +++ b/servers/fdr/src/api/generated/api/resources/navigation/resources/v1/types/WithNodeMetadata.d.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ import * as FernRegistry from "../../../../../index"; -export interface WithNodeMetadata extends FernRegistry.navigation.v1.WithNodeId, FernRegistry.navigation.v1.WithPermissions { +export interface WithNodeMetadata extends FernRegistry.navigation.v1.WithNodeId, FernRegistry.navigation.v1.WithPermissions, FernRegistry.navigation.latest.WithFeatureFlags { title: string; slug: FernRegistry.navigation.v1.Slug; icon: string | undefined;