@fern-api/fern-api-dev 4.38.0-9-g61723bf49a7 → 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 +45 -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-9-g61723bf49a7",
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-9-g61723bf49a7",
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-9-g61723bf49a7";
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-9-g61723bf49a7"
798620
+ cliVersion: "4.39.0"
798614
798621
  });
798615
798622
  if (taskContext.getResult() === TaskResult.Failure) {
798616
798623
  return { success: false };
@@ -849848,7 +849855,7 @@ var fs16 = __toESM(require("fs/promises"), 1);
849848
849855
  var import_os13 = __toESM(require("os"), 1);
849849
849856
  var import_path70 = __toESM(require("path"), 1);
849850
849857
  var import_tmp_promise14 = __toESM(require_tmp_promise(), 1);
849851
- 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 }) {
849852
849859
  const userProvidedVersion = version8;
849853
849860
  if (userProvidedVersion != null) {
849854
849861
  if (absolutePathToPreview != null) {
@@ -849868,7 +849875,14 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
849868
849875
  const autoVersioningCache = new AutoVersioningCache();
849869
849876
  const results = await Promise.all(generatorGroup.generators.map(async (generatorInvocation) => {
849870
849877
  return context2.runInteractiveTask({ name: generatorInvocation.name }, async (interactiveTaskContext) => {
849871
- 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 });
849872
849886
  generatorInvocation = substituteEnvVars(generatorInvocation);
849873
849887
  const fernWorkspace = await workspace.toFernWorkspace({ context: context2 }, getBaseOpenAPIWorkspaceSettingsFromGeneratorInvocation(generatorInvocation), generatorInvocation.apiOverride?.specs);
849874
849888
  if (validateWorkspace) {
@@ -850881,7 +850895,8 @@ var LegacyRemoteGenerationRunner = class {
850881
850895
  absolutePathToPreview,
850882
850896
  whitelabel: void 0,
850883
850897
  dynamicIrOnly: false,
850884
- retryRateLimited: false
850898
+ retryRateLimited: false,
850899
+ requireEnvVars: true
850885
850900
  });
850886
850901
  if (this.isLocalGitCombo(args) && absolutePathToPreview != null) {
850887
850902
  const generatorName = basename2(generatorInvocation.name);
@@ -871209,7 +871224,7 @@ var CliContext = class {
871209
871224
  if (false) {
871210
871225
  this.logger.error("CLI_VERSION is not defined");
871211
871226
  }
871212
- return "4.38.0-9-g61723bf49a7";
871227
+ return "4.39.0";
871213
871228
  }
871214
871229
  getCliName() {
871215
871230
  if (false) {
@@ -880420,7 +880435,8 @@ async function generateWorkspace({
880420
880435
  fernignorePath,
880421
880436
  dynamicIrOnly,
880422
880437
  noReplay,
880423
- retryRateLimited
880438
+ retryRateLimited,
880439
+ requireEnvVars
880424
880440
  }) {
880425
880441
  if (workspace.generatorsConfiguration == null) {
880426
880442
  context2.logger.warn("This workspaces has no generators.yml");
@@ -880491,7 +880507,8 @@ async function generateWorkspace({
880491
880507
  ai: ai7,
880492
880508
  replay,
880493
880509
  noReplay,
880494
- validateWorkspace: true
880510
+ validateWorkspace: true,
880511
+ requireEnvVars
880495
880512
  });
880496
880513
  } else if (token != null) {
880497
880514
  await runRemoteGenerationForAPIWorkspace({
@@ -880509,7 +880526,8 @@ async function generateWorkspace({
880509
880526
  fernignorePath,
880510
880527
  dynamicIrOnly,
880511
880528
  validateWorkspace: true,
880512
- retryRateLimited
880529
+ retryRateLimited,
880530
+ requireEnvVars
880513
880531
  });
880514
880532
  }
880515
880533
  })
@@ -880624,7 +880642,8 @@ async function generateAPIWorkspaces({
880624
880642
  dynamicIrOnly,
880625
880643
  outputDir,
880626
880644
  noReplay,
880627
- retryRateLimited
880645
+ retryRateLimited,
880646
+ requireEnvVars
880628
880647
  }) {
880629
880648
  let token = void 0;
880630
880649
  if (!useLocalDocker) {
@@ -880705,7 +880724,8 @@ async function generateAPIWorkspaces({
880705
880724
  fernignorePath,
880706
880725
  dynamicIrOnly,
880707
880726
  noReplay,
880708
- retryRateLimited
880727
+ retryRateLimited,
880728
+ requireEnvVars
880709
880729
  });
880710
880730
  });
880711
880731
  })
@@ -889236,6 +889256,10 @@ function addGenerateCommand2(cli, cliContext) {
889236
889256
  boolean: true,
889237
889257
  default: false,
889238
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)"
889239
889263
  }),
889240
889264
  async (argv) => {
889241
889265
  if (argv.api != null && argv.docs != null) {
@@ -889303,7 +889327,8 @@ function addGenerateCommand2(cli, cliContext) {
889303
889327
  dynamicIrOnly: argv["dynamic-ir-only"],
889304
889328
  outputDir: argv.output,
889305
889329
  noReplay: !argv.replay,
889306
- retryRateLimited: argv["retry-rate-limited"]
889330
+ retryRateLimited: argv["retry-rate-limited"],
889331
+ requireEnvVars: argv["require-env-vars"]
889307
889332
  });
889308
889333
  }
889309
889334
  if (argv.docs != null) {
@@ -889359,7 +889384,8 @@ function addGenerateCommand2(cli, cliContext) {
889359
889384
  dynamicIrOnly: argv["dynamic-ir-only"],
889360
889385
  outputDir: argv.output,
889361
889386
  noReplay: !argv.replay,
889362
- retryRateLimited: argv["retry-rate-limited"]
889387
+ retryRateLimited: argv["retry-rate-limited"],
889388
+ requireEnvVars: argv["require-env-vars"]
889363
889389
  });
889364
889390
  }
889365
889391
  );
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.38.0-9-g61723bf49a7",
2
+ "version": "4.39.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",