@fern-api/fern-api-dev 3.56.8 → 3.56.10

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 (2) hide show
  1. package/cli.cjs +389 -151
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1421729,52 +1421729,6 @@ function addAuthCommand(cli) {
1421729
1421729
  commandGroup(cli, "auth <command>", "Authenticate fern", [addLoginCommand, addLogoutCommand, addTokenCommand]);
1421730
1421730
  }
1421731
1421731
 
1421732
- // ../config/lib/schemas/index.js
1421733
- var schemas_exports4 = {};
1421734
- __export(schemas_exports4, {
1421735
- AiConfigSchema: () => AiConfigSchema,
1421736
- AiProviderSchema: () => AiProviderSchema,
1421737
- ApiDefinitionSchema: () => ApiDefinitionSchema,
1421738
- ApiSpecSchema: () => ApiSpecSchema,
1421739
- ApisSchema: () => ApisSchema,
1421740
- AsyncApiSettingsSchema: () => AsyncApiSettingsSchema,
1421741
- AsyncApiSpecSchema: () => AsyncApiSpecSchema,
1421742
- BaseApiSettingsSchema: () => BaseApiSettingsSchema,
1421743
- CliSchema: () => CliSchema,
1421744
- ConjureSettingsSchema: () => ConjureSettingsSchema,
1421745
- ConjureSpecSchema: () => ConjureSpecSchema,
1421746
- DefaultIntegerFormatSchema: () => DefaultIntegerFormatSchema,
1421747
- ExampleGenerationSchema: () => ExampleGenerationSchema,
1421748
- FernSettingsSchema: () => FernSettingsSchema,
1421749
- FernSpecSchema: () => FernSpecSchema,
1421750
- FernYmlSchema: () => FernYmlSchema,
1421751
- FormParameterEncodingSchema: () => FormParameterEncodingSchema,
1421752
- GitOutputModeSchema: () => GitOutputModeSchema,
1421753
- GitOutputSchema: () => GitOutputSchema,
1421754
- LicenseSchema: () => LicenseSchema,
1421755
- MessageNamingVersionSchema: () => MessageNamingVersionSchema,
1421756
- NpmPublishSchema: () => NpmPublishSchema,
1421757
- OpenApiExampleGenerationSchema: () => OpenApiExampleGenerationSchema,
1421758
- OpenApiFilterSchema: () => OpenApiFilterSchema,
1421759
- OpenApiSettingsSchema: () => OpenApiSettingsSchema,
1421760
- OpenApiSpecSchema: () => OpenApiSpecSchema,
1421761
- OpenRpcSettingsSchema: () => OpenRpcSettingsSchema,
1421762
- OpenRpcSpecSchema: () => OpenRpcSpecSchema,
1421763
- OutputSchema: () => OutputSchema,
1421764
- PathParameterOrderSchema: () => PathParameterOrderSchema,
1421765
- ProtobufDefinitionSchema: () => ProtobufDefinitionSchema,
1421766
- ProtobufSettingsSchema: () => ProtobufSettingsSchema,
1421767
- ProtobufSpecSchema: () => ProtobufSpecSchema,
1421768
- PublishSchema: () => PublishSchema,
1421769
- ReadmeSchema: () => ReadmeSchema,
1421770
- RemoveDiscriminantsFromSchemasSchema: () => RemoveDiscriminantsFromSchemasSchema,
1421771
- ResolveAliasesSchema: () => ResolveAliasesSchema,
1421772
- SdkTargetLanguageSchema: () => SdkTargetLanguageSchema,
1421773
- SdkTargetSchema: () => SdkTargetSchema,
1421774
- SdksSchema: () => SdksSchema,
1421775
- isWellKnownLicense: () => isWellKnownLicense
1421776
- });
1421777
-
1421778
1421732
  // ../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
1421779
1421733
  var external_exports = {};
