@fern-api/fdr-sdk 1.2.174-d4501f54c4 → 1.2.174-eebbab17cf

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 (47) hide show
  1. package/dist/js/client/FdrClient.js +21 -0
  2. package/dist/js/client/FdrClient.js.map +1 -1
  3. package/dist/js/client/FdrClient.mjs +21 -0
  4. package/dist/js/client/FdrClient.mjs.map +1 -1
  5. package/dist/js/docs-ledger/index.js +21 -0
  6. package/dist/js/docs-ledger/index.js.map +1 -1
  7. package/dist/js/docs-ledger/index.mjs +21 -0
  8. package/dist/js/docs-ledger/index.mjs.map +1 -1
  9. package/dist/js/index.js +21 -0
  10. package/dist/js/index.js.map +1 -1
  11. package/dist/js/index.mjs +21 -0
  12. package/dist/js/index.mjs.map +1 -1
  13. package/dist/js/orpc-client.js +111 -2
  14. package/dist/js/orpc-client.js.map +1 -1
  15. package/dist/js/orpc-client.mjs +100 -2
  16. package/dist/js/orpc-client.mjs.map +1 -1
  17. package/dist/orpc-client/docs-anonymous/contract.d.ts +140 -0
  18. package/dist/orpc-client/docs-anonymous/contract.d.ts.map +1 -1
  19. package/dist/orpc-client/docs-anonymous/contract.js +40 -2
  20. package/dist/orpc-client/docs-anonymous/contract.js.map +1 -1
  21. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts +2 -0
  22. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts.map +1 -0
  23. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.js +49 -0
  24. package/dist/orpc-client/docs-ledger/__test__/static-build-files.test.js.map +1 -0
  25. package/dist/orpc-client/docs-ledger/contract.d.ts +112 -0
  26. package/dist/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  27. package/dist/orpc-client/docs-ledger/contract.js +29 -0
  28. package/dist/orpc-client/docs-ledger/contract.js.map +1 -1
  29. package/dist/orpc-client/docs-ledger/index.d.ts +1 -0
  30. package/dist/orpc-client/docs-ledger/index.d.ts.map +1 -1
  31. package/dist/orpc-client/docs-ledger/index.js +1 -0
  32. package/dist/orpc-client/docs-ledger/index.js.map +1 -1
  33. package/dist/orpc-client/docs-ledger/static-build-files.d.ts +20 -0
  34. package/dist/orpc-client/docs-ledger/static-build-files.d.ts.map +1 -0
  35. package/dist/orpc-client/docs-ledger/static-build-files.js +55 -0
  36. package/dist/orpc-client/docs-ledger/static-build-files.js.map +1 -0
  37. package/dist/types/orpc-client/docs-anonymous/contract.d.ts +140 -0
  38. package/dist/types/orpc-client/docs-anonymous/contract.d.ts.map +1 -1
  39. package/dist/types/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts +2 -0
  40. package/dist/types/orpc-client/docs-ledger/__test__/static-build-files.test.d.ts.map +1 -0
  41. package/dist/types/orpc-client/docs-ledger/contract.d.ts +112 -0
  42. package/dist/types/orpc-client/docs-ledger/contract.d.ts.map +1 -1
  43. package/dist/types/orpc-client/docs-ledger/index.d.ts +1 -0
  44. package/dist/types/orpc-client/docs-ledger/index.d.ts.map +1 -1
  45. package/dist/types/orpc-client/docs-ledger/static-build-files.d.ts +20 -0
  46. package/dist/types/orpc-client/docs-ledger/static-build-files.d.ts.map +1 -0
  47. 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,
