@fern-api/fdr-sdk 1.2.174-7613689d9e → 1.2.174-7b6918a66a

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.
Files changed (57) hide show
  1. package/dist/client/FdrClient.d.ts +5 -0
  2. package/dist/client/FdrClient.d.ts.map +1 -1
  3. package/dist/js/client/FdrClient.js +24 -0
  4. package/dist/js/client/FdrClient.js.map +1 -1
  5. package/dist/js/client/FdrClient.mjs +24 -0
  6. package/dist/js/client/FdrClient.mjs.map +1 -1
  7. package/dist/js/docs-ledger/index.js +21 -0
  8. package/dist/js/docs-ledger/index.js.map +1 -1
  9. package/dist/js/docs-ledger/index.mjs +21 -0
  10. package/dist/js/docs-ledger/index.mjs.map +1 -1
  11. package/dist/js/index.js +24 -0
  12. package/dist/js/index.js.map +1 -1
  13. package/dist/js/index.mjs +24 -0
  14. package/dist/js/index.mjs.map +1 -1
  15. package/dist/js/orpc-client.js +121 -2
  16. package/dist/js/orpc-client.js.map +1 -1
  17. package/dist/js/orpc-client.mjs +108 -2
  18. package/dist/js/orpc-client.mjs.map +1 -1
  19. package/dist/orpc-client/docs-anonymous/contract.d.ts +140 -0
  20. package/dist/orpc-client/docs-anonymous/contract.d.ts.map +1 -1
  21. package/dist/orpc-client/docs-anonymous/contract.js +40 -2
  22. package/dist/orpc-client/docs-anonymous/contract.js.map +1 -1
  23. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts +2 -0
  24. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts.map +1 -0
  25. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.js +62 -0
  26. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.js.map +1 -0
  27. package/dist/orpc-client/docs-ledger/contract.d.ts +112 -0
  28. package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  29. package/dist/orpc-client/docs-ledger/contract.js +29 -0
  30. package/dist/orpc-client/docs-ledger/contract.js.map +1 -1
  31. package/dist/orpc-client/docs-ledger/index.d.ts +1 -0
  32. package/dist/orpc-client/docs-ledger/index.d.ts.map +1 -1
  33. package/dist/orpc-client/docs-ledger/index.js +1 -0
  34. package/dist/orpc-client/docs-ledger/index.js.map +1 -1
  35. package/dist/orpc-client/docs-ledger/static-build-files.d.ts +25 -0
  36. package/dist/orpc-client/docs-ledger/static-build-files.d.ts.map +1 -0
  37. package/dist/orpc-client/docs-ledger/static-build-files.js +62 -0
  38. package/dist/orpc-client/docs-ledger/static-build-files.js.map +1 -0
  39. package/dist/orpc-client/pdf-export/contract.d.ts +31 -0
  40. package/dist/orpc-client/pdf-export/contract.d.ts.map +1 -1
  41. package/dist/orpc-client/pdf-export/contract.js +4 -0
  42. package/dist/orpc-client/pdf-export/contract.js.map +1 -1
  43. package/dist/types/client/FdrClient.d.ts +5 -0
  44. package/dist/types/client/FdrClient.d.ts.map +1 -1
  45. package/dist/types/orpc-client/docs-anonymous/contract.d.ts +140 -0
  46. package/dist/types/orpc-client/docs-anonymous/contract.d.ts.map +1 -1
  47. package/dist/types/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts +2 -0
  48. package/dist/types/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts.map +1 -0
  49. package/dist/types/orpc-client/docs-ledger/contract.d.ts +112 -0
  50. package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  51. package/dist/types/orpc-client/docs-ledger/index.d.ts +1 -0
  52. package/dist/types/orpc-client/docs-ledger/index.d.ts.map +1 -1
  53. package/dist/types/orpc-client/docs-ledger/static-build-files.d.ts +25 -0
  54. package/dist/types/orpc-client/docs-ledger/static-build-files.d.ts.map +1 -0
  55. package/dist/types/orpc-client/pdf-export/contract.d.ts +31 -0
  56. package/dist/types/orpc-client/pdf-export/contract.d.ts.map +1 -1
  57. package/package.json +1 -1