1421780
1421734
  __export(external_exports, {
@@ -1435805,27 +1435759,47 @@ var CliSchema = external_exports.object({
1435805
1435759
  version: external_exports.string().optional()
1435806
1435760
  });
1435807
1435761
 
1435762
+ // ../config/lib/schemas/CratesPublishSchema.js
1435763
+ var CratesPublishSchema = external_exports.object({
1435764
+ packageName: external_exports.string(),
1435765
+ url: external_exports.string().optional(),
1435766
+ token: external_exports.string().optional()
1435767
+ });
1435768
+
1435808
1435769
  // ../config/lib/schemas/ReadmeSchema.js
1435809
1435770
  var ReadmeSchema = external_exports.object({
1435810
1435771
  defaultEndpoint: external_exports.string().optional()
1435811
1435772
  });
1435812
1435773
 
1435774
+ // ../config/lib/schemas/MetadataSchema.js
1435775
+ var AuthorSchema = external_exports.object({
1435776
+ name: external_exports.string(),
1435777
+ email: external_exports.string()
1435778
+ });
1435779
+ var MetadataSchema = external_exports.object({
1435780
+ description: external_exports.string().optional(),
1435781
+ authors: external_exports.array(AuthorSchema).optional()
1435782
+ });
1435783
+
1435813
1435784
  // ../config/lib/schemas/GitOutputModeSchema.js
1435814
1435785
  var GitOutputModeSchema = external_exports.enum(["pr", "release", "push"]);
1435815
1435786
 
1435816
1435787
  // ../config/lib/schemas/LicenseSchema.js
1435817
- var WELL_KNOWN_LICENSES = ["MIT", "Apache-2.0"];
1435818
- function isWellKnownLicense(license) {
1435819
- return WELL_KNOWN_LICENSES.includes(license);
1435820
- }
1435821
1435788
  var LicenseSchema = external_exports.string();
1435822
1435789
 
1435790
+ // ../config/lib/schemas/ReviewersSchema.js
1435791
+ var ReviewersSchema = external_exports.object({
1435792
+ teams: external_exports.array(external_exports.string()).optional(),
1435793
+ users: external_exports.array(external_exports.string()).optional()
1435794
+ });
1435795
+
1435823
1435796
  // ../config/lib/schemas/GitOutputSchema.js
1435824
1435797
  var GitOutputSchema = external_exports.object({
1435825
1435798
  repository: external_exports.string(),
1435826
1435799
  mode: GitOutputModeSchema.optional(),
1435827
1435800
  branch: external_exports.string().optional(),
1435828
- license: LicenseSchema.optional()
1435801
+ license: LicenseSchema.optional(),
1435802
+ reviewers: ReviewersSchema.optional()
1435829
1435803
  });
1435830
1435804
 
1435831
1435805
  // ../config/lib/schemas/OutputSchema.js
@@ -1435834,14 +1435808,64 @@ var OutputSchema = external_exports.object({
1435834
1435808
  git: GitOutputSchema.optional()
1435835
1435809
  });
1435836
1435810
 
1435811
+ // ../config/lib/schemas/MavenPublishSchema.js
1435812
+ var MavenSignatureSchema = external_exports.object({
1435813
+ keyId: external_exports.string(),
1435814
+ password: external_exports.string(),
1435815
+ secretKey: external_exports.string()
1435816
+ });
1435817
+ var MavenPublishSchema = external_exports.object({
1435818
+ coordinate: external_exports.string(),
1435819
+ url: external_exports.string().optional(),
1435820
+ username: external_exports.string().optional(),
1435821
+ password: external_exports.string().optional(),
1435822
+ signature: MavenSignatureSchema.optional()
1435823
+ });
1435824
+
1435837
1435825
  // ../config/lib/schemas/NpmPublishSchema.js
1435838
1435826
  var NpmPublishSchema = external_exports.object({
1435839
- packageName: external_exports.string()
1435827
+ packageName: external_exports.string(),
1435828
+ url: external_exports.string().optional(),
1435829
+ token: external_exports.string().optional()
1435830
+ });
1435831
+
1435832
+ // ../config/lib/schemas/NugetPublishSchema.js
1435833
+ var NugetPublishSchema = external_exports.object({
1435834
+ packageName: external_exports.string(),
1435835
+ url: external_exports.string().optional(),
1435836
+ apiKey: external_exports.string().optional()
1435837
+ });
1435838
+
1435839
+ // ../config/lib/schemas/PypiPublishSchema.js
1435840
+ var PypiMetadataSchema = external_exports.object({
1435841
+ keywords: external_exports.array(external_exports.string()).optional(),
1435842
+ documentationLink: external_exports.string().optional(),
1435843
+ homepageLink: external_exports.string().optional()
1435844
+ });
1435845
+ var PypiPublishSchema = external_exports.object({
1435846
+ packageName: external_exports.string(),
1435847
+ url: external_exports.string().optional(),
1435848
+ token: external_exports.string().optional(),
1435849
+ username: external_exports.string().optional(),
1435850
+ password: external_exports.string().optional(),
1435851
+ metadata: PypiMetadataSchema.optional()
1435852
+ });
1435853
+
1435854
+ // ../config/lib/schemas/RubygemsPublishSchema.js
1435855
+ var RubygemsPublishSchema = external_exports.object({
1435856
+ packageName: external_exports.string(),
1435857
+ url: external_exports.string().optional(),
1435858
+ apiKey: external_exports.string().optional()
1435840
1435859
  });
1435841
1435860
 
1435842
1435861
  // ../config/lib/schemas/PublishSchema.js
1435843
1435862
  var PublishSchema = external_exports.object({
1435844
- npm: NpmPublishSchema.optional()
1435863
+ npm: NpmPublishSchema.optional(),
1435864
+ pypi: PypiPublishSchema.optional(),
1435865
+ maven: MavenPublishSchema.optional(),
1435866
+ nuget: NugetPublishSchema.optional(),
1435867
+ rubygems: RubygemsPublishSchema.optional(),
1435868
+ crates: CratesPublishSchema.optional()
1435845
1435869
  });
1435846
1435870
 
1435847
1435871
  // ../config/lib/schemas/SdkTargetLanguageSchema.js
@@ -1435866,7 +1435890,8 @@ var SdkTargetSchema = external_exports.object({
1435866
1435890
  config: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
1435867
1435891
  publish: PublishSchema.optional(),
1435868
1435892
  output: OutputSchema,
1435869
- group: external_exports.array(external_exports.string()).optional()
1435893
+ group: external_exports.array(external_exports.string()).optional(),
1435894
+ metadata: MetadataSchema.optional()
1435870
1435895
  });
1435871
1435896
 
1435872
1435897
  // ../config/lib/schemas/SdksSchema.js
@@ -1444447,7 +1444472,7 @@ __export(serialization_exports3, {
1444447
1444472
  ResolveAliases: () => ResolveAliases,
1444448
1444473
  ResolveAliasesSchema: () => ResolveAliasesSchema2,
1444449
1444474
  ReviewerSchema: () => ReviewerSchema,
1444450
- ReviewersSchema: () => ReviewersSchema,
1444475
+ ReviewersSchema: () => ReviewersSchema2,
1444451
1444476
  RubyGemsOutputLocationSchema: () => RubyGemsOutputLocationSchema,
1444452
1444477
  SpecSchema: () => SpecSchema,
1444453
1444478
  UnionSettingsSchema: () => UnionSettingsSchema2,
@@ -1446571,7 +1446596,7 @@ var ReviewerSchema = schemas_exports7.object({
1446571
1446596
  });
1446572
1446597
 
1446573
1446598
  // ../configuration/lib/generators-yml/schemas/serialization/resources/reviewers/types/ReviewersSchema.js
1446574
- var ReviewersSchema = schemas_exports7.object({
1446599
+ var ReviewersSchema2 = schemas_exports7.object({
1446575
1446600
  teams: schemas_exports7.list(ReviewerSchema).optional(),
1446576
1446601
  users: schemas_exports7.list(ReviewerSchema).optional()
1446577
1446602
  });
@@ -1446713,7 +1446738,7 @@ var GithubPullRequestSchema = schemas_exports7.object({
1446713
1446738
  branch: schemas_exports7.string().optional(),
1446714
1446739
  license: GithubLicenseSchema.optional(),
1446715
1446740
  mode: schemas_exports7.stringLiteral("pull-request"),
1446716
- reviewers: ReviewersSchema.optional()
1446741
+ reviewers: ReviewersSchema2.optional()
1446717
1446742
  });
1446718
1446743
 
1446719
1446744
  // ../configuration/lib/generators-yml/schemas/serialization/resources/group/types/GithubPushSchema.js
@@ -1446767,7 +1446792,7 @@ var GeneratorGroupSchema = schemas_exports7.object({
1446767
1446792
  audiences: schemas_exports7.list(schemas_exports7.string()).optional(),
1446768
1446793
  generators: schemas_exports7.list(GeneratorInvocationSchema),
1446769
1446794
  metadata: OutputMetadataSchema.optional(),
1446770
- reviewers: ReviewersSchema.optional()
1446795
+ reviewers: ReviewersSchema2.optional()
1446771
1446796
  });
1446772
1446797
 
1446773
1446798
  // ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/GeneratorsOpenApiObjectSchema.js
@@ -1446837,7 +1446862,7 @@ var GeneratorsConfigurationSchema = schemas_exports7.object({
1446837
1446862
  "default-group": schemas_exports7.string().optional(),
1446838
1446863
  aliases: schemas_exports7.record(schemas_exports7.string(), schemas_exports7.list(schemas_exports7.string())).optional(),
1446839
1446864
  groups: schemas_exports7.record(schemas_exports7.string(), GeneratorGroupSchema).optional(),
1446840
- reviewers: ReviewersSchema.optional(),
1446865
+ reviewers: ReviewersSchema2.optional(),
1446841
1446866
  ai: AiServicesSchema.optional(),
1446842
1446867
  autorelease: schemas_exports7.boolean().optional(),
1446843
1446868
  openapi: GeneratorsOpenApiSchema.optional(),
@@ -1446887,7 +1446912,7 @@ __export(license_exports2, {
1446887
1446912
  var reviewers_exports2 = {};
1446888
1446913
  __export(reviewers_exports2, {
1446889
1446914
  ReviewerSchema: () => ReviewerSchema,
1446890
- ReviewersSchema: () => ReviewersSchema
1446915
+ ReviewersSchema: () => ReviewersSchema2
1446891
1446916
  });
1446892
1446917
 
1446893
1446918
  // ../configuration/lib/generators-yml/utils/isApiConfigurationV2Schema.js
@@ -1450241,44 +1450266,117 @@ function convertRawOutputConfig(generator, warnings) {
1450241
1450266
  }
1450242
1450267
  }
1450243
1450268
  if (githubConfig.reviewers != null) {
1450244
- warnings.push({
1450245
- type: "unsupported",
1450246
- message: "GitHub PR reviewers configuration is not supported in fern.yml",
1450247
- suggestion: "Configure reviewers directly in your GitHub repository settings"
1450248
- });
1450269
+ const reviewers = githubConfig.reviewers;
1450270
+ if (reviewers.teams != null || reviewers.users != null) {
1450271
+ output2.git.reviewers = {
1450272
+ teams: reviewers.teams,
1450273
+ users: reviewers.users
1450274
+ };
1450275
+ }
1450249
1450276
  }
1450250
1450277
  }
1450251
1450278
  }
1450252
1450279
  if (generator.output?.location != null) {
1450253
1450280
  const location2 = generator.output.location;
1450281
+ const rawOutput = generator.output;
1450254
1450282
  switch (location2) {
1450255
1450283
  case "local-file-system": {
1450256
- if (generator.output.path != null) {
1450257
- output2.path = generator.output.path;
1450284
+ if (rawOutput.path != null) {
1450285
+ output2.path = rawOutput.path;
1450258
1450286
  }
1450259
1450287
  break;
1450260
1450288
  }
1450261
1450289
  case "npm": {
1450262
- const packageName = generator.output["package-name"];
1450290
+ const packageName = rawOutput["package-name"];
1450263
1450291
  if (typeof packageName === "string") {
1450264
1450292
  publish2 = {
1450265
1450293
  npm: {
1450266
- packageName
1450294
+ packageName,
1450295
+ url: rawOutput["url"],
1450296
+ token: rawOutput["token"]
1450297
+ }
1450298
+ };
1450299
+ }
1450300
+ break;
1450301
+ }
1450302
+ case "pypi": {
1450303
+ const packageName = rawOutput["package-name"];
1450304
+ if (typeof packageName === "string") {
1450305
+ const metadata = rawOutput["metadata"];
1450306
+ publish2 = {
1450307
+ pypi: {
1450308
+ packageName,
1450309
+ url: rawOutput["url"],
1450310
+ token: rawOutput["token"],
1450311
+ username: rawOutput["username"],
1450312
+ password: rawOutput["password"],
1450313
+ metadata: metadata != null ? {
1450314
+ keywords: metadata.keywords,
1450315
+ documentationLink: metadata.documentationLink,
1450316
+ homepageLink: metadata.homepageLink
1450317
+ } : void 0
1450318
+ }
1450319
+ };
1450320
+ }
1450321
+ break;
1450322
+ }
1450323
+ case "maven": {
1450324
+ const coordinate = rawOutput["coordinate"];
1450325
+ if (typeof coordinate === "string") {
1450326
+ const signature = rawOutput["signature"];
1450327
+ publish2 = {
1450328
+ maven: {
1450329
+ coordinate,
1450330
+ url: rawOutput["url"],
1450331
+ username: rawOutput["username"],
1450332
+ password: rawOutput["password"],
1450333
+ signature: signature != null ? {
1450334
+ keyId: signature.keyId,
1450335
+ password: signature.password,
1450336
+ secretKey: signature.secretKey
1450337
+ } : void 0
1450338
+ }
1450339
+ };
1450340
+ }
1450341
+ break;
1450342
+ }
1450343
+ case "nuget": {
1450344
+ const packageName = rawOutput["package-name"];
1450345
+ if (typeof packageName === "string") {
1450346
+ publish2 = {
1450347
+ nuget: {
1450348
+ packageName,
1450349
+ url: rawOutput["url"],
1450350
+ apiKey: rawOutput["api-key"]
1450351
+ }
1450352
+ };
1450353
+ }
1450354
+ break;
1450355
+ }
1450356
+ case "rubygems": {
1450357
+ const packageName = rawOutput["package-name"];
1450358
+ if (typeof packageName === "string") {
1450359
+ publish2 = {
1450360
+ rubygems: {
1450361
+ packageName,
1450362
+ url: rawOutput["url"],
1450363
+ apiKey: rawOutput["api-key"]
1450267
1450364
  }
1450268
1450365
  };
1450269
1450366
  }
1450270
1450367
  break;
1450271
1450368
  }
1450272
- case "pypi":
1450273
- case "maven":
1450274
- case "nuget":
1450275
- case "rubygems":
1450276
1450369
  case "crates": {
1450277
- warnings.push({
1450278
- type: "info",
1450279
- message: `${location2} publishing configuration detected but not fully supported in fern.yml yet`,
1450280
- suggestion: `Configure ${location2} publishing manually`
1450281
- });
1450370
+ const packageName = rawOutput["package-name"];
1450371
+ if (typeof packageName === "string") {
1450372
+ publish2 = {
1450373
+ crates: {
1450374
+ packageName,
1450375
+ url: rawOutput["url"],
1450376
+ token: rawOutput["token"]
1450377
+ }
1450378
+ };
1450379
+ }
1450282
1450380
  break;
1450283
1450381
  }
1450284
1450382
  case "postman": {
@@ -1553889,6 +1553987,7 @@ async function doesPathExist2(filepath) {
1553889
1553987
  }
1553890
1553988
 
1553891
1553989
  // ../../commons/github/lib/cloneRepository.js
1553990
+ var import_child_process3 = require("child_process");
1553892
1553991
  var import_tmp_promise3 = __toESM(require_tmp_promise(), 1);
1553893
1553992
 
1553894
1553993
  // ../../commons/github/lib/parseRepository.js
@@ -1553934,17 +1554033,77 @@ function getCloneUrl({ remote, owner, repo }) {
1553934
1554033
  }
1553935
1554034
 
1553936
1554035
  // ../../commons/github/lib/cloneRepository.js
1554036
+ function sanitizeCloneUrl(url3) {
1554037
+ return url3.replace(/\/\/[^@]+@/, "//[REDACTED]@");
1554038
+ }
1554039
+ function isGitAvailable() {
1554040
+ try {
1554041
+ (0, import_child_process3.execSync)("git --version", { encoding: "utf-8", stdio: "pipe" });
1554042
+ return true;
1554043
+ } catch {
1554044
+ return false;
1554045
+ }
1554046
+ }
1554047
+ function getGitDiagnostics() {
1554048
+ const diagnostics = [];
1554049
+ try {
1554050
+ const whichCommand = process.platform === "win32" ? "where git" : "which git";
1554051
+ const gitPath = (0, import_child_process3.execSync)(`${whichCommand} 2>/dev/null || echo 'not found'`, { encoding: "utf-8" }).trim();
1554052
+ diagnostics.push(`git path: ${gitPath}`);
1554053
+ } catch {
1554054
+ diagnostics.push("git path: unable to determine");
1554055
+ }
1554056
+ try {
1554057
+ const gitVersion = (0, import_child_process3.execSync)("git --version 2>/dev/null || echo 'unknown'", { encoding: "utf-8" }).trim();
1554058
+ diagnostics.push(`version: ${gitVersion}`);
1554059
+ } catch {
1554060
+ diagnostics.push("version: unknown");
1554061
+ }
1554062
+ try {
1554063
+ const isContainer = (0, import_child_process3.execSync)("test -f /.dockerenv && echo 'yes' || echo 'no'", { encoding: "utf-8" }).trim() === "yes";
1554064
+ diagnostics.push(`in container: ${isContainer}`);
1554065
+ } catch {
1554066
+ diagnostics.push("in container: unknown");
1554067
+ }
1554068
+ diagnostics.push(`PATH: ${process.env.PATH ?? "unset"}`);
1554069
+ return diagnostics.join(", ");
1554070
+ }
1553937
1554071
  async function cloneRepository({ githubRepository, installationToken, targetDirectory, timeoutMs }) {
1553938
1554072
  const repositoryReference = parseRepository2(githubRepository);
1553939
1554073
  const cloneUrl = installationToken != null ? repositoryReference.getAuthedCloneUrl(installationToken) : repositoryReference.cloneUrl;
1553940
1554074
  const clonePath = targetDirectory ?? (await import_tmp_promise3.default.dir()).path;
1554075
+ const sanitizedUrl = sanitizeCloneUrl(cloneUrl);
1554076
+ if (!isGitAvailable()) {
1554077
+ const diagnostics = getGitDiagnostics();
1554078
+ throw new Error(`Git is not installed or not found in PATH. Self-hosted GitHub mode requires git to be installed on the host machine where the Fern CLI runs. Please install git and ensure it is available in your PATH. Repository: ${githubRepository}. Debug info: ${diagnostics}`);
1554079
+ }
1553941
1554080
  const git = esm_default3(clonePath, {
1553942
1554081
  timeout: timeoutMs != null ? {
1553943
1554082
  block: timeoutMs
1553944
1554083
  // Kill the process if no data is received for the specified time
1553945
1554084
  } : void 0
1553946
1554085
  });
1553947
- await git.clone(cloneUrl, ".");
1554086
+ const startTime = Date.now();
1554087
+ try {
1554088
+ await git.clone(cloneUrl, ".");
1554089
+ } catch (error49) {
1554090
+ const elapsed = Date.now() - startTime;
1554091
+ const errorMessage = error49 instanceof Error ? error49.message : String(error49);
1554092
+ if (errorMessage.includes("ENOENT") || errorMessage.includes("spawn git")) {
1554093
+ const diagnostics = getGitDiagnostics();
1554094
+ throw new Error(`Failed to clone repository: git command not found. Self-hosted GitHub mode requires git to be installed on the host machine where the Fern CLI runs. URL: ${sanitizedUrl}. Elapsed: ${elapsed}ms. Debug info: ${diagnostics}. Original error: ${errorMessage}`);
1554095
+ }
1554096
+ if (errorMessage.includes("Authentication failed") || errorMessage.includes("could not read Username") || errorMessage.includes("401") || errorMessage.includes("403")) {
1554097
+ throw new Error(`Failed to clone repository: authentication failed. Ensure your GitHub token is set and has access to the repository. URL: ${sanitizedUrl}. Elapsed: ${elapsed}ms. Original error: ${errorMessage}`);
1554098
+ }
1554099
+ if (errorMessage.includes("Repository not found") || errorMessage.includes("not found") || errorMessage.includes("404")) {
1554100
+ throw new Error(`Failed to clone repository: repository not found. Check that ${githubRepository} exists and your token has access. URL: ${sanitizedUrl}. Elapsed: ${elapsed}ms. Original error: ${errorMessage}`);
1554101
+ }
1554102
+ if (errorMessage.includes("Connection refused") || errorMessage.includes("Connection timed out") || errorMessage.includes("Could not resolve host") || errorMessage.includes("unable to access")) {
1554103
+ throw new Error(`Failed to clone repository: network error. Check network connectivity and proxy settings. URL: ${sanitizedUrl}. Elapsed: ${elapsed}ms. Original error: ${errorMessage}`);
1554104
+ }
1554105
+ throw new Error(`Failed to clone repository ${githubRepository}. URL: ${sanitizedUrl}. Elapsed: ${elapsed}ms. Original error: ${errorMessage}`);
1554106
+ }
1553948
1554107
  return new ClonedRepository({
1553949
1554108
  clonePath,
1553950
1554109
  git
@@ -1609933,7 +1610092,10 @@ function convertTypeShape4(irType) {
1609933
1610092
  description: variant.docs ?? void 0,
1609934
1610093
  type: convertTypeReference12(variant.type),
1609935
1610094
  availability: void 0,
1609936
- displayName: variant.type.type === "named" ? variant.type.displayName ?? variant.type.name.originalName : void 0
1610095
+ // If displayName is not specified, don't fall back to originalName
1610096
+ // originalName may contain generated names (e.g., "ObjectsObjectTypeBatchUpsertPostRequestBody...")
1610097
+ // which are not user-friendly and should not be user-facing
1610098
+ displayName: variant.type.type === "named" ? variant.type.displayName : void 0
1609937
1610099
  };
1609938
1610100
  })
1609939
1610101
  };
@@ -1663846,6 +1664008,19 @@ generators:
1663846
1664008
  if (selfhostedGithubConfig != null) {
1663847
1664009
  await fs20.rm(absolutePathToLocalOutput, { recursive: true, force: true });
1663848
1664010
  await fs20.mkdir(absolutePathToLocalOutput, { recursive: true });
1664011
+ interactiveTaskContext.logger.debug(`Self-hosted GitHub mode: cloning ${selfhostedGithubConfig.uri} to ${absolutePathToLocalOutput}`);
1664012
+ try {
1664013
+ const { execSync: execSync3 } = await import("child_process");
1664014
+ const gitPath = execSync3("which git 2>/dev/null || echo 'not found'", {
1664015
+ encoding: "utf-8"
1664016
+ }).trim();
1664017
+ const gitVersion = execSync3("git --version 2>/dev/null || echo 'unknown'", {
1664018
+ encoding: "utf-8"
1664019
+ }).trim();
1664020
+ interactiveTaskContext.logger.debug(`Git environment: path=${gitPath}, version=${gitVersion}, PATH=${process.env.PATH ?? "unset"}`);
1664021
+ } catch {
1664022
+ interactiveTaskContext.logger.debug(`Git environment: unable to determine git info, PATH=${process.env.PATH ?? "unset"}`);
1664023
+ }
1663849
1664024
  try {
1663850
1664025
  const repo = await cloneRepository({
1663851
1664026
  githubRepository: selfhostedGithubConfig.uri,
@@ -1664777,22 +1664952,25 @@ var LegacyGeneratorInvocationAdapter = class {
1664777
1664952
  const git = target.output.git;
1664778
1664953
  const repository = parseRepository2(git.repository);
1664779
1664954
  const license = git.license != null ? await this.convertLicense(git.license) : void 0;
1664780
- switch (git.mode) {
1664955
+ const publishInfo = target.publish != null ? this.buildPublishInfo(target.publish) : void 0;
1664956
+ const reviewers = this.buildReviewers(git.reviewers);
1664957
+ const mode = git.mode ?? "pr";
1664958
+ switch (mode) {
1664781
1664959
  case "pr":
1664782
1664960
  return import_fiddle_sdk6.FernFiddle.remoteGen.OutputMode.githubV2(import_fiddle_sdk6.FernFiddle.GithubOutputModeV2.pullRequest({
1664783
1664961
  owner: repository.owner,
1664784
1664962
  repo: repository.repo,
1664785
1664963
  license,
1664786
- publishInfo: void 0,
1664787
- downloadSnippets: void 0,
1664788
- reviewers: void 0
1664964
+ publishInfo,
1664965
+ reviewers,
1664966
+ downloadSnippets: void 0
1664789
1664967
  }));
1664790
1664968
  case "release":
1664791
1664969
  return import_fiddle_sdk6.FernFiddle.remoteGen.OutputMode.githubV2(import_fiddle_sdk6.FernFiddle.GithubOutputModeV2.commitAndRelease({
1664792
1664970
  owner: repository.owner,
1664793
1664971
  repo: repository.repo,
1664794
1664972
  license,
1664795
- publishInfo: void 0,
1664973
+ publishInfo,
1664796
1664974
  downloadSnippets: void 0
1664797
1664975
  }));
1664798
1664976
  case "push":
@@ -1664801,36 +1664979,122 @@ var LegacyGeneratorInvocationAdapter = class {
1664801
1664979
  repo: repository.repo,
1664802
1664980
  branch: git.branch,
1664803
1664981
  license,
1664804
- publishInfo: void 0,
1664982
+ publishInfo,
1664805
1664983
  downloadSnippets: void 0
1664806
1664984
  }));
1664807
1664985
  default:
1664808
- assertNever(git.mode);
1664986
+ assertNever(mode);
1664809
1664987
  }
1664810
1664988
  }
1664811
1664989
  return import_fiddle_sdk6.FernFiddle.remoteGen.OutputMode.downloadFiles({});
1664812
1664990
  }
1664813
- async convertLicense(license) {
1664814
- switch (license.type) {
1664815
- case "MIT":
1664816
- return import_fiddle_sdk6.FernFiddle.GithubLicense.basic({
1664817
- id: import_fiddle_sdk6.FernFiddle.GithubLicenseId.Mit
1664818
- });
1664819
- case "Apache-2.0":
1664820
- return import_fiddle_sdk6.FernFiddle.GithubLicense.basic({
1664821
- id: import_fiddle_sdk6.FernFiddle.GithubLicenseId.Apache
1664822
- });
1664823
- case "custom": {
1664824
- const absolutePath = join4(this.context.cwd, RelativeFilePath2.of(license.path));
1664825
- if (!await doesPathExist(absolutePath, "file")) {
1664826
- throw new Error(`Custom license file "${absolutePath}" does not exist; did you mean to use either MIT or Apache-2.0?`);
1664827
- }
1664828
- const contents = await (0, import_promises68.readFile)(absolutePath, "utf-8");
1664829
- return import_fiddle_sdk6.FernFiddle.GithubLicense.custom({ contents });
1664991
+ buildPublishInfo(publish2) {
1664992
+ if (publish2.npm != null) {
1664993
+ return this.buildNpmPublishInfo(publish2.npm);
1664994
+ }
1664995
+ if (publish2.pypi != null) {
1664996
+ return this.buildPypiPublishInfo(publish2.pypi);
1664997
+ }
1664998
+ if (publish2.maven != null) {
1664999
+ return this.buildMavenPublishInfo(publish2.maven);
1665000
+ }
1665001
+ if (publish2.nuget != null) {
1665002
+ return this.buildNugetPublishInfo(publish2.nuget);
1665003
+ }
1665004
+ if (publish2.rubygems != null) {
1665005
+ return this.buildRubygemsPublishInfo(publish2.rubygems);
1665006
+ }
1665007
+ if (publish2.crates != null) {
1665008
+ return this.buildCratesPublishInfo(publish2.crates);
1665009
+ }
1665010
+ return void 0;
1665011
+ }
1665012
+ buildNpmPublishInfo(npm) {
1665013
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.npm({
1665014
+ registryUrl: npm.url ?? "https://registry.npmjs.org",
1665015
+ packageName: npm.packageName,
1665016
+ token: npm.token
1665017
+ });
1665018
+ }
1665019
+ buildPypiPublishInfo(pypi) {
1665020
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.pypi({
1665021
+ registryUrl: pypi.url ?? "https://upload.pypi.org/legacy/",
1665022
+ packageName: pypi.packageName,
1665023
+ credentials: pypi.token != null ? { username: "__token__", password: pypi.token } : pypi.username != null && pypi.password != null ? { username: pypi.username, password: pypi.password } : void 0,
1665024
+ pypiMetadata: pypi.metadata != null ? {
1665025
+ keywords: pypi.metadata.keywords,
1665026
+ documentationLink: pypi.metadata.documentationLink,
1665027
+ homepageLink: pypi.metadata.homepageLink
1665028
+ } : void 0
1665029
+ });
1665030
+ }
1665031
+ buildMavenPublishInfo(maven) {
1665032
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.maven({
1665033
+ registryUrl: maven.url ?? "https://s01.oss.sonatype.org/content/repositories/releases/",
1665034
+ coordinate: maven.coordinate,
1665035
+ credentials: maven.username != null && maven.password != null ? { username: maven.username, password: maven.password } : void 0,
1665036
+ signature: maven.signature != null ? {
1665037
+ keyId: maven.signature.keyId,
1665038
+ password: maven.signature.password,
1665039
+ secretKey: maven.signature.secretKey
1665040
+ } : void 0
1665041
+ });
1665042
+ }
1665043
+ buildNugetPublishInfo(nuget) {
1665044
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.nuget({
1665045
+ registryUrl: nuget.url ?? "https://nuget.org/",
1665046
+ packageName: nuget.packageName,
1665047
+ apiKey: nuget.apiKey
1665048
+ });
1665049
+ }
1665050
+ buildRubygemsPublishInfo(rubygems) {
1665051
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.rubygems({
1665052
+ registryUrl: rubygems.url ?? "https://rubygems.org/",
1665053
+ packageName: rubygems.packageName,
1665054
+ apiKey: rubygems.apiKey
1665055
+ });
1665056
+ }
1665057
+ buildCratesPublishInfo(crates) {
1665058
+ return import_fiddle_sdk6.FernFiddle.GithubPublishInfo.crates({
1665059
+ registryUrl: crates.url ?? "https://crates.io/api/v1/crates",
1665060
+ packageName: crates.packageName,
1665061
+ token: crates.token
1665062
+ });
1665063
+ }
1665064
+ buildReviewers(reviewers) {
1665065
+ if (reviewers == null) {
1665066
+ return void 0;
1665067
+ }
1665068
+ const result = [];
1665069
+ if (reviewers.teams != null) {
1665070
+ for (const team of reviewers.teams) {
1665071
+ result.push(import_fiddle_sdk6.FernFiddle.GithubPullRequestReviewer.team({ name: team }));
1664830
1665072
  }
1664831
- default:
1664832
- assertNever(license);
1664833
1665073
  }
1665074
+ if (reviewers.users != null) {
1665075
+ for (const user of reviewers.users) {
1665076
+ result.push(import_fiddle_sdk6.FernFiddle.GithubPullRequestReviewer.user({ name: user }));
1665077
+ }
1665078
+ }
1665079
+ return result.length > 0 ? result : void 0;
1665080
+ }
1665081
+ async convertLicense(license) {
1665082
+ if (license === "MIT") {
1665083
+ return import_fiddle_sdk6.FernFiddle.GithubLicense.basic({
1665084
+ id: import_fiddle_sdk6.FernFiddle.GithubLicenseId.Mit
1665085
+ });
1665086
+ }
1665087
+ if (license === "Apache-2.0") {
1665088
+ return import_fiddle_sdk6.FernFiddle.GithubLicense.basic({
1665089
+ id: import_fiddle_sdk6.FernFiddle.GithubLicenseId.Apache
1665090
+ });
1665091
+ }
1665092
+ const absolutePath = join4(this.context.cwd, RelativeFilePath2.of(license));
1665093
+ if (!await doesPathExist(absolutePath, "file")) {
1665094
+ throw new Error(`Custom license file "${absolutePath}" does not exist; did you mean to use either MIT or Apache-2.0?`);
1665095
+ }
1665096
+ const contents = await (0, import_promises68.readFile)(absolutePath, "utf-8");
1665097
+ return import_fiddle_sdk6.FernFiddle.GithubLicense.custom({ contents });
1664834
1665098
  }
1664835
1665099
  mapLanguage(lang) {
1664836
1665100
  const languageMap = {
@@ -1665844,9 +1666108,10 @@ var SdkConfigConverter = class {
1665844
1666108
  version: generatorInfo.version,
1665845
1666109
  api: this.resolveApi({ api: target.api }),
1665846
1666110
  config: target.config != null ? this.convertConfig(target.config) : void 0,
1665847
- output: this.convertOutput({ output: target.output, sourced: sourced.output }),
1665848
- publish: target.publish != null && !isNullish(sourced.publish) ? this.convertPublish({ publish: target.publish, sourced: sourced.publish }) : void 0,
1665849
- groups: target.group ?? []
1666111
+ output: target.output,
1666112
+ publish: target.publish,
1666113
+ groups: target.group ?? [],
1666114
+ metadata: target.metadata
1665850
1666115
  };
1665851
1666116
  }
1665852
1666117
  resolveApi({ api }) {
@@ -1665867,36 +1666132,6 @@ var SdkConfigConverter = class {
1665867
1666132
  convertConfig(config3) {
1665868
1666133
  return config3;
1665869
1666134
  }
1665870
- convertOutput({ output: output2, sourced }) {
1665871
- return {
1665872
- path: output2.path,
1665873
- git: output2.git != null && !isNullish(sourced.git) ? this.convertGit({ git: output2.git, sourced: sourced.git }) : void 0
1665874
- };
1665875
- }
1665876
- convertGit({ git, sourced: _sourced }) {
1665877
- return {
1665878
- repository: git.repository,
1665879
- mode: git.mode ?? "pr",
1665880
- branch: git.branch,
1665881
- license: git.license != null ? this.convertLicense(git.license) : void 0
1665882
- };
1665883
- }
1665884
- convertLicense(license) {
1665885
- if (schemas_exports4.isWellKnownLicense(license)) {
1665886
- return { type: license };
1665887
- }
1665888
- return { type: "custom", path: license };
1665889
- }
1665890
- convertPublish({ publish: publish2, sourced }) {
1665891
- return {
1665892
- npm: publish2.npm != null && !isNullish(sourced.npm) ? this.convertNpm({ npm: publish2.npm, sourced: sourced.npm }) : void 0
1665893
- };
1665894
- }
1665895
- convertNpm({ npm, sourced: _sourced }) {
1665896
- return {
1665897
- packageName: npm.packageName
1665898
- };
1665899
- }
1665900
1666135
  resolveLanguage({ name: name3, target, sourced }) {
1665901
1666136
  if (target.lang != null) {
1665902
1666137
  return target.lang;
@@ -1666056,10 +1666291,10 @@ function addGenerateCommand(cli) {
1666056
1666291
  }).option("group", {
1666057
1666292
  type: "string",
1666058
1666293
  description: "The SDK group to generate"
1666059
- }).option("audiences", {
1666294
+ }).option("audience", {
1666060
1666295
  type: "array",
1666061
1666296
  string: true,
1666062
- description: "Filter the target API(s) with the given audiences"
1666297
+ description: "Filter the target API(s) with the given audience(s)"
1666063
1666298
  }).option("local", {
1666064
1666299
  type: "boolean",
1666065
1666300
  default: false,
@@ -1666151,7 +1666386,7 @@ async function handleGenerate(context2, args) {
1666151
1666386
  task,
1666152
1666387
  target,
1666153
1666388
  apiDefinition,
1666154
- audiences: parseAudiences2(args.audiences),
1666389
+ audiences: parseAudiences2(args.audience),
1666155
1666390
  runtime,
1666156
1666391
  containerEngine: args["container-engine"] ?? "docker",
1666157
1666392
  keepContainer: args["keep-container"] ?? false,
@@ -1666228,6 +1666463,9 @@ function validateArgs(args) {
1666228
1666463
  if (args.group != null && args.target != null) {
1666229
1666464
  throw new Error("The --group and --target flags cannot be used together");
1666230
1666465
  }
1666466
+ if (args.group == null && args.target == null) {
1666467
+ throw new Error("A --target or --group must be specified");
1666468
+ }
1666231
1666469
  }
1666232
1666470
  function maybePluralSdks(targets2) {
1666233
1666471
  return targets2.length === 1 ? "SDK" : "SDKs";
@@ -1667998,7 +1668236,7 @@ var import_yoctocolors_cjs11 = __toESM(require_yoctocolors_cjs(), 1);
1667998
1668236
 
1667999
1668237
  // ../../../node_modules/.pnpm/@inquirer+external-editor@1.0.3_@types+node@18.15.3/node_modules/@inquirer/external-editor/dist/esm/index.js
1668000
1668238
  var import_chardet = __toESM(require_lib11(), 1);
1668001
- var import_child_process3 = require("child_process");
1668239
+ var import_child_process4 = require("child_process");
1668002
1668240
  var import_fs20 = require("fs");
1668003
1668241
  var import_node_path16 = __toESM(require("path"), 1);
1668004
1668242
  var import_node_os2 = __toESM(require("os"), 1);
@@ -1668176,7 +1668414,7 @@ var ExternalEditor = class {
1668176
1668414
  }
1668177
1668415
  launchEditor() {
1668178
1668416
  try {
1668179
- const editorProcess = (0, import_child_process3.spawnSync)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
1668417
+ const editorProcess = (0, import_child_process4.spawnSync)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
1668180
1668418
  this.lastExitStatus = editorProcess.status ?? 0;
1668181
1668419
  } catch (launchError) {
1668182
1668420
  throw new LaunchEditorError(launchError);
@@ -1668184,7 +1668422,7 @@ var ExternalEditor = class {
1668184
1668422
  }
1668185
1668423
  launchEditorAsync(callback) {
1668186
1668424
  try {
1668187
- const editorProcess = (0, import_child_process3.spawn)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
1668425
+ const editorProcess = (0, import_child_process4.spawn)(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
1668188
1668426
  editorProcess.on("exit", (code6) => {
1668189
1668427
  this.lastExitStatus = code6;
1668190
1668428
  setImmediate(callback);
@@ -1672396,7 +1672634,7 @@ var AccessTokenPosthogManager = class {
1672396
1672634
  properties: {
1672397
1672635
  ...event,
1672398
1672636
  ...event.properties,
1672399
- version: "3.56.8",
1672637
+ version: "3.56.10",
1672400
1672638
  usingAccessToken: true
1672401
1672639
  }
1672402
1672640
  });
@@ -1672446,7 +1672684,7 @@ var UserPosthogManager = class {
1672446
1672684
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1672447
1672685
  event: "CLI",
1672448
1672686
  properties: {
1672449
- version: "3.56.8",
1672687
+ version: "3.56.10",
1672450
1672688
  ...event,
1672451
1672689
  ...event.properties,
1672452
1672690
  usingAccessToken: false,
@@ -1704368,7 +1704606,7 @@ var CliContext = class {
1704368
1704606
  if (false) {
1704369
1704607
  this.logger.error("CLI_VERSION is not defined");
1704370
1704608
  }
1704371
- return "3.56.8";
1704609
+ return "3.56.10";
1704372
1704610
  }
1704373
1704611
  getCliName() {
1704374
1704612
  if (false) {
@@ -1707482,7 +1707720,7 @@ var import_path54 = __toESM(require("path"), 1);
1707482
1707720
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1707483
1707721
  var LOGS_FOLDER_NAME = "logs";
1707484
1707722
  function getCliSource() {
1707485
- const version7 = "3.56.8";
1707723
+ const version7 = "3.56.10";
1707486
1707724
  return `cli@${version7}`;
1707487
1707725
  }
1707488
1707726
  var DebugLogger = class {
@@ -1734830,9 +1735068,9 @@ function getAIEnhancerConfig2() {
1734830
1735068
  }
1734831
1735069
 
1734832
1735070
  // src/commands/sdk-diff/sdkDiffCommand.ts
1734833
- var import_child_process4 = require("child_process");
1735071
+ var import_child_process5 = require("child_process");
1734834
1735072
  var import_util64 = require("util");
1734835
- var execAsync = (0, import_util64.promisify)(import_child_process4.exec);
1735073
+ var execAsync = (0, import_util64.promisify)(import_child_process5.exec);
1734836
1735074
  async function getClientRegistry(context2, project) {
1734837
1735075
  const workspace = project.apiWorkspaces[0];
1734838
1735076
  if (workspace == null) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.56.8",
2
+ "version": "3.56.10",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",