@fern-api/fern-api-dev 4.38.0 → 4.39.0

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 +50 -19
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -581652,7 +581652,7 @@ var AccessTokenPosthogManager = class {
581652
581652
  properties: {
581653
581653
  ...event,
581654
581654
  ...event.properties,
581655
- version: "4.38.0",
581655
+ version: "4.39.0",
581656
581656
  usingAccessToken: true
581657
581657
  }
581658
581658
  });
@@ -581703,7 +581703,7 @@ var UserPosthogManager = class {
581703
581703
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
581704
581704
  event: "CLI",
581705
581705
  properties: {
581706
- version: "4.38.0",
581706
+ version: "4.39.0",
581707
581707
  ...event,
581708
581708
  ...event.properties,
581709
581709
  usingAccessToken: false,
@@ -787806,7 +787806,7 @@ var import_path51 = __toESM(require("path"), 1);
787806
787806
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
787807
787807
  var LOGS_FOLDER_NAME = "logs";
787808
787808
  function getCliSource() {
787809
- const version8 = "4.38.0";
787809
+ const version8 = "4.39.0";
787810
787810
  return `cli@${version8}`;
787811
787811
  }
787812
787812
  var DebugLogger = class {
@@ -797260,13 +797260,19 @@ var SourceUploader = class {
797260
797260
  };
797261
797261
 
797262
797262
  // ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
797263
- async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version8, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath, dynamicIrOnly, retryRateLimited }) {
797263
+ async function runRemoteGenerationForGenerator({ projectConfig, organization, workspace, interactiveTaskContext, generatorInvocation, version: version8, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, readme, fernignorePath, dynamicIrOnly, retryRateLimited, requireEnvVars }) {
797264
797264
  const fdr = createFdrService({ token: token.value });
797265
797265
  const fdrOrigin = "https://registry-dev2.buildwithfern.com";
797266
797266
  const isAirGapped = await detectAirGappedMode(`${fdrOrigin}/health`, interactiveTaskContext.logger);
797267
797267
  const packageName = generators_yml_exports.getPackageName({ generatorInvocation });
797268
797268
  const isPreview = absolutePathToPreview != null;
797269
- const substituteEnvVars = (stringOrObject) => replaceEnvVariables(stringOrObject, { onError: (e6) => interactiveTaskContext.failAndThrow(e6) }, { substituteAsEmpty: isPreview });
797269
+ const substituteEnvVars = (stringOrObject) => replaceEnvVariables(stringOrObject, {
797270
+ onError: (e6) => {
797271
+ if (!isPreview && requireEnvVars) {
797272
+ interactiveTaskContext.failAndThrow(e6);
797273
+ }
797274
+ }
797275
+ }, { substituteAsEmpty: isPreview });
797270
797276
  const generatorInvocationWithEnvVarSubstitutions = substituteEnvVars(generatorInvocation);
797271
797277
  const dynamicGeneratorConfig = getDynamicGeneratorConfig({
797272
797278
  apiName: workspace.definition.rootApiFile.contents.name,
@@ -797553,7 +797559,7 @@ async function uploadDynamicIRForSdkGeneration({ fdr, organization, version: ver
797553
797559
  }
797554
797560
 
797555
797561
  // ../generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForAPIWorkspace.js
797556
- async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version8, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath, dynamicIrOnly, validateWorkspace, retryRateLimited }) {
797562
+ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization, workspace, context: context2, generatorGroup, version: version8, shouldLogS3Url, token, whitelabel, absolutePathToPreview, mode, fernignorePath, dynamicIrOnly, validateWorkspace, retryRateLimited, requireEnvVars }) {
797557
797563
  if (generatorGroup.generators.length === 0) {
797558
797564
  context2.logger.warn("No generators specified.");
797559
797565
  return null;
@@ -797611,7 +797617,8 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
797611
797617
  absolutePathToPreview,
797612
797618
  fernignorePath: effectiveFernignorePath,
797613
797619
  dynamicIrOnly,
797614
- retryRateLimited
797620
+ retryRateLimited,
797621
+ requireEnvVars
797615
797622
  });
797616
797623
  if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
797617
797624
  snippetsProducedBy.push(generatorInvocation);
@@ -798610,7 +798617,7 @@ var LegacyDocsPublisher = class {
798610
798617
  previewId: void 0,
798611
798618
  disableTemplates: void 0,
798612
798619
  skipUpload,
798613
- cliVersion: "4.38.0"
798620
+ cliVersion: "4.39.0"
798614
798621
  });
798615
798622
  if (taskContext.getResult() === TaskResult.Failure) {
798616
798623
  return { success: false };
@@ -836931,6 +836938,11 @@ var Attribute2 = class _Attribute extends AstNode7 {
836931
836938
  args: ["transparent"]
836932
836939
  })
836933
836940
  };
836941
+ static nonExhaustive() {
836942
+ return new _Attribute({
836943
+ name: "non_exhaustive"
836944
+ });
836945
+ }
836934
836946
  };
