@fern-api/fdr-sdk 1.2.36-eaea1f74f7 → 1.2.37-94cc3f83f5
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/js/client/FdrClient.js +315 -55
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs +315 -55
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/index.js +320 -60
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +320 -60
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/ledger-root-builder.js +732 -249
- package/dist/js/navigation/ledger-root-builder.js.map +1 -1
- package/dist/js/navigation/ledger-root-builder.mjs +730 -249
- package/dist/js/navigation/ledger-root-builder.mjs.map +1 -1
- package/dist/js/orpc-client.js +759 -91
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +715 -86
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/navigation/__test__/ledger-root-builder.changelogSlug.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.changelogSlug.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.defaultVersionElision.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.defaultVersionElision.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.linkRepro.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.linkRepro.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.mergeEndpointPairs.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.pointsTo.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.pointsTo.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.productId.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.productId.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.rootChildOrder.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.rootChildOrder.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.rootSectionSlug.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.rootSectionSlug.test.d.ts.map +1 -0
- package/dist/types/navigation/__test__/ledger-root-builder.tabSlug.test.d.ts +2 -0
- package/dist/types/navigation/__test__/ledger-root-builder.tabSlug.test.d.ts.map +1 -0
- package/dist/types/navigation/ledger-root-builder.d.ts +26 -3
- package/dist/types/navigation/ledger-root-builder.d.ts.map +1 -1
- package/dist/types/orpc-client/client.d.ts +1 -2
- package/dist/types/orpc-client/client.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/client.d.ts +1 -3
- package/dist/types/orpc-client/docs-ledger/client.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/config-files.d.ts +16 -0
- package/dist/types/orpc-client/docs-ledger/config-files.d.ts.map +1 -0
- package/dist/types/orpc-client/docs-ledger/contract.d.ts +60922 -47158
- package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/index.d.ts +3 -0
- package/dist/types/orpc-client/docs-ledger/index.d.ts.map +1 -1
- package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts +37008 -0
- package/dist/types/orpc-client/docs-ledger/ledger-manifest.d.ts.map +1 -0
- package/dist/types/orpc-client/docs-ledger/stable-stringify.d.ts +18 -0
- package/dist/types/orpc-client/docs-ledger/stable-stringify.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/js/orpc-client.mjs
CHANGED
|
@@ -3763,7 +3763,17 @@ var PageBlobRefSchema = z22.object({
|
|
|
3763
3763
|
/** SHA-256 hex of the page content bytes. */
|
|
3764
3764
|
hash: z22.string(),
|
|
3765
3765
|
contentType: z22.string().default("text/markdown"),
|
|
3766
|
-
contentLength: z22.number()
|
|
3766
|
+
contentLength: z22.number(),
|
|
3767
|
+
/**
|
|
3768
|
+
* Bare `fullPath`s of the file/image artifacts this page's rendered
|
|
3769
|
+
* markdown references (the `<fullPath>` of each `file:<fullPath>` token).
|
|
3770
|
+
* Captured CLI-side from the already-rewritten page markdown (same `file:`
|
|
3771
|
+
* regex the bundle serializer uses) so FDR can materialise the page→file
|
|
3772
|
+
* join into the route shards without re-fetching or re-parsing content
|
|
3773
|
+
* (ADR 0016, "File metadata on the render path"). Optional — older CLIs
|
|
3774
|
+
* omit it and the page simply contributes no shard-side file identities.
|
|
3775
|
+
*/
|
|
3776
|
+
referencedFiles: z22.array(z22.string()).optional()
|
|
3767
3777
|
});
|
|
3768
3778
|
var FileManifestEntrySchema = z22.object({
|
|
3769
3779
|
/** SHA-256 hex of the file bytes (= CAS content hash). */
|
|
@@ -3793,6 +3803,21 @@ var BackgroundColorSchema = z22.discriminatedUnion("type", [
|
|
|
3793
3803
|
z22.object({ type: z22.literal("solid"), ...RgbaSchema.shape }),
|
|
3794
3804
|
z22.object({ type: z22.literal("gradient") })
|
|
3795
3805
|
]);
|
|
3806
|
+
var ACCENT_SCALE_KEYS = [
|
|
3807
|
+
"accent1",
|
|
3808
|
+
"accent2",
|
|
3809
|
+
"accent3",
|
|
3810
|
+
"accent4",
|
|
3811
|
+
"accent5",
|
|
3812
|
+
"accent6",
|
|
3813
|
+
"accent7",
|
|
3814
|
+
"accent8",
|
|
3815
|
+
"accent9",
|
|
3816
|
+
"accent10",
|
|
3817
|
+
"accent11",
|
|
3818
|
+
"accent12"
|
|
3819
|
+
];
|
|
3820
|
+
var accentScaleShape = Object.fromEntries(ACCENT_SCALE_KEYS.map((key) => [key, RgbaSchema.optional()]));
|
|
3796
3821
|
var LedgerThemeConfigSchema = z22.object({
|
|
3797
3822
|
logo: ImageRefSchema.optional(),
|
|
3798
3823
|
backgroundImage: z22.string().optional(),
|
|
@@ -3802,18 +3827,7 @@ var LedgerThemeConfigSchema = z22.object({
|
|
|
3802
3827
|
sidebarBackground: RgbaSchema.optional(),
|
|
3803
3828
|
headerBackground: RgbaSchema.optional(),
|
|
3804
3829
|
cardBackground: RgbaSchema.optional(),
|
|
3805
|
-
|
|
3806
|
-
accent2: RgbaSchema.optional(),
|
|
3807
|
-
accent3: RgbaSchema.optional(),
|
|
3808
|
-
accent4: RgbaSchema.optional(),
|
|
3809
|
-
accent5: RgbaSchema.optional(),
|
|
3810
|
-
accent6: RgbaSchema.optional(),
|
|
3811
|
-
accent7: RgbaSchema.optional(),
|
|
3812
|
-
accent8: RgbaSchema.optional(),
|
|
3813
|
-
accent9: RgbaSchema.optional(),
|
|
3814
|
-
accent10: RgbaSchema.optional(),
|
|
3815
|
-
accent11: RgbaSchema.optional(),
|
|
3816
|
-
accent12: RgbaSchema.optional()
|
|
3830
|
+
...accentScaleShape
|
|
3817
3831
|
});
|
|
3818
3832
|
var LedgerColorsConfigSchema = z22.discriminatedUnion("type", [
|
|
3819
3833
|
z22.object({ type: z22.literal("dark"), ...LedgerThemeConfigSchema.shape }),
|
|
@@ -3867,6 +3881,14 @@ var LedgerMetadataConfigSchema = z22.record(z22.string(), z22.unknown()).and(
|
|
|
3867
3881
|
"og:dynamic:background-image": PathOrUrlSchema.optional()
|
|
3868
3882
|
})
|
|
3869
3883
|
);
|
|
3884
|
+
var NavbarLinksFieldSchema = z22.array(NavbarLinkSchema);
|
|
3885
|
+
var FooterLinksFieldSchema = z22.array(FooterLinkSchema);
|
|
3886
|
+
var LayoutFieldSchema = DocsLayoutConfigSchema;
|
|
3887
|
+
var ThemeFieldSchema = DocsThemeConfigSchema;
|
|
3888
|
+
var SettingsFieldSchema = DocsSettingsConfigSchema;
|
|
3889
|
+
var AnalyticsFieldSchema = AnalyticsConfigSchema;
|
|
3890
|
+
var AIChatFieldSchema = AIChatConfigSchema;
|
|
3891
|
+
var PageActionsFieldSchema = PageActionsConfigSchema;
|
|
3870
3892
|
var LedgerAgentsConfigSchema = z22.object({
|
|
3871
3893
|
pageDirective: z22.string().optional(),
|
|
3872
3894
|
pageDescriptionSource: z22.enum(["description", "subtitle"]).optional(),
|
|
@@ -3880,31 +3902,272 @@ var LedgerConfigSchema = z22.object({
|
|
|
3880
3902
|
translations: z22.array(z22.string()).optional()
|
|
3881
3903
|
}).optional(),
|
|
3882
3904
|
announcement: z22.object({ text: z22.string() }).optional(),
|
|
3883
|
-
navbarLinks:
|
|
3884
|
-
footerLinks:
|
|
3905
|
+
navbarLinks: NavbarLinksFieldSchema.optional(),
|
|
3906
|
+
footerLinks: FooterLinksFieldSchema.optional(),
|
|
3885
3907
|
logoHeight: z22.number().optional(),
|
|
3886
3908
|
logoHref: z22.string().optional(),
|
|
3887
3909
|
logoRightText: z22.string().optional(),
|
|
3910
|
+
/** fullPath of the favicon file artifact (any extension: .svg/.png/.ico). */
|
|
3911
|
+
favicon: z22.string().nullish(),
|
|
3888
3912
|
agents: LedgerAgentsConfigSchema.optional(),
|
|
3889
3913
|
metadata: LedgerMetadataConfigSchema.optional(),
|
|
3890
3914
|
redirects: z22.array(z22.object({ source: z22.string(), destination: z22.string(), permanent: z22.boolean().optional() })).optional(),
|
|
3891
3915
|
colorsV3: LedgerColorsConfigSchema.optional(),
|
|
3892
|
-
layout:
|
|
3893
|
-
theme:
|
|
3894
|
-
settings:
|
|
3916
|
+
layout: LayoutFieldSchema.optional(),
|
|
3917
|
+
theme: ThemeFieldSchema.optional(),
|
|
3918
|
+
settings: SettingsFieldSchema.optional(),
|
|
3895
3919
|
typographyV2: LedgerTypographySchema.optional(),
|
|
3896
|
-
analyticsConfig:
|
|
3920
|
+
analyticsConfig: AnalyticsFieldSchema.optional(),
|
|
3897
3921
|
integrations: z22.object({
|
|
3898
3922
|
intercom: z22.string().optional()
|
|
3899
3923
|
}).optional(),
|
|
3900
3924
|
css: z22.object({ inline: z22.array(z22.string()).optional() }).optional(),
|
|
3901
3925
|
js: LedgerJsConfigSchema.optional(),
|
|
3902
|
-
aiChatConfig:
|
|
3903
|
-
pageActions:
|
|
3926
|
+
aiChatConfig: AIChatFieldSchema.optional(),
|
|
3927
|
+
pageActions: PageActionsFieldSchema.optional(),
|
|
3904
3928
|
editThisPageLaunch: z22.enum(["github", "dashboard"]).optional(),
|
|
3905
3929
|
header: z22.string().optional(),
|
|
3906
3930
|
footer: z22.string().optional()
|
|
3907
3931
|
});
|
|
3932
|
+
var MetadataStringArraySchema = z22.array(z22.string());
|
|
3933
|
+
var FeatureFlagMetadataSchema = z22.array(
|
|
3934
|
+
z22.union([
|
|
3935
|
+
z22.string(),
|
|
3936
|
+
z22.object({
|
|
3937
|
+
flag: z22.string(),
|
|
3938
|
+
fallbackValue: z22.unknown().optional(),
|
|
3939
|
+
match: z22.unknown().optional()
|
|
3940
|
+
})
|
|
3941
|
+
])
|
|
3942
|
+
);
|
|
3943
|
+
var LinkTargetSchema2 = z22.enum(["_blank", "_self", "_parent", "_top"]);
|
|
3944
|
+
var CollapsedSchema = z22.union([z22.boolean(), z22.literal("open-by-default")]);
|
|
3945
|
+
var LedgerAvailabilitySchema = z22.union([
|
|
3946
|
+
AvailabilitySchema,
|
|
3947
|
+
z22.enum([
|
|
3948
|
+
"alpha",
|
|
3949
|
+
"stable",
|
|
3950
|
+
"generally-available",
|
|
3951
|
+
"in-development",
|
|
3952
|
+
"pre-release",
|
|
3953
|
+
"beta",
|
|
3954
|
+
"preview",
|
|
3955
|
+
"deprecated",
|
|
3956
|
+
"legacy"
|
|
3957
|
+
])
|
|
3958
|
+
]);
|
|
3959
|
+
var LedgerArtifactTypeSchema = z22.enum([
|
|
3960
|
+
"markdown",
|
|
3961
|
+
"page",
|
|
3962
|
+
"rest",
|
|
3963
|
+
"asyncapi",
|
|
3964
|
+
"webhook",
|
|
3965
|
+
"grpc",
|
|
3966
|
+
"graphql",
|
|
3967
|
+
"changelog",
|
|
3968
|
+
"link",
|
|
3969
|
+
"file",
|
|
3970
|
+
"image",
|
|
3971
|
+
"redirect"
|
|
3972
|
+
]);
|
|
3973
|
+
var LedgerMetadataBaseSchema = z22.object({}).passthrough();
|
|
3974
|
+
var NodeMetadataFields = {
|
|
3975
|
+
title: z22.string().optional(),
|
|
3976
|
+
slug: z22.string().optional(),
|
|
3977
|
+
icon: z22.string().optional(),
|
|
3978
|
+
viewers: MetadataStringArraySchema.optional(),
|
|
3979
|
+
orphaned: z22.boolean().optional(),
|
|
3980
|
+
featureFlags: FeatureFlagMetadataSchema.optional()
|
|
3981
|
+
};
|
|
3982
|
+
var ApiNodeMetadataFields = {
|
|
3983
|
+
...NodeMetadataFields,
|
|
3984
|
+
apiDefinitionId: z22.string(),
|
|
3985
|
+
availability: LedgerAvailabilitySchema.optional()
|
|
3986
|
+
};
|
|
3987
|
+
var LedgerSegmentDetailMetadataObjectSchema = LedgerMetadataBaseSchema.extend({
|
|
3988
|
+
slug: z22.string().optional(),
|
|
3989
|
+
default: z22.boolean().optional(),
|
|
3990
|
+
subtitle: z22.string().optional(),
|
|
3991
|
+
href: z22.string().optional(),
|
|
3992
|
+
url: z22.string().optional(),
|
|
3993
|
+
target: LinkTargetSchema2.optional(),
|
|
3994
|
+
image: z22.string().optional(),
|
|
3995
|
+
pointsTo: z22.string().optional(),
|
|
3996
|
+
availability: LedgerAvailabilitySchema.optional(),
|
|
3997
|
+
tab_type: z22.enum(["tab", "link", "changelog"]).optional()
|
|
3998
|
+
});
|
|
3999
|
+
var LedgerSegmentDetailMetadataSchema = LedgerSegmentDetailMetadataObjectSchema.nullable();
|
|
4000
|
+
var LedgerSegmentMetadataObjectSchema = z22.discriminatedUnion("type", [
|
|
4001
|
+
LedgerMetadataBaseSchema.extend({
|
|
4002
|
+
type: z22.literal("tabRoot")
|
|
4003
|
+
}),
|
|
4004
|
+
LedgerMetadataBaseSchema.extend({
|
|
4005
|
+
type: z22.literal("section"),
|
|
4006
|
+
title: z22.string().optional(),
|
|
4007
|
+
icon: z22.string().optional(),
|
|
4008
|
+
collapsed: CollapsedSchema.optional(),
|
|
4009
|
+
collapsible: z22.boolean().optional(),
|
|
4010
|
+
collapsedByDefault: z22.boolean().optional(),
|
|
4011
|
+
availability: LedgerAvailabilitySchema.optional(),
|
|
4012
|
+
overviewPageId: z22.string().optional(),
|
|
4013
|
+
pointsTo: z22.string().optional(),
|
|
4014
|
+
viewers: MetadataStringArraySchema.optional()
|
|
4015
|
+
}),
|
|
4016
|
+
LedgerMetadataBaseSchema.extend({
|
|
4017
|
+
type: z22.literal("apiReference"),
|
|
4018
|
+
title: z22.string().optional(),
|
|
4019
|
+
icon: z22.string().optional(),
|
|
4020
|
+
apiDefinitionId: z22.string().optional(),
|
|
4021
|
+
overviewPageId: z22.string().optional(),
|
|
4022
|
+
availability: LedgerAvailabilitySchema.optional(),
|
|
4023
|
+
pointsTo: z22.string().optional(),
|
|
4024
|
+
paginated: z22.boolean().optional(),
|
|
4025
|
+
showErrors: z22.boolean().optional(),
|
|
4026
|
+
hideTitle: z22.boolean().optional(),
|
|
4027
|
+
viewers: MetadataStringArraySchema.optional()
|
|
4028
|
+
}),
|
|
4029
|
+
LedgerMetadataBaseSchema.extend({
|
|
4030
|
+
type: z22.literal("apiPackage"),
|
|
4031
|
+
title: z22.string().optional(),
|
|
4032
|
+
icon: z22.string().optional(),
|
|
4033
|
+
apiDefinitionId: z22.string().optional(),
|
|
4034
|
+
overviewPageId: z22.string().optional(),
|
|
4035
|
+
availability: LedgerAvailabilitySchema.optional(),
|
|
4036
|
+
pointsTo: z22.string().optional(),
|
|
4037
|
+
viewers: MetadataStringArraySchema.optional()
|
|
4038
|
+
}),
|
|
4039
|
+
LedgerMetadataBaseSchema.extend({
|
|
4040
|
+
type: z22.literal("changelog"),
|
|
4041
|
+
title: z22.string().optional(),
|
|
4042
|
+
icon: z22.string().optional(),
|
|
4043
|
+
overviewPageId: z22.string().optional(),
|
|
4044
|
+
apiDefinitionId: z22.string().optional(),
|
|
4045
|
+
viewers: MetadataStringArraySchema.optional()
|
|
4046
|
+
}),
|
|
4047
|
+
LedgerMetadataBaseSchema.extend({
|
|
4048
|
+
type: z22.literal("files")
|
|
4049
|
+
}),
|
|
4050
|
+
LedgerMetadataBaseSchema.extend({
|
|
4051
|
+
type: z22.literal("redirects")
|
|
4052
|
+
})
|
|
4053
|
+
]);
|
|
4054
|
+
var LedgerSegmentMetadataSchema = LedgerSegmentMetadataObjectSchema;
|
|
4055
|
+
var LedgerMarkdownMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4056
|
+
...NodeMetadataFields,
|
|
4057
|
+
pageId: z22.string().optional(),
|
|
4058
|
+
isOverview: z22.boolean().optional(),
|
|
4059
|
+
noindex: z22.boolean().optional()
|
|
4060
|
+
});
|
|
4061
|
+
var LedgerRestMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4062
|
+
...ApiNodeMetadataFields,
|
|
4063
|
+
endpointId: z22.string(),
|
|
4064
|
+
method: HttpMethodSchema,
|
|
4065
|
+
isResponseStream: z22.boolean().optional(),
|
|
4066
|
+
endpointPairKey: z22.string().optional()
|
|
4067
|
+
});
|
|
4068
|
+
var LedgerWebSocketMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4069
|
+
...ApiNodeMetadataFields,
|
|
4070
|
+
webSocketId: z22.string()
|
|
4071
|
+
});
|
|
4072
|
+
var LedgerWebhookMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4073
|
+
...ApiNodeMetadataFields,
|
|
4074
|
+
webhookId: z22.string(),
|
|
4075
|
+
// V1.WebhookNode carries the full HttpMethod union, so the read model must accept it too.
|
|
4076
|
+
method: HttpMethodSchema
|
|
4077
|
+
});
|
|
4078
|
+
var LedgerGrpcMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4079
|
+
...ApiNodeMetadataFields,
|
|
4080
|
+
grpcId: z22.string(),
|
|
4081
|
+
method: GrpcMethodSchema
|
|
4082
|
+
});
|
|
4083
|
+
var LedgerGraphQlMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4084
|
+
...ApiNodeMetadataFields,
|
|
4085
|
+
graphqlOperationId: z22.string(),
|
|
4086
|
+
operationType: GraphQlOperationTypeSchema
|
|
4087
|
+
});
|
|
4088
|
+
var LedgerChangelogEntryMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4089
|
+
title: z22.string().optional(),
|
|
4090
|
+
slug: z22.string().optional(),
|
|
4091
|
+
icon: z22.string().optional(),
|
|
4092
|
+
pageId: z22.string(),
|
|
4093
|
+
date: z22.string().optional(),
|
|
4094
|
+
tags: MetadataStringArraySchema.optional()
|
|
4095
|
+
});
|
|
4096
|
+
var LedgerLinkMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4097
|
+
title: z22.string().optional(),
|
|
4098
|
+
slug: z22.string().optional(),
|
|
4099
|
+
icon: z22.string().optional(),
|
|
4100
|
+
url: z22.string(),
|
|
4101
|
+
target: LinkTargetSchema2.optional()
|
|
4102
|
+
});
|
|
4103
|
+
var LedgerFileArtifactMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4104
|
+
contentType: z22.string(),
|
|
4105
|
+
filename: z22.string(),
|
|
4106
|
+
width: z22.number().optional(),
|
|
4107
|
+
height: z22.number().optional(),
|
|
4108
|
+
blurDataURL: z22.string().optional()
|
|
4109
|
+
});
|
|
4110
|
+
var LedgerRedirectMetadataSchema = LedgerMetadataBaseSchema.extend({
|
|
4111
|
+
href: z22.string().optional()
|
|
4112
|
+
});
|
|
4113
|
+
var LedgerArtifactMetadataSchema = z22.union([
|
|
4114
|
+
LedgerMarkdownMetadataSchema,
|
|
4115
|
+
LedgerRestMetadataSchema,
|
|
4116
|
+
LedgerWebSocketMetadataSchema,
|
|
4117
|
+
LedgerWebhookMetadataSchema,
|
|
4118
|
+
LedgerGrpcMetadataSchema,
|
|
4119
|
+
LedgerGraphQlMetadataSchema,
|
|
4120
|
+
LedgerChangelogEntryMetadataSchema,
|
|
4121
|
+
LedgerLinkMetadataSchema,
|
|
4122
|
+
LedgerFileArtifactMetadataSchema,
|
|
4123
|
+
LedgerRedirectMetadataSchema
|
|
4124
|
+
]);
|
|
4125
|
+
var LEDGER_ARTIFACT_METADATA_SCHEMAS = {
|
|
4126
|
+
markdown: LedgerMarkdownMetadataSchema,
|
|
4127
|
+
page: LedgerMarkdownMetadataSchema,
|
|
4128
|
+
rest: LedgerRestMetadataSchema,
|
|
4129
|
+
asyncapi: LedgerWebSocketMetadataSchema,
|
|
4130
|
+
webhook: LedgerWebhookMetadataSchema,
|
|
4131
|
+
grpc: LedgerGrpcMetadataSchema,
|
|
4132
|
+
graphql: LedgerGraphQlMetadataSchema,
|
|
4133
|
+
changelog: LedgerChangelogEntryMetadataSchema,
|
|
4134
|
+
link: LedgerLinkMetadataSchema,
|
|
4135
|
+
file: LedgerFileArtifactMetadataSchema,
|
|
4136
|
+
image: LedgerFileArtifactMetadataSchema,
|
|
4137
|
+
redirect: LedgerRedirectMetadataSchema
|
|
4138
|
+
};
|
|
4139
|
+
function artifactTypeVariant(base, type) {
|
|
4140
|
+
return base.extend({
|
|
4141
|
+
artifactType: z22.literal(type),
|
|
4142
|
+
artifactMetadata: LEDGER_ARTIFACT_METADATA_SCHEMAS[type]
|
|
4143
|
+
});
|
|
4144
|
+
}
|
|
4145
|
+
var NavRouteBaseSchema = z22.object({
|
|
4146
|
+
fullPath: z22.string().nullable(),
|
|
4147
|
+
artifactId: z22.string(),
|
|
4148
|
+
hidden: z22.boolean(),
|
|
4149
|
+
displaySortOrder: z22.number().nullable().optional()
|
|
4150
|
+
});
|
|
4151
|
+
function navRouteVariant(type) {
|
|
4152
|
+
return NavRouteBaseSchema.extend({
|
|
4153
|
+
type: z22.literal(type),
|
|
4154
|
+
metadata: LEDGER_ARTIFACT_METADATA_SCHEMAS[type]
|
|
4155
|
+
});
|
|
4156
|
+
}
|
|
4157
|
+
var LedgerNavRouteSchema = z22.discriminatedUnion("type", [
|
|
4158
|
+
navRouteVariant("markdown"),
|
|
4159
|
+
navRouteVariant("page"),
|
|
4160
|
+
navRouteVariant("rest"),
|
|
4161
|
+
navRouteVariant("asyncapi"),
|
|
4162
|
+
navRouteVariant("webhook"),
|
|
4163
|
+
navRouteVariant("grpc"),
|
|
4164
|
+
navRouteVariant("graphql"),
|
|
4165
|
+
navRouteVariant("changelog"),
|
|
4166
|
+
navRouteVariant("link"),
|
|
4167
|
+
navRouteVariant("file"),
|
|
4168
|
+
navRouteVariant("image"),
|
|
4169
|
+
navRouteVariant("redirect")
|
|
4170
|
+
]);
|
|
3908
4171
|
var DocsPublishGitInputSchema = z22.object({
|
|
3909
4172
|
/** Full HTTPS URL of the repo (e.g. `https://github.com/acme/docs`). */
|
|
3910
4173
|
repoUrl: z22.string(),
|
|
@@ -3942,11 +4205,12 @@ var DocsContentFieldsSchema = z22.object({
|
|
|
3942
4205
|
*/
|
|
3943
4206
|
git: DocsPublishGitInputSchema.optional()
|
|
3944
4207
|
});
|
|
3945
|
-
var
|
|
4208
|
+
var LocaleEntrySchemaInternal = DocsContentFieldsSchema.extend({
|
|
3946
4209
|
/** Locale identifier (e.g. "en", "es", "ja"). Required — no default. */
|
|
3947
4210
|
locale: z22.string()
|
|
3948
4211
|
});
|
|
3949
|
-
var
|
|
4212
|
+
var LocaleEntrySchema = LocaleEntrySchemaInternal;
|
|
4213
|
+
var DocsPublishInputSchemaInternal = z22.object({
|
|
3950
4214
|
orgId: z22.string(),
|
|
3951
4215
|
domain: z22.string(),
|
|
3952
4216
|
basepath: z22.string().default(""),
|
|
@@ -3973,7 +4237,8 @@ var DocsPublishInputSchema = z22.object({
|
|
|
3973
4237
|
message: "defaultLocale must match one of the locales in the locales array",
|
|
3974
4238
|
path: ["defaultLocale"]
|
|
3975
4239
|
});
|
|
3976
|
-
var
|
|
4240
|
+
var DocsPublishInputSchema = DocsPublishInputSchemaInternal;
|
|
4241
|
+
var LedgerPreviewRegisterInputSchemaInternal = DocsContentFieldsSchema.extend({
|
|
3977
4242
|
orgId: z22.string(),
|
|
3978
4243
|
/**
|
|
3979
4244
|
* Optional caller-supplied identifier for the preview hostname. Sanitized
|
|
@@ -3990,6 +4255,7 @@ var LedgerPreviewRegisterInputSchema = DocsContentFieldsSchema.extend({
|
|
|
3990
4255
|
*/
|
|
3991
4256
|
basePath: z22.string().default("")
|
|
3992
4257
|
});
|
|
4258
|
+
var LedgerPreviewRegisterInputSchema = LedgerPreviewRegisterInputSchemaInternal;
|
|
3993
4259
|
var LedgerPreviewRegisterResponseSchema = z22.object({
|
|
3994
4260
|
deploymentHash: z22.string(),
|
|
3995
4261
|
missingContent: z22.array(MissingContentSchema),
|
|
@@ -4041,7 +4307,7 @@ var SegmentDetailSchema = z22.object({
|
|
|
4041
4307
|
orphaned: z22.boolean(),
|
|
4042
4308
|
featureFlags: z22.array(z22.string()),
|
|
4043
4309
|
/** Type-specific fields: slug, default, subtitle, href, target, image, availability, pointsTo, tab_type. */
|
|
4044
|
-
metadata:
|
|
4310
|
+
metadata: LedgerSegmentDetailMetadataSchema
|
|
4045
4311
|
});
|
|
4046
4312
|
var SegmentSchema = z22.object({
|
|
4047
4313
|
segmentId: z22.string(),
|
|
@@ -4053,7 +4319,7 @@ var SegmentSchema = z22.object({
|
|
|
4053
4319
|
/** Whether the segment is hidden from the sidebar. */
|
|
4054
4320
|
hidden: z22.boolean(),
|
|
4055
4321
|
/** Segment type descriptor (seg.metadata): { type, title, icon, apiDefinitionId, overviewPageId, pointsTo, ... }. */
|
|
4056
|
-
metadata:
|
|
4322
|
+
metadata: LedgerSegmentMetadataSchema,
|
|
4057
4323
|
/** Full product/version/variant/tab detail metadata, or null when the dimension is absent. */
|
|
4058
4324
|
product: SegmentDetailSchema.nullable(),
|
|
4059
4325
|
version: SegmentDetailSchema.nullable(),
|
|
@@ -4122,16 +4388,19 @@ var VersionMetadataResponseSchema = z22.object({
|
|
|
4122
4388
|
var PageContentInputSchema = z22.object({
|
|
4123
4389
|
deploymentId: z22.string(),
|
|
4124
4390
|
fullPath: z22.string().optional(),
|
|
4125
|
-
pageId: z22.string().optional()
|
|
4391
|
+
pageId: z22.string().optional(),
|
|
4392
|
+
locale: z22.string().optional()
|
|
4126
4393
|
});
|
|
4127
4394
|
var PageContentResponseSchema = z22.object({
|
|
4128
4395
|
s3Key: z22.string(),
|
|
4129
4396
|
segmentHash: z22.string(),
|
|
4130
|
-
url: z22.string()
|
|
4397
|
+
url: z22.string(),
|
|
4398
|
+
pageId: z22.string().optional()
|
|
4131
4399
|
});
|
|
4132
4400
|
var BatchPageContentInputSchema = z22.object({
|
|
4133
4401
|
deploymentId: z22.string(),
|
|
4134
|
-
pageIds: z22.array(z22.string()).min(1).max(2e3)
|
|
4402
|
+
pageIds: z22.array(z22.string()).min(1).max(2e3),
|
|
4403
|
+
locale: z22.string().optional()
|
|
4135
4404
|
});
|
|
4136
4405
|
var BatchPageContentItemSchema = z22.object({
|
|
4137
4406
|
pageId: z22.string(),
|
|
@@ -4144,32 +4413,21 @@ var BatchPageContentResponseSchema = z22.object({
|
|
|
4144
4413
|
var NavInputSchema = z22.object({
|
|
4145
4414
|
segmentHash: z22.string()
|
|
4146
4415
|
});
|
|
4147
|
-
var NavRouteSchema = z22.object({
|
|
4148
|
-
fullPath: z22.string().nullable(),
|
|
4149
|
-
artifactId: z22.string(),
|
|
4150
|
-
type: z22.string(),
|
|
4151
|
-
/** Whether the artifact is hidden from the sidebar. */
|
|
4152
|
-
hidden: z22.boolean(),
|
|
4153
|
-
metadata: z22.unknown()
|
|
4154
|
-
});
|
|
4155
4416
|
var NavResponseSchema = z22.object({
|
|
4156
|
-
routes: z22.array(
|
|
4417
|
+
routes: z22.array(LedgerNavRouteSchema)
|
|
4157
4418
|
});
|
|
4158
4419
|
var RouteContextInputSchema = z22.object({
|
|
4159
4420
|
deploymentId: z22.string(),
|
|
4160
4421
|
fullPath: z22.string(),
|
|
4161
4422
|
locale: z22.string().optional()
|
|
4162
4423
|
});
|
|
4163
|
-
var
|
|
4424
|
+
var RouteContextResponseBaseSchema = z22.object({
|
|
4425
|
+
artifactId: z22.string(),
|
|
4164
4426
|
/** Hash of the segment that owns the matched route — feed to `nav`. */
|
|
4165
4427
|
segmentHash: z22.string(),
|
|
4166
4428
|
/** Section path of the owning segment (e.g. "models/command"). */
|
|
4167
4429
|
section: z22.string(),
|
|
4168
4430
|
locale: z22.string(),
|
|
4169
|
-
/** The artifact matched at `fullPath`. */
|
|
4170
|
-
artifactId: z22.string(),
|
|
4171
|
-
artifactType: z22.string(),
|
|
4172
|
-
artifactMetadata: z22.unknown(),
|
|
4173
4431
|
/**
|
|
4174
4432
|
* Page content reference, or null for non-page artifacts (links/redirects)
|
|
4175
4433
|
* and route-only aliases that carry no content blob.
|
|
@@ -4184,6 +4442,20 @@ var RouteContextResponseSchema = z22.object({
|
|
|
4184
4442
|
variant: SegmentDetailSchema.nullable(),
|
|
4185
4443
|
tab: SegmentDetailSchema.nullable()
|
|
4186
4444
|
});
|
|
4445
|
+
var RouteContextResponseSchema = z22.discriminatedUnion("artifactType", [
|
|
4446
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "markdown"),
|
|
4447
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "page"),
|
|
4448
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "rest"),
|
|
4449
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "asyncapi"),
|
|
4450
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "webhook"),
|
|
4451
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "grpc"),
|
|
4452
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "graphql"),
|
|
4453
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "changelog"),
|
|
4454
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "link"),
|
|
4455
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "file"),
|
|
4456
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "image"),
|
|
4457
|
+
artifactTypeVariant(RouteContextResponseBaseSchema, "redirect")
|
|
4458
|
+
]);
|
|
4187
4459
|
var TopLevelNavigationInputSchema = z22.object({
|
|
4188
4460
|
deploymentId: z22.string(),
|
|
4189
4461
|
locale: z22.string().optional()
|
|
@@ -4300,17 +4572,6 @@ function createDocsLedgerClient(options) {
|
|
|
4300
4572
|
});
|
|
4301
4573
|
return createORPCClient11(link);
|
|
4302
4574
|
}
|
|
4303
|
-
function createDocsLedgerReadClient(options) {
|
|
4304
|
-
const baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
4305
|
-
const link = new OpenAPILink11(docsLedgerReadContract, {
|
|
4306
|
-
url: `${baseUrl}/docs-ledger`,
|
|
4307
|
-
headers: () => ({
|
|
4308
|
-
Authorization: `Bearer ${options.token}`,
|
|
4309
|
-
...options.headers
|
|
4310
|
-
})
|
|
4311
|
-
});
|
|
4312
|
-
return createORPCClient11(link);
|
|
4313
|
-
}
|
|
4314
4575
|
|
|
4315
4576
|
// src/orpc-client/editor-snapshot/client.ts
|
|
4316
4577
|
import { createORPCClient as createORPCClient12 } from "@orpc/client";
|
|
@@ -5209,7 +5470,6 @@ function createFdrORPCClient(options) {
|
|
|
5209
5470
|
docsCache: createDocsCacheClient(normalizedOptions),
|
|
5210
5471
|
docsDeployment: createDocsDeploymentClient(normalizedOptions),
|
|
5211
5472
|
docsLedger: createDocsLedgerClient(normalizedOptions),
|
|
5212
|
-
docsLedgerRead: createDocsLedgerReadClient(normalizedOptions),
|
|
5213
5473
|
editorSnapshot: createEditorSnapshotClient(normalizedOptions),
|
|
5214
5474
|
generators: {
|
|
5215
5475
|
root: createGeneratorsRootClient(normalizedOptions),
|
|
@@ -5227,28 +5487,358 @@ function createFdrORPCClient(options) {
|
|
|
5227
5487
|
};
|
|
5228
5488
|
}
|
|
5229
5489
|
|
|
5490
|
+
// src/orpc-client/docs-ledger/config-files.ts
|
|
5491
|
+
import * as z32 from "zod";
|
|
5492
|
+
var PATH_OR_URL_METADATA_KEYS = [
|
|
5493
|
+
"og:image",
|
|
5494
|
+
"og:logo",
|
|
5495
|
+
"twitter:image",
|
|
5496
|
+
"og:background-image",
|
|
5497
|
+
"og:dynamic:background-image"
|
|
5498
|
+
];
|
|
5499
|
+
var LogoViewSchema = z32.union([z32.string(), z32.object({ path: z32.string() }).transform((v) => v.path)]);
|
|
5500
|
+
var ThemeViewSchema = z32.object({
|
|
5501
|
+
logo: LogoViewSchema.optional().catch(void 0),
|
|
5502
|
+
backgroundImage: z32.string().optional().catch(void 0)
|
|
5503
|
+
});
|
|
5504
|
+
var ColorsViewSchema = z32.union([
|
|
5505
|
+
z32.object({
|
|
5506
|
+
type: z32.literal("darkAndLight"),
|
|
5507
|
+
dark: ThemeViewSchema.optional().catch(void 0),
|
|
5508
|
+
light: ThemeViewSchema.optional().catch(void 0)
|
|
5509
|
+
}),
|
|
5510
|
+
ThemeViewSchema.transform((theme) => ({ type: "single", theme }))
|
|
5511
|
+
]);
|
|
5512
|
+
var FontViewSchema = z32.object({
|
|
5513
|
+
variants: z32.array(z32.object({ fontFile: z32.string().optional().catch(void 0) })).catch([])
|
|
5514
|
+
});
|
|
5515
|
+
var TypographyViewSchema = z32.object({
|
|
5516
|
+
headingsFont: FontViewSchema.optional().catch(void 0),
|
|
5517
|
+
bodyFont: FontViewSchema.optional().catch(void 0),
|
|
5518
|
+
codeFont: FontViewSchema.optional().catch(void 0)
|
|
5519
|
+
});
|
|
5520
|
+
var JsFileViewSchema = z32.union([
|
|
5521
|
+
z32.object({ path: z32.string() }).transform((v) => v.path),
|
|
5522
|
+
z32.object({ fileId: z32.string() }).transform((v) => v.fileId)
|
|
5523
|
+
]);
|
|
5524
|
+
var MetadataFileRefViewSchema = z32.object({
|
|
5525
|
+
type: z32.enum(["path", "fileId"]),
|
|
5526
|
+
value: z32.string()
|
|
5527
|
+
});
|
|
5528
|
+
var ConfigViewSchema = z32.object({
|
|
5529
|
+
favicon: z32.string().optional().catch(void 0),
|
|
5530
|
+
colorsV3: ColorsViewSchema.optional().catch(void 0),
|
|
5531
|
+
typographyV2: TypographyViewSchema.optional().catch(void 0),
|
|
5532
|
+
js: z32.object({ files: z32.array(JsFileViewSchema.optional().catch(void 0)).catch([]) }).optional().catch(void 0),
|
|
5533
|
+
metadata: z32.record(z32.string(), z32.unknown()).optional().catch(void 0)
|
|
5534
|
+
});
|
|
5535
|
+
function isDarkAndLight(colors) {
|
|
5536
|
+
return colors.type === "darkAndLight";
|
|
5537
|
+
}
|
|
5538
|
+
function collectConfigFilePaths(config) {
|
|
5539
|
+
const paths = /* @__PURE__ */ new Set();
|
|
5540
|
+
const view = ConfigViewSchema.parse(config);
|
|
5541
|
+
if (view.favicon != null) {
|
|
5542
|
+
paths.add(view.favicon);
|
|
5543
|
+
}
|
|
5544
|
+
if (view.colorsV3 != null) {
|
|
5545
|
+
const themes = isDarkAndLight(view.colorsV3) ? [view.colorsV3.dark, view.colorsV3.light] : [view.colorsV3.theme];
|
|
5546
|
+
for (const theme of themes) {
|
|
5547
|
+
if (theme == null) {
|
|
5548
|
+
continue;
|
|
5549
|
+
}
|
|
5550
|
+
if (theme.logo != null) {
|
|
5551
|
+
paths.add(theme.logo);
|
|
5552
|
+
}
|
|
5553
|
+
if (theme.backgroundImage != null) {
|
|
5554
|
+
paths.add(theme.backgroundImage);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
}
|
|
5558
|
+
if (view.typographyV2 != null) {
|
|
5559
|
+
for (const font of [view.typographyV2.headingsFont, view.typographyV2.bodyFont, view.typographyV2.codeFont]) {
|
|
5560
|
+
for (const variant of font?.variants ?? []) {
|
|
5561
|
+
if (variant.fontFile != null) {
|
|
5562
|
+
paths.add(variant.fontFile);
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
}
|
|
5566
|
+
}
|
|
5567
|
+
for (const file of view.js?.files ?? []) {
|
|
5568
|
+
if (file != null) {
|
|
5569
|
+
paths.add(file);
|
|
5570
|
+
}
|
|
5571
|
+
}
|
|
5572
|
+
if (view.metadata != null) {
|
|
5573
|
+
for (const key of PATH_OR_URL_METADATA_KEYS) {
|
|
5574
|
+
const parsed = MetadataFileRefViewSchema.optional().catch(void 0).parse(view.metadata[key]);
|
|
5575
|
+
if (parsed != null) {
|
|
5576
|
+
paths.add(parsed.value);
|
|
5577
|
+
}
|
|
5578
|
+
}
|
|
5579
|
+
}
|
|
5580
|
+
return [...paths];
|
|
5581
|
+
}
|
|
5582
|
+
|
|
5583
|
+
// src/orpc-client/docs-ledger/ledger-manifest.ts
|
|
5584
|
+
import * as z33 from "zod";
|
|
5585
|
+
var LEDGER_MANIFEST_SCHEMA_VERSION = "docsledger/20260601";
|
|
5586
|
+
var LEDGER_SHARD_SCHEMA_VERSION = "docsledger/shard/20260601";
|
|
5587
|
+
var ManifestBlobRefSchema = z33.object({
|
|
5588
|
+
hash: z33.string(),
|
|
5589
|
+
contentType: z33.string()
|
|
5590
|
+
});
|
|
5591
|
+
var ManifestSegmentSchema = z33.object({
|
|
5592
|
+
/** Synthetic stable id (= segmentHash). */
|
|
5593
|
+
segmentId: z33.string(),
|
|
5594
|
+
segmentHash: z33.string(),
|
|
5595
|
+
section: z33.string(),
|
|
5596
|
+
locale: z33.string(),
|
|
5597
|
+
/** Sidebar order across segments (docs_ledger_deployment_segments.sort_order). */
|
|
5598
|
+
sortOrder: z33.number(),
|
|
5599
|
+
hidden: z33.boolean(),
|
|
5600
|
+
/** Segment type descriptor: { type, title, icon, apiDefinitionId, overviewPageId, pointsTo, ... }. */
|
|
5601
|
+
metadata: LedgerSegmentMetadataSchema,
|
|
5602
|
+
product: SegmentDetailSchema.nullable(),
|
|
5603
|
+
version: SegmentDetailSchema.nullable(),
|
|
5604
|
+
variant: SegmentDetailSchema.nullable(),
|
|
5605
|
+
tab: SegmentDetailSchema.nullable()
|
|
5606
|
+
});
|
|
5607
|
+
var ManifestNavRouteSchema = LedgerNavRouteSchema;
|
|
5608
|
+
var ManifestRouteBaseSchema = z33.object({
|
|
5609
|
+
segmentHash: z33.string(),
|
|
5610
|
+
/** Key into the containing route index's sidebars map. */
|
|
5611
|
+
sidebarKey: z33.string().nullable(),
|
|
5612
|
+
section: z33.string(),
|
|
5613
|
+
locale: z33.string(),
|
|
5614
|
+
artifactId: z33.string(),
|
|
5615
|
+
pageId: z33.string().optional(),
|
|
5616
|
+
/** CAS hash of the page content blob, or null for link/redirect artifacts. */
|
|
5617
|
+
contentHash: z33.string().nullable(),
|
|
5618
|
+
contentType: z33.string().nullable(),
|
|
5619
|
+
/** ISO-8601 timestamp of when this artifact's content version was first created.
|
|
5620
|
+
* Populated at publish time from `docs_ledger_artifacts.created_at`. Optional
|
|
5621
|
+
* for backward compatibility with manifests built before this field existed. */
|
|
5622
|
+
createdAt: z33.string().optional()
|
|
5623
|
+
});
|
|
5624
|
+
var ManifestRouteSchema = z33.discriminatedUnion("artifactType", [
|
|
5625
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "markdown"),
|
|
5626
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "page"),
|
|
5627
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "rest"),
|
|
5628
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "asyncapi"),
|
|
5629
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "webhook"),
|
|
5630
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "grpc"),
|
|
5631
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "graphql"),
|
|
5632
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "changelog"),
|
|
5633
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "link"),
|
|
5634
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "file"),
|
|
5635
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "image"),
|
|
5636
|
+
artifactTypeVariant(ManifestRouteBaseSchema, "redirect")
|
|
5637
|
+
]);
|
|
5638
|
+
var ManifestPageSchema = z33.object({
|
|
5639
|
+
fullPath: z33.string().nullable(),
|
|
5640
|
+
segmentHash: z33.string(),
|
|
5641
|
+
contentHash: z33.string(),
|
|
5642
|
+
contentType: z33.string()
|
|
5643
|
+
});
|
|
5644
|
+
var ManifestApiDefSchema = z33.object({
|
|
5645
|
+
/** CAS hash of the full API definition blob. */
|
|
5646
|
+
hash: z33.string(),
|
|
5647
|
+
contentType: z33.string(),
|
|
5648
|
+
/** key = `${nodeType}:${nodeId}` (e.g. `endpoint:abc`) → pruned CAS blob. */
|
|
5649
|
+
prunedHashes: z33.record(z33.string(), ManifestBlobRefSchema)
|
|
5650
|
+
});
|
|
5651
|
+
var ManifestFileSchema = z33.object({
|
|
5652
|
+
type: z33.enum(["file", "image"]),
|
|
5653
|
+
contentType: z33.string(),
|
|
5654
|
+
filename: z33.string(),
|
|
5655
|
+
hash: z33.string(),
|
|
5656
|
+
/** Canonical fern domain the bytes were uploaded under (ADR 0010 file anchor). */
|
|
5657
|
+
domain: z33.string(),
|
|
5658
|
+
bucket: z33.enum(["public_docs", "private_docs"]),
|
|
5659
|
+
width: z33.number().optional(),
|
|
5660
|
+
height: z33.number().optional(),
|
|
5661
|
+
blurDataURL: z33.string().optional()
|
|
5662
|
+
});
|
|
5663
|
+
var LedgerShardFileSchema = z33.object({
|
|
5664
|
+
/** SHA-256 hex of the file bytes (docs-bucket key component). */
|
|
5665
|
+
hash: z33.string(),
|
|
5666
|
+
/** Fern-host-relative path; equals the `file:<fullPath>` token's suffix. */
|
|
5667
|
+
fullPath: z33.string(),
|
|
5668
|
+
contentType: z33.string(),
|
|
5669
|
+
width: z33.number().optional(),
|
|
5670
|
+
height: z33.number().optional(),
|
|
5671
|
+
blurDataURL: z33.string().optional(),
|
|
5672
|
+
/**
|
|
5673
|
+
* Per-file bucket override. Absent ⇒ derive from the pointer's `isPrivate`
|
|
5674
|
+
* (`private_docs` when private, else `public_docs`). Present only for the
|
|
5675
|
+
* rare file whose bucket diverges from the deployment default.
|
|
5676
|
+
*/
|
|
5677
|
+
bucket: z33.enum(["public_docs", "private_docs"]).optional()
|
|
5678
|
+
});
|
|
5679
|
+
var LedgerConfigBlobSchema = z33.object({
|
|
5680
|
+
version: z33.string().nullable(),
|
|
5681
|
+
git: z33.object({
|
|
5682
|
+
repoUrl: z33.string(),
|
|
5683
|
+
branch: z33.string(),
|
|
5684
|
+
commitSha: z33.string().nullable().optional()
|
|
5685
|
+
}).optional(),
|
|
5686
|
+
/** Structural config with hot-path chrome text inlined for ADR 0016 page reads. */
|
|
5687
|
+
config: LedgerConfigSchema.nullable(),
|
|
5688
|
+
/** Large or legacy extracted config blobs. New manifests inline header/footer/css.inline/js.inline. */
|
|
5689
|
+
configRefs: z33.object({
|
|
5690
|
+
header: ManifestBlobRefSchema.optional(),
|
|
5691
|
+
footer: ManifestBlobRefSchema.optional(),
|
|
5692
|
+
cssInline: ManifestBlobRefSchema.optional(),
|
|
5693
|
+
jsInline: ManifestBlobRefSchema.optional(),
|
|
5694
|
+
jsFiles: ManifestBlobRefSchema.optional()
|
|
5695
|
+
})
|
|
5696
|
+
});
|
|
5697
|
+
var LedgerChromeBlobSchema = z33.object({
|
|
5698
|
+
apiNameToId: z33.record(z33.string(), z33.string())
|
|
5699
|
+
});
|
|
5700
|
+
var LedgerSidebarBundleSchema = z33.object({
|
|
5701
|
+
locale: z33.string(),
|
|
5702
|
+
segmentHash: z33.string(),
|
|
5703
|
+
routes: z33.array(ManifestNavRouteSchema)
|
|
5704
|
+
});
|
|
5705
|
+
var LedgerSidebarMapEntrySchema = z33.discriminatedUnion("strategy", [
|
|
5706
|
+
LedgerSidebarBundleSchema.extend({
|
|
5707
|
+
strategy: z33.literal("inline")
|
|
5708
|
+
}),
|
|
5709
|
+
ManifestBlobRefSchema.extend({
|
|
5710
|
+
strategy: z33.literal("ref")
|
|
5711
|
+
})
|
|
5712
|
+
]);
|
|
5713
|
+
var LedgerLocaleIndexSchema = z33.object({
|
|
5714
|
+
locale: z33.string(),
|
|
5715
|
+
segments: z33.array(ManifestSegmentSchema),
|
|
5716
|
+
/** sidebarKey → inline sidebar routes, or a CAS ref when over budget. */
|
|
5717
|
+
sidebars: z33.record(z33.string(), LedgerSidebarMapEntrySchema),
|
|
5718
|
+
/** fullPath → route for this effective locale. */
|
|
5719
|
+
routes: z33.record(z33.string(), ManifestRouteSchema),
|
|
5720
|
+
/** pageId → page content reference for this effective locale. */
|
|
5721
|
+
pages: z33.record(z33.string(), ManifestPageSchema),
|
|
5722
|
+
/** apiDefinitionId → full + pruned API definition blobs. */
|
|
5723
|
+
apiDefs: z33.record(z33.string(), ManifestApiDefSchema),
|
|
5724
|
+
/** fullPath → file/image artifact metadata. */
|
|
5725
|
+
files: z33.record(z33.string(), ManifestFileSchema)
|
|
5726
|
+
});
|
|
5727
|
+
var LedgerRouteShardSchema = z33.object({
|
|
5728
|
+
schema: z33.literal(LEDGER_SHARD_SCHEMA_VERSION),
|
|
5729
|
+
locale: z33.string(),
|
|
5730
|
+
/** fullPath → route for the scopes packed into this shard. */
|
|
5731
|
+
routes: z33.record(z33.string(), ManifestRouteSchema),
|
|
5732
|
+
/** segmentHash → inline sidebar (or CAS ref) for every segment in this shard's scopes. */
|
|
5733
|
+
sidebars: z33.record(z33.string(), LedgerSidebarMapEntrySchema),
|
|
5734
|
+
/**
|
|
5735
|
+
* fileFullPath → lean file identity for every file/image referenced by a
|
|
5736
|
+
* page routed into this shard (ADR 0016, "File metadata on the render
|
|
5737
|
+
* path"). The union of identities for this shard's routes'
|
|
5738
|
+
* `referencedFiles`. Optional — absent on shards built before this field
|
|
5739
|
+
* existed or with no embedded files; the bundle then falls back to the
|
|
5740
|
+
* pointer's `files` map (`fileMetadata`/`fileArtifact`).
|
|
5741
|
+
*/
|
|
5742
|
+
files: z33.record(z33.string(), LedgerShardFileSchema).optional()
|
|
5743
|
+
});
|
|
5744
|
+
var LedgerPagesBlobSchema = z33.record(z33.string(), ManifestPageSchema);
|
|
5745
|
+
var LedgerPointerSegmentSchema = ManifestSegmentSchema.omit({ product: true, version: true }).extend({
|
|
5746
|
+
/** Index into the locale's `productCatalog`, or null when the segment has no product. */
|
|
5747
|
+
productIdx: z33.number().nullable(),
|
|
5748
|
+
/** Index into the locale's `versionCatalog`, or null when the segment has no version. */
|
|
5749
|
+
versionIdx: z33.number().nullable()
|
|
5750
|
+
});
|
|
5751
|
+
var LedgerLocaleRoutingSchema = z33.object({
|
|
5752
|
+
/** Compact segments catalog for the switcher chrome (product/version by index). */
|
|
5753
|
+
segments: z33.array(LedgerPointerSegmentSchema),
|
|
5754
|
+
/** Deduplicated product details; `LedgerPointerSegment.productIdx` indexes into this. */
|
|
5755
|
+
productCatalog: z33.array(SegmentDetailSchema),
|
|
5756
|
+
/** Deduplicated version details; `LedgerPointerSegment.versionIdx` indexes into this. */
|
|
5757
|
+
versionCatalog: z33.array(SegmentDetailSchema),
|
|
5758
|
+
/** fullPath → index into `shards`. */
|
|
5759
|
+
routing: z33.record(z33.string(), z33.number()),
|
|
5760
|
+
/** segmentHash → index into `shards`. */
|
|
5761
|
+
segmentShard: z33.record(z33.string(), z33.number()),
|
|
5762
|
+
/** Ordered list of route shards; index matches `routing`/`segmentShard`. */
|
|
5763
|
+
shards: z33.array(z33.object({ hash: z33.string() })),
|
|
5764
|
+
/** versionId → first routable fullPath (version switcher). */
|
|
5765
|
+
versionFirstRoute: z33.record(z33.string(), z33.string()),
|
|
5766
|
+
/** CAS hash of the per-locale pages blob. */
|
|
5767
|
+
pagesHash: z33.string(),
|
|
5768
|
+
/**
|
|
5769
|
+
* fullPath → file/image artifact metadata for files NOT materialised into
|
|
5770
|
+
* a route shard (ADR 0016, "File metadata on the render path"): config
|
|
5771
|
+
* files (logo/fonts/OG), well-known files (favicon/robots/context7),
|
|
5772
|
+
* API-description-embedded images, and any other non-page-referenced file.
|
|
5773
|
+
* Page-body images are pruned from here and live in their route shard's
|
|
5774
|
+
* `files` map instead. Read via `fileMetadata` / `fileArtifact`.
|
|
5775
|
+
*/
|
|
5776
|
+
files: z33.record(z33.string(), ManifestFileSchema),
|
|
5777
|
+
/** apiDefinitionId → full + pruned API definition blobs. */
|
|
5778
|
+
apiDefs: z33.record(z33.string(), ManifestApiDefSchema)
|
|
5779
|
+
});
|
|
5780
|
+
var LedgerManifestSchema = z33.object({
|
|
5781
|
+
schema: z33.literal(LEDGER_MANIFEST_SCHEMA_VERSION),
|
|
5782
|
+
// ── Pointer / current-version fields ──────────────────────────────
|
|
5783
|
+
orgId: z33.string(),
|
|
5784
|
+
domain: z33.string(),
|
|
5785
|
+
basepath: z33.string(),
|
|
5786
|
+
deploymentId: z33.string(),
|
|
5787
|
+
deploymentHash: z33.string(),
|
|
5788
|
+
siteId: z33.string(),
|
|
5789
|
+
/** ISO-8601 timestamp the publish became live (request time). */
|
|
5790
|
+
assignedAt: z33.string(),
|
|
5791
|
+
assignedBy: z33.string().nullable(),
|
|
5792
|
+
isPreview: z33.boolean(),
|
|
5793
|
+
isPrivate: z33.boolean(),
|
|
5794
|
+
/** Default locale for the deployment — read-path fallback when a translation is absent. */
|
|
5795
|
+
defaultLocale: z33.string(),
|
|
5796
|
+
/**
|
|
5797
|
+
* Canonical fern domain all file bytes are anchored under (ADR 0010). The
|
|
5798
|
+
* read client builds the public `/_files/{fileAnchorDomain}/{hash}/{fullPath}`
|
|
5799
|
+
* URL (or presigns the private bucket) for the lean {@link LedgerShardFile}
|
|
5800
|
+
* entries, which omit `domain`. Optional for back-compat with pointers
|
|
5801
|
+
* written before shard-side files; absent ⇒ the client falls back to the
|
|
5802
|
+
* pointer `files` map (which still carries per-file `domain`).
|
|
5803
|
+
*/
|
|
5804
|
+
fileAnchorDomain: z33.string().optional(),
|
|
5805
|
+
config: LedgerConfigBlobSchema,
|
|
5806
|
+
chrome: LedgerChromeBlobSchema,
|
|
5807
|
+
locales: z33.record(z33.string(), LedgerLocaleRoutingSchema)
|
|
5808
|
+
});
|
|
5809
|
+
|
|
5810
|
+
// src/orpc-client/docs-ledger/stable-stringify.ts
|
|
5811
|
+
function stableStringify(value) {
|
|
5812
|
+
return JSON.stringify(value, (_key, val) => {
|
|
5813
|
+
if (val != null && typeof val === "object" && !Array.isArray(val)) {
|
|
5814
|
+
return Object.fromEntries(Object.entries(val).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
5815
|
+
}
|
|
5816
|
+
return val;
|
|
5817
|
+
});
|
|
5818
|
+
}
|
|
5819
|
+
|
|
5230
5820
|
// src/orpc-client/files/contract.ts
|
|
5231
5821
|
import { oc as oc21 } from "@orpc/contract";
|
|
5232
|
-
import * as
|
|
5233
|
-
var PutContentInputSchema =
|
|
5234
|
-
contentType:
|
|
5235
|
-
contentLength:
|
|
5822
|
+
import * as z34 from "zod";
|
|
5823
|
+
var PutContentInputSchema = z34.object({
|
|
5824
|
+
contentType: z34.string(),
|
|
5825
|
+
contentLength: z34.number().int().positive()
|
|
5236
5826
|
});
|
|
5237
|
-
var PutContentResponseSchema =
|
|
5827
|
+
var PutContentResponseSchema = z34.discriminatedUnion("status", [
|
|
5238
5828
|
/** Content already exists in storage — client can skip the S3 upload. */
|
|
5239
|
-
|
|
5829
|
+
z34.object({ status: z34.literal("exists") }),
|
|
5240
5830
|
/** Content is new — client should PUT the file bytes to uploadUrl, then call PUT /files. */
|
|
5241
|
-
|
|
5831
|
+
z34.object({ status: z34.literal("upload_required"), uploadUrl: z34.string() })
|
|
5242
5832
|
]);
|
|
5243
|
-
var PutFileInputSchema =
|
|
5244
|
-
hash:
|
|
5245
|
-
contentType:
|
|
5833
|
+
var PutFileInputSchema = z34.object({
|
|
5834
|
+
hash: z34.string(),
|
|
5835
|
+
contentType: z34.string()
|
|
5246
5836
|
});
|
|
5247
|
-
var FileResponseSchema =
|
|
5837
|
+
var FileResponseSchema = z34.object({
|
|
5248
5838
|
/** SHA-256 hex digest of the file content (64 characters). */
|
|
5249
|
-
hash:
|
|
5839
|
+
hash: z34.string(),
|
|
5250
5840
|
/** Presigned S3 GET URL. TTL is configurable (default 3600 seconds). */
|
|
5251
|
-
downloadUrl:
|
|
5841
|
+
downloadUrl: z34.string()
|
|
5252
5842
|
});
|
|
5253
5843
|
var contentContract = {
|
|
5254
5844
|
/**
|
|
@@ -5271,7 +5861,7 @@ var filesContract = {
|
|
|
5271
5861
|
};
|
|
5272
5862
|
|
|
5273
5863
|
// src/orpc-client/themes/contract.ts
|
|
5274
|
-
import * as
|
|
5864
|
+
import * as z35 from "zod";
|
|
5275
5865
|
var FERN_FILE_REF_KEY = "hash";
|
|
5276
5866
|
var SHA256_RE = /^[0-9a-f]{64}$/;
|
|
5277
5867
|
function isFernFileRef(value) {
|
|
@@ -5286,26 +5876,26 @@ function isFernFileRef(value) {
|
|
|
5286
5876
|
return typeof hash === "string" && SHA256_RE.test(hash);
|
|
5287
5877
|
}
|
|
5288
5878
|
var THEME_NAME_RE = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
5289
|
-
var ThemeResponseSchema =
|
|
5290
|
-
id:
|
|
5291
|
-
orgId:
|
|
5292
|
-
name:
|
|
5293
|
-
config:
|
|
5294
|
-
updatedAt:
|
|
5879
|
+
var ThemeResponseSchema = z35.object({
|
|
5880
|
+
id: z35.string(),
|
|
5881
|
+
orgId: z35.string(),
|
|
5882
|
+
name: z35.string(),
|
|
5883
|
+
config: z35.unknown(),
|
|
5884
|
+
updatedAt: z35.string()
|
|
5295
5885
|
// ISO 8601 timestamp
|
|
5296
5886
|
});
|
|
5297
|
-
var ThemeListItemSchema =
|
|
5298
|
-
id:
|
|
5299
|
-
orgId:
|
|
5300
|
-
name:
|
|
5301
|
-
updatedAt:
|
|
5887
|
+
var ThemeListItemSchema = z35.object({
|
|
5888
|
+
id: z35.string(),
|
|
5889
|
+
orgId: z35.string(),
|
|
5890
|
+
name: z35.string(),
|
|
5891
|
+
updatedAt: z35.string()
|
|
5302
5892
|
});
|
|
5303
|
-
var ThemeListResponseSchema =
|
|
5304
|
-
themes:
|
|
5893
|
+
var ThemeListResponseSchema = z35.object({
|
|
5894
|
+
themes: z35.array(ThemeListItemSchema)
|
|
5305
5895
|
});
|
|
5306
|
-
var UpsertThemeBodySchema =
|
|
5307
|
-
name:
|
|
5308
|
-
config:
|
|
5896
|
+
var UpsertThemeBodySchema = z35.object({
|
|
5897
|
+
name: z35.string().min(1).max(64).regex(THEME_NAME_RE, "Theme name may only contain letters, digits, hyphens, and underscores"),
|
|
5898
|
+
config: z35.unknown()
|
|
5309
5899
|
});
|
|
5310
5900
|
export {
|
|
5311
5901
|
AlgoliaDomainInputSchema,
|
|
@@ -5535,6 +6125,9 @@ export {
|
|
|
5535
6125
|
JavaCoordinateSchema,
|
|
5536
6126
|
JqStringSchema,
|
|
5537
6127
|
JsonBodyShapeSchema,
|
|
6128
|
+
LEDGER_ARTIFACT_METADATA_SCHEMAS,
|
|
6129
|
+
LEDGER_MANIFEST_SCHEMA_VERSION,
|
|
6130
|
+
LEDGER_SHARD_SCHEMA_VERSION,
|
|
5538
6131
|
LanguageEnumSchema,
|
|
5539
6132
|
LatestApiDefinitionSchema,
|
|
5540
6133
|
LatestAuthSchemeSchema,
|
|
@@ -5592,9 +6185,35 @@ export {
|
|
|
5592
6185
|
LatestWebhookDefinitionSchema,
|
|
5593
6186
|
LatestWebhookPayloadSchema,
|
|
5594
6187
|
LatestWebhookPayloadShapeSchema,
|
|
6188
|
+
LedgerArtifactMetadataSchema,
|
|
6189
|
+
LedgerArtifactTypeSchema,
|
|
6190
|
+
LedgerChangelogEntryMetadataSchema,
|
|
6191
|
+
LedgerChromeBlobSchema,
|
|
6192
|
+
LedgerConfigBlobSchema,
|
|
5595
6193
|
LedgerConfigSchema,
|
|
6194
|
+
LedgerFileArtifactMetadataSchema,
|
|
6195
|
+
LedgerGraphQlMetadataSchema,
|
|
6196
|
+
LedgerGrpcMetadataSchema,
|
|
6197
|
+
LedgerLinkMetadataSchema,
|
|
6198
|
+
LedgerLocaleIndexSchema,
|
|
6199
|
+
LedgerLocaleRoutingSchema,
|
|
6200
|
+
LedgerManifestSchema,
|
|
6201
|
+
LedgerMarkdownMetadataSchema,
|
|
6202
|
+
LedgerNavRouteSchema,
|
|
6203
|
+
LedgerPagesBlobSchema,
|
|
6204
|
+
LedgerPointerSegmentSchema,
|
|
5596
6205
|
LedgerPreviewRegisterInputSchema,
|
|
5597
6206
|
LedgerPreviewRegisterResponseSchema,
|
|
6207
|
+
LedgerRedirectMetadataSchema,
|
|
6208
|
+
LedgerRestMetadataSchema,
|
|
6209
|
+
LedgerRouteShardSchema,
|
|
6210
|
+
LedgerSegmentDetailMetadataSchema,
|
|
6211
|
+
LedgerSegmentMetadataSchema,
|
|
6212
|
+
LedgerShardFileSchema,
|
|
6213
|
+
LedgerSidebarBundleSchema,
|
|
6214
|
+
LedgerSidebarMapEntrySchema,
|
|
6215
|
+
LedgerWebSocketMetadataSchema,
|
|
6216
|
+
LedgerWebhookMetadataSchema,
|
|
5598
6217
|
LibraryDocsBaseConfigSchema,
|
|
5599
6218
|
LibraryDocsGenerationStatusSchema,
|
|
5600
6219
|
LibraryDocsResultSchema,
|
|
@@ -5616,6 +6235,13 @@ export {
|
|
|
5616
6235
|
LoadDocsForUrlResponseSchema,
|
|
5617
6236
|
LocaleEntrySchema,
|
|
5618
6237
|
LongTypeSchema,
|
|
6238
|
+
ManifestApiDefSchema,
|
|
6239
|
+
ManifestBlobRefSchema,
|
|
6240
|
+
ManifestFileSchema,
|
|
6241
|
+
ManifestNavRouteSchema,
|
|
6242
|
+
ManifestPageSchema,
|
|
6243
|
+
ManifestRouteSchema,
|
|
6244
|
+
ManifestSegmentSchema,
|
|
5619
6245
|
MarkdownEntrySchema,
|
|
5620
6246
|
MissingContentSchema,
|
|
5621
6247
|
MultipleAuthTypeSchema,
|
|
@@ -5632,6 +6258,7 @@ export {
|
|
|
5632
6258
|
OpenRpcProtocolSchema,
|
|
5633
6259
|
OrgId,
|
|
5634
6260
|
OrgIdSchema,
|
|
6261
|
+
PATH_OR_URL_METADATA_KEYS,
|
|
5635
6262
|
PageBlobRefSchema,
|
|
5636
6263
|
PageContentInputSchema,
|
|
5637
6264
|
PageContentResponseSchema,
|
|
@@ -5827,6 +6454,8 @@ export {
|
|
|
5827
6454
|
WithDescriptionSchema,
|
|
5828
6455
|
WithNamespaceSchema,
|
|
5829
6456
|
YankSchema,
|
|
6457
|
+
artifactTypeVariant,
|
|
6458
|
+
collectConfigFilePaths,
|
|
5830
6459
|
contentContract,
|
|
5831
6460
|
createApiClient,
|
|
5832
6461
|
createDashboardClient,
|
|
@@ -5834,7 +6463,6 @@ export {
|
|
|
5834
6463
|
createDocsClient,
|
|
5835
6464
|
createDocsDeploymentClient,
|
|
5836
6465
|
createDocsLedgerClient,
|
|
5837
|
-
createDocsLedgerReadClient,
|
|
5838
6466
|
createDocsV1ReadClient,
|
|
5839
6467
|
createDocsV1WriteClient,
|
|
5840
6468
|
createDocsV2ReadClient,
|
|
@@ -5878,6 +6506,7 @@ export {
|
|
|
5878
6506
|
slugsContract,
|
|
5879
6507
|
snippetsContract,
|
|
5880
6508
|
snippetsFactoryContract,
|
|
6509
|
+
stableStringify,
|
|
5881
6510
|
templatesContract,
|
|
5882
6511
|
tokensContract
|
|
5883
6512
|
};
|