@fern-api/fern-api-dev 5.89.4 → 5.89.5

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 +207 -25
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -100959,8 +100959,8 @@ var require_graceful_fs = __commonJS({
100959
100959
  }
100960
100960
  }
100961
100961
  var fs$writeFile = fs35.writeFile;
100962
- fs35.writeFile = writeFile102;
100963
- function writeFile102(path120, data2, options2, cb) {
100962
+ fs35.writeFile = writeFile103;
100963
+ function writeFile103(path120, data2, options2, cb) {
100964
100964
  if (typeof options2 === "function")
100965
100965
  cb = options2, options2 = null;
100966
100966
  return go$writeFile(path120, data2, options2, cb);
@@ -460369,13 +460369,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
460369
460369
  }
460370
460370
  }
460371
460371
  }
460372
- const { writeFile: writeFile102 } = await import("fs/promises");
460372
+ const { writeFile: writeFile103 } = await import("fs/promises");
460373
460373
  const yamlContent = index_vite_proxy_tmp_default.dump(parsed, {
460374
460374
  indent: 2,
460375
460375
  lineWidth: -1,
460376
460376
  noRefs: true
460377
460377
  });
460378
- await writeFile102(overrideFilePath, yamlContent, "utf-8");
460378
+ await writeFile103(overrideFilePath, yamlContent, "utf-8");
460379
460379
  context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