@@ -617,6 +619,9 @@ __export(orpc_client_exports, {
617
619
  RegisterUndiscriminatedUnionVariantSchema: () => RegisterUndiscriminatedUnionVariantSchema,
618
620
  RegisterWebSocketChannelSchema: () => RegisterWebSocketChannelSchema,
619
621
  RegisterWebhookDefinitionSchema: () => RegisterWebhookDefinitionSchema,
622
+ RehomeGuestSessionInputSchema: () => RehomeGuestSessionInputSchema,
623
+ RehomeGuestSessionResponseSchema: () => RehomeGuestSessionResponseSchema,
624
+ RehomedGuestSiteSchema: () => RehomedGuestSiteSchema,
620
625
  ReindexInputSchema: () => ReindexInputSchema,
621
626
  ReindexResponseSchema: () => ReindexResponseSchema,
622
627
  ReleaseType: () => ReleaseType,
@@ -635,6 +640,9 @@ __export(orpc_client_exports, {
635
640
  RouteContextInputSchema: () => RouteContextInputSchema,
636
641
  RouteContextResponseSchema: () => RouteContextResponseSchema,
637
642
  RubyGemSchema: () => RubyGemSchema,
643
+ SHARED_ASSETS_PREFIX: () => SHARED_ASSETS_PREFIX,
644
+ SHARED_ASSET_DIRS: () => SHARED_ASSET_DIRS,
645
+ SHARED_MANIFEST_NAME: () => SHARED_MANIFEST_NAME,
638
646
  SafeDoxyfileContentSchema: () => SafeDoxyfileContentSchema,
639
647
  ScalarTypeSchema: () => ScalarTypeSchema,
640
648
  ScriptSchema: () => ScriptSchema,
@@ -674,6 +682,7 @@ __export(orpc_client_exports, {
674
682
  StartLibraryDocsGenerationResponseSchema: () => StartLibraryDocsGenerationResponseSchema,
675
683
  StartStaticBuildInputSchema: () => StartStaticBuildInputSchema,
676
684
  StartStaticBuildResponseSchema: () => StartStaticBuildResponseSchema,
685
+ StaticBuildFileSchema: () => StaticBuildFileSchema,
677
686
  StaticContentGroupBySchema: () => StaticContentGroupBySchema,
678
687
  StaticContentTrafficInputSchema: () => StaticContentTrafficInputSchema,
679
688
  StaticContentTrafficResponseSchema: () => StaticContentTrafficResponseSchema,
@@ -799,6 +808,8 @@ __export(orpc_client_exports, {
799
808
  gitContract: () => gitContract,
800
809
  isFernFileRef: () => isFernFileRef,
801
810
  isMcpAnalyticsWindow: () => isMcpAnalyticsWindow,
811
+ isRouterOnlyFile: () => isRouterOnlyFile,
812
+ isServedSharedManifestEntry: () => isServedSharedManifestEntry,
802
813
  ledgerSegmentIdentity: () => ledgerSegmentIdentity,
803
814
  libraryDocsContract: () => libraryDocsContract,
804
815
  mcpAnalyticsIndex: () => mcpAnalyticsIndex,
@@ -5960,6 +5971,25 @@ var LedgerPreviewRegisterResponseSchema = z22.object({
5960
5971
  /** Sanitized identifier the server actually used to compose the host. */
5961
5972
  previewId: z22.string()
5962
5973
  });
5974
+ var ListStaticBuildFilesInputSchema = z22.object({
5975
+ domain: z22.string().min(1),
5976
+ /** "" for a root site, otherwise a leading-slash basepath. */
5977
+ basepath: z22.string().default(""),
5978
+ /** `nextCursor` of the previous page; absent for the first page. */
5979
+ cursor: z22.string().optional()
5980
+ });
5981
+ var StaticBuildFileSchema = z22.object({
5982
+ /** Path relative to the host root, e.g. `docs/quickstart/index.html`. */
5983
+ path: z22.string(),
5984
+ /** Short-lived signed GET URL for the file. */
5985
+ url: z22.string()
5986
+ });
5987
+ var ListStaticBuildFilesResponseSchema = z22.object({
5988
+ buildId: z22.string(),
5989
+ files: z22.array(StaticBuildFileSchema),
5990
+ /** Pass back to get the next page; absent on the last page. */
5991
+ nextCursor: z22.string().optional()
5992
+ });
5963
5993
  var docsLedgerContract = {
5964
5994
  register: import_contract21.oc.route({ method: "POST", path: "/register" }).input(DocsPublishInputSchema).output(RegisterResponseSchema),
5965
5995
  previewRegister: import_contract21.oc.route({ method: "POST", path: "/preview/init" }).input(LedgerPreviewRegisterInputSchema).output(LedgerPreviewRegisterResponseSchema),
@@ -5971,6 +6001,8 @@ var docsLedgerContract = {
5971
6001
  reindex: import_contract21.oc.route({ method: "POST", path: "/reindex" }).input(ReindexInputSchema).output(ReindexResponseSchema),
5972
6002
  promoteStaticBuild: import_contract21.oc.route({ method: "POST", path: "/static-build/promote" }).input(PromoteStaticBuildInputSchema).output(PromoteStaticBuildResponseSchema),
5973
6003
  resolveStaticServingHost: import_contract21.oc.route({ method: "POST", path: "/static-build/serving-host" }).input(ResolveStaticServingHostInputSchema).output(ResolveStaticServingHostResponseSchema),
6004
+ /** Served by the read router; listed here so `createDocsLedgerClient` can call it. */
6005
+ listStaticBuildFiles: import_contract21.oc.route({ method: "GET", path: "/static-build/files" }).input(ListStaticBuildFilesInputSchema).output(ListStaticBuildFilesResponseSchema),
5974
6006
  getCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/get" }).input(CustomHostnameInputSchema).output(CustomHostnameResponseSchema),
5975
6007
  registerCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/register" }).input(CustomHostnameInputSchema).output(CustomHostnameResponseSchema),
5976
6008
  deleteCustomHostname: import_contract21.oc.route({ method: "POST", path: "/static-build/custom-hostname/delete" }).input(CustomHostnameInputSchema).output(DeleteCustomHostnameResponseSchema)
@@ -8160,7 +8192,14 @@ var GetAnonymousClaimResponseSchema = z37.object({
8160
8192
  });
8161
8193
  var ClaimAnonymousDocsSiteInputSchema = z37.object({
8162
8194
  grant: z37.string(),
8163
- toOrgId: z37.string()
8195
+ toOrgId: z37.string(),
8196
+ /**
8197
+ * The `<name>.<docs suffix>` address the claimed site moves to, instead of keeping its
8198
+ * `drop-<id>` host (a bare name is accepted too). Refused with `invalid_domain` (400) when it
8199
+ * is not one label under the docs suffix or is a drop name, and `domain_taken` (409) when any
8200
+ * site already uses it. The drop host redirects to the new address once it serves.
8201
+ */
8202
+ domain: z37.string().optional()
8164
8203
  });
8165
8204
  var ClaimAnonymousDocsSiteResponseSchema = z37.object({
8166
8205
  siteId: z37.string(),
@@ -8181,13 +8220,36 @@ var GetGuestDocsSiteResponseSchema = z37.object({
8181
8220
  /** The claim link is returned by every docs-ledger `finish`, not here. */
8182
8221
  limits: AnonymousDocsSiteLimitsSchema
8183
8222
  });
8223
+ var RehomeGuestSessionInputSchema = z37.object({
8224
+ /** The session's `guest-<id>` organization, as the claim page shows it. */
8225
+ guestOrgId: z37.string(),
8226
+ /**
8227
+ * The `<name>.<docs suffix>` address the session's published site takes instead of its
8228
+ * `drop-<id>` host (a bare name is accepted too); same rules and errors as `claim`'s `domain`.
8229
+ */
8230
+ domain: z37.string().optional()
8231
+ });
8232
+ var RehomedGuestSiteSchema = z37.object({
8233
+ siteId: z37.string(),
8234
+ domain: z37.string(),
8235
+ /** The build the site serves at `domain`; absent for a site that was never published. */
8236
+ buildId: z37.string().optional()
8237
+ });
8238
+ var RehomeGuestSessionResponseSchema = z37.object({
8239
+ sessionId: z37.string(),
8240
+ /** Where the sites are now: the organization Venus says the session was claimed into. */
8241
+ orgId: z37.string(),
8242
+ /** The sites moved by this call; empty when there was nothing (left) to move. */
8243
+ sites: z37.array(RehomedGuestSiteSchema)
8244
+ });
8184
8245
  var docsAnonymousContract = {
8185
8246
  getGuestSite: import_contract47.oc.route({ method: "GET", path: "/anonymous/guest-site" }).input(GetGuestDocsSiteInputSchema).output(GetGuestDocsSiteResponseSchema),
8186
8247
  create: import_contract47.oc.route({ method: "POST", path: "/anonymous/create" }).input(CreateAnonymousDocsSiteInputSchema.optional()).output(CreateAnonymousDocsSiteResponseSchema),
8187
8248
  consumeClaimToken: import_contract47.oc.route({ method: "POST", path: "/anonymous/claim-token/consume" }).input(ConsumeAnonymousClaimTokenInputSchema).output(ConsumeAnonymousClaimTokenResponseSchema),
8188
8249
  createClaimGrant: import_contract47.oc.route({ method: "POST", path: "/anonymous/sites/{siteId}/claim-grant" }).input(CreateAnonymousClaimGrantInputSchema).output(CreateAnonymousClaimGrantResponseSchema),
8189
8250
  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)
8251
+ claim: import_contract47.oc.route({ method: "POST", path: "/anonymous/claim" }).input(ClaimAnonymousDocsSiteInputSchema).output(ClaimAnonymousDocsSiteResponseSchema),
8252
+ rehomeGuestSession: import_contract47.oc.route({ method: "POST", path: "/anonymous/guest-session/rehome" }).input(RehomeGuestSessionInputSchema).output(RehomeGuestSessionResponseSchema)
8191
8253
  };
8192
8254
  var AnonymousDocsConfigDocumentSchema = z37.object({
8193
8255
  enabled: z37.boolean(),
@@ -8774,6 +8836,42 @@ function stableStringify(value) {
8774
8836
  });
8775
8837
  }
8776
8838
 
8839
+ // src/orpc-client/docs-ledger/static-build-files.ts
8840
+ var SHARED_ASSETS_PREFIX = "_shared";
8841
+ var SHARED_MANIFEST_NAME = "_fern-shared-assets.json";
8842
+ var SHARED_ASSET_DIRS = ["_astro", "_fern-mdx"];
8843
+ var SHARED_MANIFEST_ENTRY_RE = new RegExp(`^${SHARED_ASSETS_PREFIX}/(?:${SHARED_ASSET_DIRS.join("|")})/[^/]+$`);
8844
+ var MD5_HEX_RE = /^[0-9a-f]{32}$/;
8845
+ function isServedSharedManifestEntry(key, md5) {
8846
+ return typeof md5 === "string" && SHARED_MANIFEST_ENTRY_RE.test(key) && MD5_HEX_RE.test(md5);
8847
+ }
8848
+ var ROUTER_CONTROL_FILES = /* @__PURE__ */ new Set([
8849
+ "_redirects",
8850
+ "_redirects-fallback.json",
8851
+ "_headers",
8852
+ "_routes.json",
8853
+ SHARED_MANIFEST_NAME
8854
+ ]);
8855
+ var PUBLIC_FERN_DIRS = /* @__PURE__ */ new Set(["fern-nav"]);
8856
+ function isRouterOnlySegment(segment) {
8857
+ if (segment == null) {
8858
+ return false;
8859
+ }
8860
+ return ROUTER_CONTROL_FILES.has(segment) || segment.startsWith("fern-") && !PUBLIC_FERN_DIRS.has(segment);
8861
+ }
8862
+ function isRouterOnlyFile(path, basepath = "") {
8863
+ const segments = path.replace(/^\/+/, "").split("/");
8864
+ if (isRouterOnlySegment(segments[0])) {
8865
+ return true;
8866
+ }
8867
+ const basepathSegments = basepath.split("/").filter((segment) => segment.length > 0);
8868
+ if (basepathSegments.length === 0 || segments.length <= basepathSegments.length) {
8869
+ return false;
8870
+ }
8871
+ const underBasepath = basepathSegments.every((segment, i) => segments[i] === segment);
8872
+ return underBasepath && isRouterOnlySegment(segments[basepathSegments.length]);
8873
+ }
8874
+
8777
8875
  // src/orpc-client/files/contract.ts
8778
8876
  var import_contract50 = require("@orpc/contract");
8779
8877
  var z40 = __toESM(require("zod"), 1);
@@ -9326,6 +9424,8 @@ var UpsertThemeBodySchema = z42.object({
9326
9424
  ListRepositoriesResponseSchema,
9327
9425
  ListSdksForOrgInputSchema,
9328
9426
  ListSdksForOrgResponseSchema,
9427
+ ListStaticBuildFilesInputSchema,
9428
+ ListStaticBuildFilesResponseSchema,
9329
9429
  LiteralTypeSchema,
9330
9430
  LoadDocsForUrlResponseSchema,
9331
9431
  LocaleEntrySchema,
@@ -9499,6 +9599,9 @@ var UpsertThemeBodySchema = z42.object({
9499
9599
  RegisterUndiscriminatedUnionVariantSchema,
9500
9600
  RegisterWebSocketChannelSchema,
9501
9601
  RegisterWebhookDefinitionSchema,
9602
+ RehomeGuestSessionInputSchema,
9603
+ RehomeGuestSessionResponseSchema,
9604
+ RehomedGuestSiteSchema,
9502
9605
  ReindexInputSchema,
9503
9606
  ReindexResponseSchema,
9504
9607
  ReleaseType,
@@ -9517,6 +9620,9 @@ var UpsertThemeBodySchema = z42.object({
9517
9620
  RouteContextInputSchema,
9518
9621
  RouteContextResponseSchema,
9519
9622
  RubyGemSchema,
9623
+ SHARED_ASSETS_PREFIX,
9624
+ SHARED_ASSET_DIRS,
9625
+ SHARED_MANIFEST_NAME,
9520
9626
  SafeDoxyfileContentSchema,
9521
9627
  ScalarTypeSchema,
9522
9628
  ScriptSchema,
@@ -9556,6 +9662,7 @@ var UpsertThemeBodySchema = z42.object({
9556
9662
  StartLibraryDocsGenerationResponseSchema,
9557
9663
  StartStaticBuildInputSchema,
9558
9664
  StartStaticBuildResponseSchema,
9665
+ StaticBuildFileSchema,
9559
9666
  StaticContentGroupBySchema,
9560
9667
  StaticContentTrafficInputSchema,
9561
9668
  StaticContentTrafficResponseSchema,
@@ -9681,6 +9788,8 @@ var UpsertThemeBodySchema = z42.object({
9681
9788
  gitContract,
9682
9789
  isFernFileRef,
9683
9790
  isMcpAnalyticsWindow,
9791
+ isRouterOnlyFile,
9792
+ isServedSharedManifestEntry,
9684
9793
  ledgerSegmentIdentity,
9685
9794
  libraryDocsContract,
9686
9795
  mcpAnalyticsIndex,