@@ -444,6 +444,8 @@ __export(orpc_client_exports, {
444
444
  ListRepositoriesResponseSchema: () => ListRepositoriesResponseSchema,
445
445
  ListSdksForOrgInputSchema: () => ListSdksForOrgInputSchema,
446
446
  ListSdksForOrgResponseSchema: () => ListSdksForOrgResponseSchema,
447
+ ListStaticBuildFilesInputSchema: () => ListStaticBuildFilesInputSchema,
448
+ ListStaticBuildFilesResponseSchema: () => ListStaticBuildFilesResponseSchema,
447
449
  LiteralTypeSchema: () => LiteralTypeSchema,
448
450
  LoadDocsForUrlResponseSchema: () => LoadDocsForUrlResponseSchema,
449
451
  LocaleEntrySchema: () => LocaleEntrySchema,
@@ -522,6 +524,7 @@ __export(orpc_client_exports, {
522
524
  PathPartSchema: () => PathPartSchema,
523
525
  PauseMcpServerInputSchema: () => PauseMcpServerInputSchema,
524
526
  PdfExportDownloadResponseSchema: () => PdfExportDownloadResponseSchema,
527
+ PdfExportFormatSchema: () => PdfExportFormatSchema,
525
528
  PdfExportOptionsSchema: () => PdfExportOptionsSchema,
526
529
  PdfExportOptionsV1Schema: () => PdfExportOptionsV1Schema,
527
530
  PdfExportScopeSchema: () => PdfExportScopeSchema,
@@ -617,6 +620,9 @@ __export(orpc_client_exports, {
617
620
  RegisterUndiscriminatedUnionVariantSchema: () => RegisterUndiscriminatedUnionVariantSchema,
618
621
  RegisterWebSocketChannelSchema: () => RegisterWebSocketChannelSchema,
619
622
  RegisterWebhookDefinitionSchema: () => RegisterWebhookDefinitionSchema,
623
+ RehomeGuestSessionInputSchema: () => RehomeGuestSessionInputSchema,
624
+ RehomeGuestSessionResponseSchema: () => RehomeGuestSessionResponseSchema,
625
+ RehomedGuestSiteSchema: () => RehomedGuestSiteSchema,
620
626
  ReindexInputSchema: () => ReindexInputSchema,
621
627
  ReindexResponseSchema: () => ReindexResponseSchema,
622
628
  ReleaseType: () => ReleaseType,
@@ -635,6 +641,9 @@ __export(orpc_client_exports, {
635
641
  RouteContextInputSchema: () => RouteContextInputSchema,
636
642
  RouteContextResponseSchema: () => RouteContextResponseSchema,
637
643
  RubyGemSchema: () => RubyGemSchema,
644
+ SHARED_ASSETS_PREFIX: () => SHARED_ASSETS_PREFIX,
645
+ SHARED_ASSET_DIRS: () => SHARED_ASSET_DIRS,
646
+ SHARED_MANIFEST_NAME: () => SHARED_MANIFEST_NAME,
638
647
  SafeDoxyfileContentSchema: () => SafeDoxyfileContentSchema,
639
648
  ScalarTypeSchema: () => ScalarTypeSchema,
640
649
  ScriptSchema: () => ScriptSchema,
@@ -674,6 +683,7 @@ __export(orpc_client_exports, {
674
683
  StartLibraryDocsGenerationResponseSchema: () => StartLibraryDocsGenerationResponseSchema,
675
684
  StartStaticBuildInputSchema: () => StartStaticBuildInputSchema,
676
685
  StartStaticBuildResponseSchema: () => StartStaticBuildResponseSchema,
686
+ StaticBuildFileSchema: () => StaticBuildFileSchema,
677
687
  StaticContentGroupBySchema: () => StaticContentGroupBySchema,
678
688
  StaticContentTrafficInputSchema: () => StaticContentTrafficInputSchema,
679
689
  StaticContentTrafficResponseSchema: () => StaticContentTrafficResponseSchema,
@@ -799,6 +809,9 @@ __export(orpc_client_exports, {
799
809
  gitContract: () => gitContract,
800
810
  isFernFileRef: () => isFernFileRef,
801
811
  isMcpAnalyticsWindow: () => isMcpAnalyticsWindow,
812
+ isRouterOnlyFile: () => isRouterOnlyFile,
813
+ isServedSharedManifestEntry: () => isServedSharedManifestEntry,
814
+ keepsExportFile: () => keepsExportFile,
802
815
  ledgerSegmentIdentity: () => ledgerSegmentIdentity,
803
816
  libraryDocsContract: () => libraryDocsContract,
804
817
  mcpAnalyticsIndex: () => mcpAnalyticsIndex,
@@ -5960,6 +5973,25 @@ var LedgerPreviewRegisterResponseSchema = z22.object({
5960
5973
  /** Sanitized identifier the server actually used to compose the host. */
5961
5974
  previewId: z22.string()
5962
5975
  });
5976
+ var ListStaticBuildFilesInputSchema = z22.object({
5977
+ domain: z22.string().min(1),
5978
+ /** "" for a root site, otherwise a leading-slash basepath. */
5979
+ basepath: z22.string().default(""),
5980
+ /** `nextCursor` of the previous page; absent for the first page. */
5981
+ cursor: z22.string().optional()
5982
+ });
5983
+ var StaticBuildFileSchema = z22.object({
5984
+ /** Path relative to the host root, e.g. `docs/quickstart/index.html`. */
5985
+ path: z22.string(),
5986
+ /** Short-lived signed GET URL for the file. */
5987
+ url: z22.string()
5988
+ });
5989
+ var ListStaticBuildFilesResponseSchema = z22.object({
5990
+ buildId: z22.string(),
5991
+ files: z22.array(StaticBuildFileSchema),
5992
+ /** Pass back to get the next page; absent on the last page. */
5993
+ nextCursor: z22.string().optional()
5994
+ });
5963
5995
  var docsLedgerContract = {
5964
5996
  register: import_contract21.oc.route({ method: "POST", path: "/register" }).input(DocsPublishInputSchema).output(RegisterResponseSchema),
5965
5997
  previewRegister: import_contract21.oc.route({ method: "POST", path: "/preview/init" }).input(LedgerPreviewRegisterInputSchema).output(LedgerPreviewRegisterResponseSchema),
@@ -5971,6 +6003,8 @@ var docsLedgerContract = {
5971
6003
  reindex: import_contract21.oc.route({ method: "POST", path: "/reindex" }).input(ReindexInputSchema).output(ReindexResponseSchema),
5972
6004
  promoteStaticBuild: import_contract21.oc.route({ method: "POST", path: "/static-build/promote" }).input(PromoteStaticBuildInputSchema).output(PromoteStaticBuildResponseSchema),
5973
6005
  resolveStaticServingHost: import_contract21.oc.route({ method: "POST", path: "/static-build/serving-host" }).input(ResolveStaticServingHostInputSchema).output(ResolveStaticServingHostResponseSchema),
6006
+ /** Served by the read router; listed here so `createDocsLedgerClient` can call it. */
6007
+ listStaticBuildFiles: import_contract21.oc.route({ method: "GET", path: "/static-build/files" }).input(ListStaticBuildFilesInputSchema).output(ListStaticBuildFilesResponseSchema),
5974
6008
  getCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/get" }).input(CustomHostnameInputSchema).output(CustomHostnameResponseSchema),
5975
6009
  registerCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/register" }).input(CustomHostnameInputSchema).output(CustomHostnameResponseSchema),
5976
6010
  deleteCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/delete" }).input(CustomHostnameInputSchema).output(DeleteCustomHostnameResponseSchema)
@@ -7618,6 +7652,7 @@ var PdfExportOptionsSchema = z30.discriminatedUnion("version", [
7618
7652
  z30.object({ version: z30.literal("v1") }).merge(PdfExportOptionsV1Schema)
7619
7653
  ]);
7620
7654
  var PdfExportTaskStatusSchema = z30.enum(["PENDING", "RUNNING", "COMPLETED", "FAILED"]);
7655
+ var PdfExportFormatSchema = z30.enum(["pdf", "html", "md"]);
7621
7656
  var PdfExportTaskSchema = z30.object({
7622
7657
  id: z30.string(),
7623
7658
  orgId: z30.string(),
@@ -7627,6 +7662,7 @@ var PdfExportTaskSchema = z30.object({
7627
7662
  requesterName: z30.string().nullish(),
7628
7663
  notifyEmails: z30.array(z30.string()).nullish(),
7629
7664
  status: PdfExportTaskStatusSchema,
7665
+ format: PdfExportFormatSchema.nullish(),
7630
7666
  options: PdfExportOptionsSchema.nullish(),
7631
7667
  createdAt: z30.string(),
7632
7668
  startedAt: z30.string().nullish(),
@@ -7649,6 +7685,7 @@ var CreatePdfExportTaskInputSchema = z30.object({
7649
7685
  productId: z30.string().nullish(),
7650
7686
  versionId: z30.string().nullish(),
7651
7687
  requesterName: z30.string().nullish(),
7688
+ format: PdfExportFormatSchema.nullish(),
7652
7689
  options: PdfExportOptionsSchema.nullish()
7653
7690
  });
7654
7691
  var ListPdfExportTasksInputSchema = z30.object({
@@ -8160,7 +8197,14 @@ var GetAnonymousClaimResponseSchema = z37.object({
8160
8197
  });
8161
8198
  var ClaimAnonymousDocsSiteInputSchema = z37.object({
8162
8199
  grant: z37.string(),
8163
- toOrgId: z37.string()
8200
+ toOrgId: z37.string(),
8201
+ /**
8202
+ * The `<name>.<docs suffix>` address the claimed site moves to, instead of keeping its
8203
+ * `drop-<id>` host (a bare name is accepted too). Refused with `invalid_domain` (400) when it
8204
+ * is not one label under the docs suffix or is a drop name, and `domain_taken` (409) when any
8205
+ * site already uses it. The drop host redirects to the new address once it serves.
8206
+ */
8207
+ domain: z37.string().optional()
8164
8208
  });
8165
8209
  var ClaimAnonymousDocsSiteResponseSchema = z37.object({
8166
8210
  siteId: z37.string(),
@@ -8181,13 +8225,36 @@ var GetGuestDocsSiteResponseSchema = z37.object({
8181
8225
  /** The claim link is returned by every docs-ledger `finish`, not here. */
8182
8226
  limits: AnonymousDocsSiteLimitsSchema
8183
8227
  });
8228
+ var RehomeGuestSessionInputSchema = z37.object({
8229
+ /** The session's `guest-<id>` organization, as the claim page shows it. */
8230
+ guestOrgId: z37.string(),
8231
+ /**
8232
+ * The `<name>.<docs suffix>` address the session's published site takes instead of its
8233
+ * `drop-<id>` host (a bare name is accepted too); same rules and errors as `claim`'s `domain`.
8234
+ */
8235
+ domain: z37.string().optional()
8236
+ });
8237
+ var RehomedGuestSiteSchema = z37.object({
8238
+ siteId: z37.string(),
8239
+ domain: z37.string(),
8240
+ /** The build the site serves at `domain`; absent for a site that was never published. */
8241
+ buildId: z37.string().optional()
8242
+ });
8243
+ var RehomeGuestSessionResponseSchema = z37.object({
8244
+ sessionId: z37.string(),
8245
+ /** Where the sites are now: the organization Venus says the session was claimed into. */
8246
+ orgId: z37.string(),
8247
+ /** The sites moved by this call; empty when there was nothing (left) to move. */
8248
+ sites: z37.array(RehomedGuestSiteSchema)
8249
+ });
8184
8250
  var docsAnonymousContract = {
8185
8251
  getGuestSite: import_contract47.oc.route({ method: "GET", path: "/anonymous/guest-site" }).input(GetGuestDocsSiteInputSchema).output(GetGuestDocsSiteResponseSchema),
8186
8252
  create: import_contract47.oc.route({ method: "POST", path: "/anonymous/create" }).input(CreateAnonymousDocsSiteInputSchema.optional()).output(CreateAnonymousDocsSiteResponseSchema),
8187
8253
  consumeClaimToken: import_contract47.oc.route({ method: "POST", path: "/anonymous/claim-token/consume" }).input(ConsumeAnonymousClaimTokenInputSchema).output(ConsumeAnonymousClaimTokenResponseSchema),
8188
8254
  createClaimGrant: import_contract47.oc.route({ method: "POST", path: "/anonymous/sites/{siteId}/claim-grant" }).input(CreateAnonymousClaimGrantInputSchema).output(CreateAnonymousClaimGrantResponseSchema),
8189
8255
  getClaim: import_contract47.oc.route({ method: "GET", path: "/anonymous/claim/{grant}" }).input(GetAnonymousClaimInputSchema).output(GetAnonymousClaimResponseSchema),
8190
- claim: import_contract47.oc.route({ method: "POST", path: "/anonymous/claim" }).input(ClaimAnonymousDocsSiteInputSchema).output(ClaimAnonymousDocsSiteResponseSchema)
8256
+ claim: import_contract47.oc.route({ method: "POST", path: "/anonymous/claim" }).input(ClaimAnonymousDocsSiteInputSchema).output(ClaimAnonymousDocsSiteResponseSchema),
8257
+ rehomeGuestSession: import_contract47.oc.route({ method: "POST", path: "/anonymous/guest-session/rehome" }).input(RehomeGuestSessionInputSchema).output(RehomeGuestSessionResponseSchema)
8191
8258
  };
8192
8259
  var AnonymousDocsConfigDocumentSchema = z37.object({
8193
8260
  enabled: z37.boolean(),
@@ -8774,6 +8841,45 @@ function stableStringify(value) {
8774
8841
  });
8775
8842
  }
8776
8843
 
8844
+ // src/orpc-client/docs-ledger/static-build-files.ts
8845
+ var SHARED_ASSETS_PREFIX = "_shared";
8846
+ var SHARED_MANIFEST_NAME = "_fern-shared-assets.json";
8847
+ var SHARED_ASSET_DIRS = ["_astro", "_fern-mdx"];
8848
+ var SHARED_MANIFEST_ENTRY_RE = new RegExp(`^${SHARED_ASSETS_PREFIX}/(?:${SHARED_ASSET_DIRS.join("|")})/[^/]+$`);
8849
+ var MD5_HEX_RE = /^[0-9a-f]{32}$/;
8850
+ function isServedSharedManifestEntry(key, md5) {
8851
+ return typeof md5 === "string" && SHARED_MANIFEST_ENTRY_RE.test(key) && MD5_HEX_RE.test(md5);
8852
+ }
8853
+ var ROUTER_CONTROL_FILES = /* @__PURE__ */ new Set([
8854
+ "_redirects",
8855
+ "_redirects-fallback.json",
8856
+ "_headers",
8857
+ "_routes.json",
8858
+ SHARED_MANIFEST_NAME
8859
+ ]);
8860
+ var PUBLIC_FERN_DIRS = /* @__PURE__ */ new Set(["fern-nav"]);
8861
+ function isRouterOnlySegment(segment) {
8862
+ if (segment == null) {
8863
+ return false;
8864
+ }
8865
+ return ROUTER_CONTROL_FILES.has(segment) || segment.startsWith("fern-") && !PUBLIC_FERN_DIRS.has(segment);
8866
+ }
8867
+ function isRouterOnlyFile(path, basepath = "") {
8868
+ const segments = path.replace(/^\/+/, "").split("/");
8869
+ if (isRouterOnlySegment(segments[0])) {
8870
+ return true;
8871
+ }
8872
+ const basepathSegments = basepath.split("/").filter((segment) => segment.length > 0);
8873
+ if (basepathSegments.length === 0 || segments.length <= basepathSegments.length) {
8874
+ return false;
8875
+ }
8876
+ const underBasepath = basepathSegments.every((segment, i) => segments[i] === segment);
8877
+ return underBasepath && isRouterOnlySegment(segments[basepathSegments.length]);
8878
+ }
8879
+ function keepsExportFile(path, format) {
8880
+ return format === "html" || path.endsWith(".md") || path.split("/").pop() === "llms.txt";
8881
+ }
8882
+
8777
8883
  // src/orpc-client/files/contract.ts
8778
8884
  var import_contract50 = require("@orpc/contract");
8779
8885
  var z40 = __toESM(require("zod"), 1);
@@ -9326,6 +9432,8 @@ var UpsertThemeBodySchema = z42.object({
9326
9432
  ListRepositoriesResponseSchema,
9327
9433
  ListSdksForOrgInputSchema,
9328
9434
  ListSdksForOrgResponseSchema,
9435
+ ListStaticBuildFilesInputSchema,
9436
+ ListStaticBuildFilesResponseSchema,
9329
9437
  LiteralTypeSchema,
9330
9438
  LoadDocsForUrlResponseSchema,
9331
9439
  LocaleEntrySchema,
@@ -9404,6 +9512,7 @@ var UpsertThemeBodySchema = z42.object({
9404
9512
  PathPartSchema,
9405
9513
  PauseMcpServerInputSchema,
9406
9514
  PdfExportDownloadResponseSchema,
9515
+ PdfExportFormatSchema,
9407
9516
  PdfExportOptionsSchema,
9408
9517
  PdfExportOptionsV1Schema,
9409
9518
  PdfExportScopeSchema,
@@ -9499,6 +9608,9 @@ var UpsertThemeBodySchema = z42.object({
9499
9608
  RegisterUndiscriminatedUnionVariantSchema,
9500
9609
  RegisterWebSocketChannelSchema,
9501
9610
  RegisterWebhookDefinitionSchema,
9611
+ RehomeGuestSessionInputSchema,
9612
+ RehomeGuestSessionResponseSchema,
9613
+ RehomedGuestSiteSchema,
9502
9614
  ReindexInputSchema,
9503
9615
  ReindexResponseSchema,
9504
9616
  ReleaseType,
@@ -9517,6 +9629,9 @@ var UpsertThemeBodySchema = z42.object({
9517
9629
  RouteContextInputSchema,
9518
9630
  RouteContextResponseSchema,
9519
9631
  RubyGemSchema,
9632
+ SHARED_ASSETS_PREFIX,
9633
+ SHARED_ASSET_DIRS,
9634
+ SHARED_MANIFEST_NAME,
9520
9635
  SafeDoxyfileContentSchema,
9521
9636
  ScalarTypeSchema,
9522
9637
  ScriptSchema,
@@ -9556,6 +9671,7 @@ var UpsertThemeBodySchema = z42.object({
9556
9671
  StartLibraryDocsGenerationResponseSchema,
9557
9672
  StartStaticBuildInputSchema,
9558
9673
  StartStaticBuildResponseSchema,
9674
+ StaticBuildFileSchema,
9559
9675
  StaticContentGroupBySchema,
9560
9676
  StaticContentTrafficInputSchema,
9561
9677
  StaticContentTrafficResponseSchema,
@@ -9681,6 +9797,9 @@ var UpsertThemeBodySchema = z42.object({
9681
9797
  gitContract,
9682
9798
  isFernFileRef,
9683
9799
  isMcpAnalyticsWindow,
9800
+ isRouterOnlyFile,
9801
+ isServedSharedManifestEntry,
9802
+ keepsExportFile,
9684
9803
  ledgerSegmentIdentity,
9685
9804
  libraryDocsContract,
9686
9805
  mcpAnalyticsIndex,