460380
460380
  return {
460381
460381
  removedCount: validationResult.invalidCount,
@@ -483704,8 +483704,8 @@ var require_graceful_fs2 = __commonJS({
483704
483704
  }
483705
483705
  }
483706
483706
  var fs$writeFile = fs35.writeFile;
483707
- fs35.writeFile = writeFile102;
483708
- function writeFile102(path120, data2, options2, cb) {
483707
+ fs35.writeFile = writeFile103;
483708
+ function writeFile103(path120, data2, options2, cb) {
483709
483709
  if (typeof options2 === "function")
483710
483710
  cb = options2, options2 = null;
483711
483711
  return go$writeFile(path120, data2, options2, cb);
@@ -626889,7 +626889,7 @@ var require_jsonfile = __commonJS({
626889
626889
  const str2 = stringify5(obj, options2);
626890
626890
  await universalify.fromCallback(fs34.writeFile)(file4, str2, options2);
626891
626891
  }
626892
- var writeFile102 = universalify.fromPromise(_writeFile);
626892
+ var writeFile103 = universalify.fromPromise(_writeFile);
626893
626893
  function writeFileSync9(file4, obj, options2 = {}) {
626894
626894
  const fs34 = options2.fs || _fs;
626895
626895
  const str2 = stringify5(obj, options2);
@@ -626898,7 +626898,7 @@ var require_jsonfile = __commonJS({
626898
626898
  module4.exports = {
626899
626899
  readFile: readFile121,
626900
626900
  readFileSync: readFileSync19,
626901
- writeFile: writeFile102,
626901
+ writeFile: writeFile103,
626902
626902
  writeFileSync: writeFileSync9
626903
626903
  };
626904
626904
  }
@@ -694418,7 +694418,7 @@ var AccessTokenPosthogManager = class {
694418
694418
  properties: {
694419
694419
  ...event,
694420
694420
  ...event.properties,
694421
- version: "5.89.4",
694421
+ version: "5.89.5",
694422
694422
  usingAccessToken: true,
694423
694423
  ...getRunIdProperties()
694424
694424
  }
@@ -694484,7 +694484,7 @@ var UserPosthogManager = class {
694484
694484
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
694485
694485
  event: "CLI",
694486
694486
  properties: {
694487
- version: "5.89.4",
694487
+ version: "5.89.5",
694488
694488
  ...event,
694489
694489
  ...event.properties,
694490
694490
  usingAccessToken: false,
@@ -875614,7 +875614,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
875614
875614
  var LOGS_FOLDER_NAME = "logs";
875615
875615
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
875616
875616
  function getCliSource() {
875617
- const version7 = "5.89.4";
875617
+ const version7 = "5.89.5";
875618
875618
  return `cli@${version7}`;
875619
875619
  }
875620
875620
  var DebugLogger = class {
@@ -908324,7 +908324,7 @@ var LegacyDocsPublisher = class {
908324
908324
  previewId,
908325
908325
  disableTemplates: void 0,
908326
908326
  skipUpload,
908327
- cliVersion: "5.89.4",
908327
+ cliVersion: "5.89.5",
908328
908328
  loginCommand: "fern auth login"
908329
908329
  });
908330
908330
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -928060,6 +928060,8 @@ var Generation = class {
928060
928060
  omitFernHeaders: () => this.customConfig["omit-fern-headers"] ?? false,
928061
928061
  /** When true, emits the platform observability headers (X-Fern-Runtime, X-Fern-Runtime-Version, X-Fern-Platform). Default: false. Still subject to omitFernHeaders. */
928062
928062
  includePlatformHeaders: () => this.customConfig["include-platform-headers"] ?? false,
928063
+ /** When true, exposes an `AppInfo` client option whose sanitized product token is appended to the `User-Agent` header (RFC 9110). Default: false. Independent of includePlatformHeaders; still subject to omitFernHeaders. */
928064
+ allowUserAgentAppInfo: () => this.customConfig["allow-user-agent-app-info"] ?? false,
928063
928065
  /** When true, falls back to `<NuGetPackageId>/<version>` for the `User-Agent` header when the IR doesn't supply one. Default: false. */
928064
928066
  userAgentNameFromPackage: () => this.customConfig["user-agent-name-from-package"] ?? false,
928065
928067
  /** When true, moves auth params and IR headers into ClientOptions so the constructor takes only named arguments. Default: false. */
@@ -928348,6 +928350,14 @@ var Generation = class {
928348
928350
  origin: this.model.staticExplicit("ClientOptions"),
928349
928351
  namespace: this.namespaces.publicCoreClasses
928350
928352
  }),
928353
+ /**
928354
+ * Optional application-info product token appended to the `User-Agent`
928355
+ * header. Only generated when the `allow-user-agent-app-info` config is on.
928356
+ */
928357
+ AppInfo: () => this.csharp.classReference({
928358
+ origin: this.model.staticExplicit("AppInfo"),
928359
+ namespace: this.namespaces.publicCoreClasses
928360
+ }),
928351
928361
  /** Low-level HTTP client wrapper for making raw API calls */
928352
928362
  RawClient: () => this.csharp.classReference({
928353
928363
  namespace: this.namespaces.core,
@@ -958858,6 +958868,10 @@ var TypescriptCustomConfigSchema = external_exports2.strictObject({
958858
958868
  serdeLayer: external_exports2.optional(external_exports2.boolean()),
958859
958869
  private: external_exports2.optional(external_exports2.boolean()),
958860
958870
  requireDefaultEnvironment: external_exports2.optional(external_exports2.boolean()),
958871
+ // When true, the client's `baseUrl` option becomes required and the `environment`
958872
+ // option becomes optional. Intended for APIs whose consumers always supply a URL
958873
+ // explicitly and have no concept of named environments.
958874
+ requireBaseUrl: external_exports2.optional(external_exports2.boolean()),
958861
958875
  retainOriginalCasing: external_exports2.optional(external_exports2.boolean()),
958862
958876
  useBigInt: external_exports2.optional(external_exports2.boolean()),
958863
958877
  useBrandedStringAliases: external_exports2.optional(external_exports2.boolean()),
@@ -975200,7 +975214,7 @@ function getAutomationContextFromEnv() {
975200
975214
  config_branch: process.env.FERN_CONFIG_BRANCH,
975201
975215
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
975202
975216
  trigger: process.env.GITHUB_EVENT_NAME,
975203
- cli_version: "5.89.4"
975217
+ cli_version: "5.89.5"
975204
975218
  };
975205
975219
  }
975206
975220
  function isAutomationMode() {
@@ -976032,7 +976046,7 @@ var CliContext = class _CliContext {
976032
976046
  if (false) {
976033
976047
  this.logger.error("CLI_VERSION is not defined");
976034
976048
  }
976035
- return "5.89.4";
976049
+ return "5.89.5";
976036
976050
  }
976037
976051
  getCliName() {
976038
976052
  if (false) {
@@ -977844,7 +977858,8 @@ async function packLocalOutputForGroup({
977844
977858
  context: context3,
977845
977859
  mode = "host",
977846
977860
  runner,
977847
- packOnly = false
977861
+ packOnly = false,
977862
+ version: version7
977848
977863
  }) {
977849
977864
  const failures = [];
977850
977865
  for (const generator of group.generators) {
@@ -977866,7 +977881,8 @@ async function packLocalOutputForGroup({
977866
977881
  outputPath,
977867
977882
  context: context3,
977868
977883
  mode,
977869
- runner: runner ?? "docker"
977884
+ runner: runner ?? "docker",
977885
+ version: version7
977870
977886
  });
977871
977887
  if (packOnly) {
977872
977888
  if (artifactProduced) {
@@ -977893,7 +977909,8 @@ async function packOutputForLanguage({
977893
977909
  outputPath,
977894
977910
  context: context3,
977895
977911
  mode,
977896
- runner
977912
+ runner,
977913
+ version: version7
977897
977914
  }) {
977898
977915
  const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
977899
977916
  const run = async (commands) => {
@@ -977902,26 +977919,103 @@ async function packOutputForLanguage({
977902
977919
  switch (language) {
977903
977920
  case "typescript": {
977904
977921
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977905
- const commands = [["npm", "install"]];
977922
+ await run([["npm", "install"]]);
977906
977923
  if (await hasNpmScript({ outputPath, script: "build" })) {
977907
- commands.push(["npm", "run", "build"]);
977924
+ await run([["npx", "--yes", "pnpm", "run", "build"]]);
977925
+ } else {
977926
+ const tsconfig = await findTsconfig(outputPath);
977927
+ if (tsconfig != null) {
977928
+ try {
977929
+ await run([["npx", "--yes", "--package", "typescript", "tsc", "--project", tsconfig]]);
977930
+ } catch (error50) {
977931
+ if (!await hasEmittedCompilerOutput({ outputPath, tsconfig })) {
977932
+ throw error50;
977933
+ }
977934
+ context3.logger.warn(
977935
+ `tsc reported errors while compiling ${tsconfig}; packing the emitted output anyway.`
977936
+ );
977937
+ }
977938
+ }
977939
+ }
977940
+ const npmignorePath = join8(outputPath, RelativeFilePath2.of(".npmignore"));
977941
+ const shouldWriteNpmignore = !await doesPathExist(npmignorePath) && !await hasPackageJsonFilesField(outputPath) && await doesPathExist(join8(outputPath, RelativeFilePath2.of(".gitignore")));
977942
+ if (shouldWriteNpmignore) {
977943
+ await (0, import_promises168.writeFile)(npmignorePath, `${PACK_OUTPUT_DIRECTORY}/
977944
+ `);
977945
+ }
977946
+ try {
977947
+ await run([["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]]);
977948
+ } finally {
977949
+ if (shouldWriteNpmignore) {
977950
+ await (0, import_promises168.rm)(npmignorePath, { force: true });
977951
+ }
977908
977952
  }
977909
- commands.push(["npm", "pack", "--pack-destination", PACK_OUTPUT_DIRECTORY]);
977910
- await run(commands);
977911
977953
  logArtifacts({ distDir, context: context3 });
977912
977954
  return true;
977913
977955
  }
977914
977956
  case "python": {
977915
977957
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977916
- await run([["python3", "-m", "pip", "wheel", ".", "--no-deps", "--wheel-dir", PACK_OUTPUT_DIRECTORY]]);
977958
+ const pipWheelCommand = [
977959
+ "python3",
977960
+ "-m",
977961
+ "pip",
977962
+ "wheel",
977963
+ ".",
977964
+ "--no-deps",
977965
+ "--wheel-dir",
977966
+ PACK_OUTPUT_DIRECTORY
977967
+ ];
977968
+ if (mode === "host") {
977969
+ try {
977970
+ await run([pipWheelCommand]);
977971
+ } catch {
977972
+ context3.logger.warn(
977973
+ "pip wheel failed on the host toolchain; retrying in an isolated build environment (python -m venv + python -m build)."
977974
+ );
977975
+ const venvDirectory = ".fern-pack-venv";
977976
+ const venvPython = process.platform === "win32" ? `${venvDirectory}/Scripts/python` : `${venvDirectory}/bin/python`;
977977
+ try {
977978
+ await run([
977979
+ ["python3", "-m", "venv", venvDirectory],
977980
+ [venvPython, "-m", "pip", "install", "--quiet", "build"],
977981
+ [venvPython, "-m", "build", "--wheel", "--outdir", PACK_OUTPUT_DIRECTORY]
977982
+ ]);
977983
+ } finally {
977984
+ await (0, import_promises168.rm)(join8(outputPath, RelativeFilePath2.of(venvDirectory)), {
977985
+ recursive: true,
977986
+ force: true
977987
+ });
977988
+ }
977989
+ }
977990
+ } else {
977991
+ await run([pipWheelCommand]);
977992
+ }
977917
977993
  logArtifacts({ distDir, context: context3 });
977918
977994
  return true;
977919
977995
  }
977920
977996
  case "java": {
977921
977997
  await (0, import_promises168.mkdir)(distDir, { recursive: true });
977922
- await run([["gradle", "jar", "-x", "test"]]);
977998
+ const initScriptName = ".fern-pack-pom-init.gradle";
977999
+ const initScriptPath = join8(outputPath, RelativeFilePath2.of(initScriptName));
978000
+ await (0, import_promises168.writeFile)(initScriptPath, getJavaPomInitScript({ fallbackVersion: version7 ?? "0.0.0" }));
978001
+ try {
978002
+ await run([
978003
+ [
978004
+ "gradle",
978005
+ "--init-script",
978006
+ initScriptName,
978007
+ "jar",
978008
+ `generatePomFileFor${JAVA_POM_PUBLICATION_NAME_CAPITALIZED}Publication`,
978009
+ "-x",
978010
+ "test"
978011
+ ]
978012
+ ]);
978013
+ } finally {
978014
+ await (0, import_promises168.rm)(initScriptPath, { force: true });
978015
+ }
977923
978016
  const libsDir = join8(outputPath, RelativeFilePath2.of("build/libs"));
977924
978017
  await copyMatchingFiles({ fromDir: libsDir, toDir: distDir, extension: ".jar" });
978018
+ await copyGeneratedPom({ outputPath, distDir, context: context3 });
977925
978019
  logArtifacts({ distDir, context: context3 });
977926
978020
  return true;
977927
978021
  }
@@ -978003,7 +978097,8 @@ async function runPackCommands({
978003
978097
  if (image3 == null) {
978004
978098
  throw new Error(`No Docker toolchain image is configured for ${language}.`);
978005
978099
  }
978006
- const containerArgs = ["run", "--rm", "-v", `${outputPath}:/workspace`, "-w", "/workspace", "-e", "HOME=/tmp"];
978100
+ const workdir = `/workspace/${(0, import_path110.basename)(outputPath)}`;
978101
+ const containerArgs = ["run", "--rm", "-v", `${outputPath}:${workdir}`, "-w", workdir, "-e", "HOME=/tmp"];
978007
978102
  if (process.getuid != null && process.getgid != null) {
978008
978103
  containerArgs.push("--user", `${process.getuid()}:${process.getgid()}`);
978009
978104
  }
@@ -978069,6 +978164,86 @@ async function removeDistDirIfEmpty(outputPath) {
978069
978164
  } catch {
978070
978165
  }
978071
978166
  }
978167
+ var JAVA_POM_PUBLICATION_NAME = "fernLocalPack";
978168
+ var JAVA_POM_PUBLICATION_NAME_CAPITALIZED = "FernLocalPack";
978169
+ function getJavaPomInitScript({ fallbackVersion }) {
978170
+ return `allprojects { project ->
978171
+ project.plugins.withId("java") {
978172
+ project.apply plugin: "maven-publish"
978173
+ project.afterEvaluate {
978174
+ if (project.group == null || project.group.toString().isEmpty()) {
978175
+ project.group = project.name
978176
+ }
978177
+ if (project.version == null || project.version.toString() == "unspecified") {
978178
+ project.version = "${fallbackVersion}"
978179
+ }
978180
+ if (project.publishing.publications.findByName("${JAVA_POM_PUBLICATION_NAME}") == null) {
978181
+ project.publishing.publications.create("${JAVA_POM_PUBLICATION_NAME}", MavenPublication) {
978182
+ from project.components.java
978183
+ }
978184
+ }
978185
+ }
978186
+ }
978187
+ }
978188
+ `;
978189
+ }
978190
+ async function copyGeneratedPom({
978191
+ outputPath,
978192
+ distDir,
978193
+ context: context3
978194
+ }) {
978195
+ const pomPath = join8(
978196
+ outputPath,
978197
+ RelativeFilePath2.of(`build/publications/${JAVA_POM_PUBLICATION_NAME}/pom-default.xml`)
978198
+ );
978199
+ if (!await doesPathExist(pomPath)) {
978200
+ context3.logger.warn(
978201
+ "No POM was generated for the Java package; the JAR is packaged without dependency metadata."
978202
+ );
978203
+ return;
978204
+ }
978205
+ const jarNames = (await (0, import_promises168.readdir)(distDir)).filter((file4) => file4.endsWith(".jar"));
978206
+ const jarName = jarNames.find((file4) => !file4.endsWith("-sources.jar") && !file4.endsWith("-javadoc.jar")) ?? jarNames[0];
978207
+ const pomName = jarName != null ? `${jarName.slice(0, -".jar".length)}.pom` : "pom.xml";
978208
+ await (0, import_promises168.copyFile)(pomPath, join8(distDir, RelativeFilePath2.of(pomName)));
978209
+ }
978210
+ async function hasEmittedCompilerOutput({
978211
+ outputPath,
978212
+ tsconfig
978213
+ }) {
978214
+ let outDir = "dist";
978215
+ try {
978216
+ const parsed = JSON.parse(await (0, import_promises168.readFile)(join8(outputPath, RelativeFilePath2.of(tsconfig)), "utf-8"));
978217
+ if (typeof parsed === "object" && parsed != null && "compilerOptions" in parsed) {
978218
+ const compilerOptions = parsed.compilerOptions;
978219
+ if (typeof compilerOptions === "object" && compilerOptions != null && "outDir" in compilerOptions && typeof compilerOptions.outDir === "string") {
978220
+ outDir = compilerOptions.outDir;
978221
+ }
978222
+ }
978223
+ } catch {
978224
+ }
978225
+ const outDirPath = join8(outputPath, RelativeFilePath2.of(outDir));
978226
+ if (!await doesPathExist(outDirPath)) {
978227
+ return false;
978228
+ }
978229
+ return (await (0, import_promises168.readdir)(outDirPath)).length > 0;
978230
+ }
978231
+ async function findTsconfig(outputPath) {
978232
+ for (const candidate of ["tsconfig.cjs.json", "tsconfig.json"]) {
978233
+ if (await doesPathExist(join8(outputPath, RelativeFilePath2.of(candidate)))) {
978234
+ return candidate;
978235
+ }
978236
+ }
978237
+ return void 0;
978238
+ }
978239
+ async function hasPackageJsonFilesField(outputPath) {
978240
+ const packageJsonPath = join8(outputPath, RelativeFilePath2.of("package.json"));
978241
+ if (!await doesPathExist(packageJsonPath)) {
978242
+ return false;
978243
+ }
978244
+ const parsed = JSON.parse(await (0, import_promises168.readFile)(packageJsonPath, "utf-8"));
978245
+ return typeof parsed === "object" && parsed != null && "files" in parsed;
978246
+ }
978072
978247
  async function hasNpmScript({
978073
978248
  outputPath,
978074
978249
  script
@@ -978362,7 +978537,14 @@ async function generateWorkspace({
978362
978537
  });
978363
978538
  }
978364
978539
  if (pack) {
978365
- await packLocalOutputForGroup({ group, context: groupContext, mode: packMode, runner, packOnly });
978540
+ await packLocalOutputForGroup({
978541
+ group,
978542
+ context: groupContext,
978543
+ mode: packMode,
978544
+ runner,
978545
+ packOnly,
978546
+ version: version7
978547
+ });
978366
978548
  }
978367
978549
  })
978368
978550
  )
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.89.4",
2
+ "version": "5.89.5",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",