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