@fern-api/fdr-sdk 1.1.7-45ebcd86eb → 1.1.7-97cbb284fe

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.
@@ -2696,9 +2696,36 @@ import { OpenAPILink as OpenAPILink5 } from "@orpc/openapi-client/fetch";
2696
2696
  // src/orpc-client/docs/v2/library-docs/contract.ts
2697
2697
  import { oc as oc5 } from "@orpc/contract";
2698
2698
  import * as z14 from "zod";
2699
+ var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
2700
+ var GithubUrlSchema = z14.string().url().describe(
2701
+ "HTTPS URL of a GitHub or GitLab repository. Currently only github.com and gitlab.com are supported. Must match the pattern https://github.com/<owner>/<repo> or https://gitlab.com/<owner>/<repo>."
2702
+ ).refine(
2703
+ (url) => {
2704
+ try {
2705
+ const parsed = new URL(url);
2706
+ if (parsed.protocol !== "https:") {
2707
+ return false;
2708
+ }
2709
+ if (!ALLOWED_HOSTNAMES.has(parsed.hostname)) {
2710
+ return false;
2711
+ }
2712
+ if (parsed.username || parsed.password) {
2713
+ return false;
2714
+ }
2715
+ return /^\/[\w.-]+\/[\w.-]+(?:\.git)?\/?$/.test(parsed.pathname);
2716
+ } catch {
2717
+ return false;
2718
+ }
2719
+ },
2720
+ { message: "Must be a valid https://github.com/<owner>/<repo> or https://gitlab.com/<owner>/<repo> URL" }
2721
+ );
2722
+ var SafeBranchSchema = z14.string().regex(/^[a-zA-Z0-9._/-]+$/, "Invalid branch name").nullish();
2723
+ var SafePackagePathSchema = z14.string().refine((p) => !p.includes("..") && !p.startsWith("/"), {
2724
+ message: "packagePath must not contain path traversal sequences"
2725
+ }).nullish();
2699
2726
  var LibraryDocsBaseConfigSchema = z14.object({
2700
- branch: z14.string().nullish(),
2701
- packagePath: z14.string().nullish(),
2727
+ branch: SafeBranchSchema,
2728
+ packagePath: SafePackagePathSchema,
2702
2729
  title: z14.string().nullish(),
2703
2730
  slug: z14.string().nullish()
2704
2731
  });
@@ -2709,13 +2736,13 @@ var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
2709
2736
  var StartLibraryDocsGenerationInputSchema = z14.discriminatedUnion("language", [
2710
2737
  z14.object({
2711
2738
  orgId: z14.string(),
2712
- githubUrl: z14.string(),
2739
+ githubUrl: GithubUrlSchema,
2713
2740
  language: z14.literal("PYTHON"),
2714
2741
  config: PythonLibraryDocsConfigSchema.nullish()
2715
2742
  }),
2716
2743
  z14.object({
2717
2744
  orgId: z14.string(),
2718
- githubUrl: z14.string(),
2745
+ githubUrl: GithubUrlSchema,
2719
2746
  language: z14.literal("CPP"),
2720
2747
  config: CppLibraryDocsConfigSchema.nullish()
2721
2748
  })
@@ -4062,6 +4089,7 @@ export {
4062
4089
  GetSdkDynamicIrUploadUrlsResponseSchema,
4063
4090
  GithubRepositoryIdSchema,
4064
4091
  GithubTeamSchema,
4092
+ GithubUrlSchema,
4065
4093
  GithubUserSchema,
4066
4094
  GoModuleSchema,
4067
4095
  GraphQlArgumentSchema,