836935
836947
 
836936
836948
  // ../../../generators/rust/codegen/lib/ast/Client.js
@@ -849843,7 +849855,7 @@ var fs16 = __toESM(require("fs/promises"), 1);
849843
849855
  var import_os13 = __toESM(require("os"), 1);
849844
849856
  var import_path70 = __toESM(require("path"), 1);
849845
849857
  var import_tmp_promise14 = __toESM(require_tmp_promise(), 1);
849846
- async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version8, keepDocker, inspect: inspect5, context: context2, absolutePathToPreview, runner, ai: ai7, replay, noReplay, validateWorkspace }) {
849858
+ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace, generatorGroup, version: version8, keepDocker, inspect: inspect5, context: context2, absolutePathToPreview, runner, ai: ai7, replay, noReplay, validateWorkspace, requireEnvVars }) {
849847
849859
  const userProvidedVersion = version8;
849848
849860
  if (userProvidedVersion != null) {
849849
849861
  if (absolutePathToPreview != null) {
@@ -849863,7 +849875,14 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
849863
849875
  const autoVersioningCache = new AutoVersioningCache();
849864
849876
  const results = await Promise.all(generatorGroup.generators.map(async (generatorInvocation) => {
849865
849877
  return context2.runInteractiveTask({ name: generatorInvocation.name }, async (interactiveTaskContext) => {
849866
- const substituteEnvVars = (stringOrObject) => replaceEnvVariables(stringOrObject, { onError: (e6) => interactiveTaskContext.failAndThrow(e6) });
849878
+ const isPreview = absolutePathToPreview != null;
849879
+ const substituteEnvVars = (stringOrObject) => replaceEnvVariables(stringOrObject, {
849880
+ onError: (e6) => {
849881
+ if (!isPreview && (requireEnvVars ?? true)) {
849882
+ interactiveTaskContext.failAndThrow(e6);
849883
+ }
849884
+ }
849885
+ }, { substituteAsEmpty: isPreview });
849867
849886
  generatorInvocation = substituteEnvVars(generatorInvocation);
849868
849887
  const fernWorkspace = await workspace.toFernWorkspace({ context: context2 }, getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation), generatorInvocation.apiOverride?.specs);
849869
849888
  if (validateWorkspace) {
@@ -850876,7 +850895,8 @@ var LegacyRemoteGenerationRunner = class {
850876
850895
  absolutePathToPreview,
850877
850896
  whitelabel: void 0,
850878
850897
  dynamicIrOnly: false,
850879
- retryRateLimited: false
850898
+ retryRateLimited: false,
850899
+ requireEnvVars: true
850880
850900
  });
850881
850901
  if (this.isLocalGitCombo(args) && absolutePathToPreview != null) {
850882
850902
  const generatorName = basename2(generatorInvocation.name);
@@ -871204,7 +871224,7 @@ var CliContext = class {
871204
871224
  if (false) {
871205
871225
  this.logger.error("CLI_VERSION is not defined");
871206
871226
  }
871207
- return "4.38.0";
871227
+ return "4.39.0";
871208
871228
  }
871209
871229
  getCliName() {
871210
871230
  if (false) {
@@ -880415,7 +880435,8 @@ async function generateWorkspace({
880415
880435
  fernignorePath,
880416
880436
  dynamicIrOnly,
880417
880437
  noReplay,
880418
- retryRateLimited
880438
+ retryRateLimited,
880439
+ requireEnvVars
880419
880440
  }) {
880420
880441
  if (workspace.generatorsConfiguration == null) {
880421
880442
  context2.logger.warn("This workspaces has no generators.yml");
@@ -880486,7 +880507,8 @@ async function generateWorkspace({
880486
880507
  ai: ai7,
880487
880508
  replay,
880488
880509
  noReplay,
880489
- validateWorkspace: true
880510
+ validateWorkspace: true,
880511
+ requireEnvVars
880490
880512
  });
880491
880513
  } else if (token != null) {
880492
880514
  await runRemoteGenerationForAPIWorkspace({
@@ -880504,7 +880526,8 @@ async function generateWorkspace({
880504
880526
  fernignorePath,
880505
880527
  dynamicIrOnly,
880506
880528
  validateWorkspace: true,
880507
- retryRateLimited
880529
+ retryRateLimited,
880530
+ requireEnvVars
880508
880531
  });
880509
880532
  }
880510
880533
  })
@@ -880619,7 +880642,8 @@ async function generateAPIWorkspaces({
880619
880642
  dynamicIrOnly,
880620
880643
  outputDir,
880621
880644
  noReplay,
880622
- retryRateLimited
880645
+ retryRateLimited,
880646
+ requireEnvVars
880623
880647
  }) {
880624
880648
  let token = void 0;
880625
880649
  if (!useLocalDocker) {
@@ -880700,7 +880724,8 @@ async function generateAPIWorkspaces({
880700
880724
  fernignorePath,
880701
880725
  dynamicIrOnly,
880702
880726
  noReplay,
880703
- retryRateLimited
880727
+ retryRateLimited,
880728
+ requireEnvVars
880704
880729
  });
880705
880730
  });
880706
880731
  })
@@ -889231,6 +889256,10 @@ function addGenerateCommand2(cli, cliContext) {
889231
889256
  boolean: true,
889232
889257
  default: false,
889233
889258
  description: "Automatically retry with exponential backoff when receiving 429 Too Many Requests responses"
889259
+ }).option("require-env-vars", {
889260
+ boolean: true,
889261
+ default: true,
889262
+ description: "Require all referenced environment variables to be defined (use --no-require-env-vars to substitute empty strings for missing variables)"
889234
889263
  }),
889235
889264
  async (argv) => {
889236
889265
  if (argv.api != null && argv.docs != null) {
@@ -889298,7 +889327,8 @@ function addGenerateCommand2(cli, cliContext) {
889298
889327
  dynamicIrOnly: argv["dynamic-ir-only"],
889299
889328
  outputDir: argv.output,
889300
889329
  noReplay: !argv.replay,
889301
- retryRateLimited: argv["retry-rate-limited"]
889330
+ retryRateLimited: argv["retry-rate-limited"],
889331
+ requireEnvVars: argv["require-env-vars"]
889302
889332
  });
889303
889333
  }
889304
889334
  if (argv.docs != null) {
@@ -889354,7 +889384,8 @@ function addGenerateCommand2(cli, cliContext) {
889354
889384
  dynamicIrOnly: argv["dynamic-ir-only"],
889355
889385
  outputDir: argv.output,
889356
889386
  noReplay: !argv.replay,
889357
- retryRateLimited: argv["retry-rate-limited"]
889387
+ retryRateLimited: argv["retry-rate-limited"],
889388
+ requireEnvVars: argv["require-env-vars"]
889358
889389
  });
889359
889390
  }
889360
889391
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.38.0",
2
+ "version": "4.39.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",