@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.
@@ -188,6 +188,7 @@ __export(orpc_client_exports, {
188
188
  GetSdkDynamicIrUploadUrlsResponseSchema: () => GetSdkDynamicIrUploadUrlsResponseSchema,
189
189
  GithubRepositoryIdSchema: () => GithubRepositoryIdSchema,
190
190
  GithubTeamSchema: () => GithubTeamSchema,
191
+ GithubUrlSchema: () => GithubUrlSchema,
191
192
  GithubUserSchema: () => GithubUserSchema,
192
193
  GoModuleSchema: () => GoModuleSchema,
193
194
  GraphQlArgumentSchema: () => GraphQlArgumentSchema,
@@ -3199,9 +3200,36 @@ var import_fetch5 = require("@orpc/openapi-client/fetch");
3199
3200
  // src/orpc-client/docs/v2/library-docs/contract.ts
3200
3201
  var import_contract8 = require("@orpc/contract");
3201
3202
  var z14 = __toESM(require("zod"), 1);
3203
+ var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
3204
+ var GithubUrlSchema = z14.string().url().describe(
3205
+ "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>."
3206
+ ).refine(
3207
+ (url) => {
3208
+ try {
3209
+ const parsed = new URL(url);
3210
+ if (parsed.protocol !== "https:") {
3211
+ return false;
3212
+ }
3213
+ if (!ALLOWED_HOSTNAMES.has(parsed.hostname)) {
3214
+ return false;
3215
+ }
3216
+ if (parsed.username || parsed.password) {
3217
+ return false;
3218
+ }
3219
+ return /^\/[\w.-]+\/[\w.-]+(?:\.git)?\/?$/.test(parsed.pathname);
3220
+ } catch {
3221
+ return false;
3222
+ }
3223
+ },
3224
+ { message: "Must be a valid https://github.com/<owner>/<repo> or https://gitlab.com/<owner>/<repo> URL" }
3225
+ );
3226
+ var SafeBranchSchema = z14.string().regex(/^[a-zA-Z0-9._/-]+$/, "Invalid branch name").nullish();
3227
+ var SafePackagePathSchema = z14.string().refine((p) => !p.includes("..") && !p.startsWith("/"), {
3228
+ message: "packagePath must not contain path traversal sequences"
3229
+ }).nullish();
3202
3230
  var LibraryDocsBaseConfigSchema = z14.object({
3203
- branch: z14.string().nullish(),
3204
- packagePath: z14.string().nullish(),
3231
+ branch: SafeBranchSchema,
3232
+ packagePath: SafePackagePathSchema,
3205
3233
  title: z14.string().nullish(),
3206
3234
  slug: z14.string().nullish()
3207
3235
  });
@@ -3212,13 +3240,13 @@ var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
3212
3240
  var StartLibraryDocsGenerationInputSchema = z14.discriminatedUnion("language", [
3213
3241
  z14.object({
3214
3242
  orgId: z14.string(),
3215
- githubUrl: z14.string(),
3243
+ githubUrl: GithubUrlSchema,
3216
3244
  language: z14.literal("PYTHON"),
3217
3245
  config: PythonLibraryDocsConfigSchema.nullish()
3218
3246
  }),
3219
3247
  z14.object({
3220
3248
  orgId: z14.string(),
3221
- githubUrl: z14.string(),
3249
+ githubUrl: GithubUrlSchema,
3222
3250
  language: z14.literal("CPP"),
3223
3251
  config: CppLibraryDocsConfigSchema.nullish()
3224
3252
  })
@@ -4566,6 +4594,7 @@ function createFdrORPCClient(options) {
4566
4594
  GetSdkDynamicIrUploadUrlsResponseSchema,
4567
4595
  GithubRepositoryIdSchema,
4568
4596
  GithubTeamSchema,
4597
+ GithubUrlSchema,
4569
4598
  GithubUserSchema,
4570
4599
  GoModuleSchema,
4571
4600
  GraphQlArgumentSchema,