@fern-api/fern-api-dev 5.103.0 → 5.104.1
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 +82 -41
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -131007,7 +131007,8 @@ var init_OpenApiSettingsSchema2 = __esm({
|
|
|
131007
131007
|
"infer-discriminated-union-base-properties": schemas_exports8.boolean().optional(),
|
|
131008
131008
|
"disambiguate-request-names": schemas_exports8.boolean().optional(),
|
|
131009
131009
|
"ignore-tags": schemas_exports8.boolean().optional(),
|
|
131010
|
-
"respect-parameter-content": schemas_exports8.boolean().optional()
|
|
131010
|
+
"respect-parameter-content": schemas_exports8.boolean().optional(),
|
|
131011
|
+
"respect-per-spec-base-path": schemas_exports8.boolean().optional()
|
|
131011
131012
|
}).extend(BaseApiSettingsSchema);
|
|
131012
131013
|
}
|
|
131013
131014
|
});
|
|
@@ -152873,7 +152874,8 @@ var init_options2 = __esm({
|
|
|
152873
152874
|
shouldInferDiscriminatedUnionBaseProperties: false,
|
|
152874
152875
|
disambiguateRequestNames: true,
|
|
152875
152876
|
ignoreTags: false,
|
|
152876
|
-
respectParameterContent: false
|
|
152877
|
+
respectParameterContent: false,
|
|
152878
|
+
respectPerSpecBasePath: false
|
|
152877
152879
|
};
|
|
152878
152880
|
}
|
|
152879
152881
|
});
|
|
@@ -168685,6 +168687,7 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
168685
168687
|
taskContext.logger.warn(message);
|
|
168686
168688
|
}
|
|
168687
168689
|
}
|
|
168690
|
+
const plainBasePath = options2.respectPerSpecBasePath && fernBasePathParsed != null && fernBasePathParsed.pathParameters.length === 0 ? fernBasePathParsed.basePath : void 0;
|
|
168688
168691
|
Object.entries(openApi.paths ?? {}).forEach(([path122, pathItem]) => {
|
|
168689
168692
|
if (pathItem == null) {
|
|
168690
168693
|
return;
|
|
@@ -168697,16 +168700,16 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
168697
168700
|
}
|
|
168698
168701
|
switch (operation.type) {
|
|
168699
168702
|
case "async":
|
|
168700
|
-
endpointsWithExample.push(...operation.sync);
|
|
168701
|
-
endpointsWithExample.push(...operation.async);
|
|
168703
|
+
endpointsWithExample.push(...prependBasePathToEndpoints(operation.sync, plainBasePath));
|
|
168704
|
+
endpointsWithExample.push(...prependBasePathToEndpoints(operation.async, plainBasePath));
|
|
168702
168705
|
break;
|
|
168703
168706
|
case "http":
|
|
168704
|
-
endpointsWithExample.push(...operation.value);
|
|
168707
|
+
endpointsWithExample.push(...prependBasePathToEndpoints(operation.value, plainBasePath));
|
|
168705
168708
|
break;
|
|
168706
168709
|
case "streaming":
|
|
168707
|
-
endpointsWithExample.push(...operation.streaming);
|
|
168710
|
+
endpointsWithExample.push(...prependBasePathToEndpoints(operation.streaming, plainBasePath));
|
|
168708
168711
|
if (operation.nonStreaming) {
|
|
168709
|
-
endpointsWithExample.push(...operation.nonStreaming);
|
|
168712
|
+
endpointsWithExample.push(...prependBasePathToEndpoints(operation.nonStreaming, plainBasePath));
|
|
168710
168713
|
}
|
|
168711
168714
|
break;
|
|
168712
168715
|
case "webhook":
|
|
@@ -168914,17 +168917,8 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
168914
168917
|
document: openApi
|
|
168915
168918
|
}),
|
|
168916
168919
|
specVersion: openApi.info.version != null && openApi.info.version.length > 0 ? openApi.info.version : void 0,
|
|
168917
|
-
basePath: (
|
|
168918
|
-
|
|
168919
|
-
return parsed?.basePath;
|
|
168920
|
-
})(),
|
|
168921
|
-
basePathParameters: (() => {
|
|
168922
|
-
const parsed = getFernBasePath(openApi);
|
|
168923
|
-
if (parsed == null || parsed.pathParameters.length === 0) {
|
|
168924
|
-
return void 0;
|
|
168925
|
-
}
|
|
168926
|
-
return parsed.pathParameters;
|
|
168927
|
-
})(),
|
|
168920
|
+
basePath: fernBasePathParsed != null && (!options2.respectPerSpecBasePath || fernBasePathParsed.pathParameters.length > 0) ? fernBasePathParsed.basePath : void 0,
|
|
168921
|
+
basePathParameters: fernBasePathParsed != null && fernBasePathParsed.pathParameters.length > 0 ? fernBasePathParsed.pathParameters : void 0,
|
|
168928
168922
|
title: openApi.info.title ?? "",
|
|
168929
168923
|
description: openApi.info.description,
|
|
168930
168924
|
groups: Object.fromEntries(Object.entries(groupInfo ?? {}).map(([key2, value2]) => {
|
|
@@ -169012,6 +169006,26 @@ function maybeRemoveDiscriminantsFromSchemas(schemas, context3, source2) {
|
|
|
169012
169006
|
}
|
|
169013
169007
|
return result;
|
|
169014
169008
|
}
|
|
169009
|
+
function prependBasePath(path122, basePath) {
|
|
169010
|
+
if (basePath == null || basePath === "/") {
|
|
169011
|
+
return path122;
|
|
169012
|
+
}
|
|
169013
|
+
const normalizedBasePath = basePath.replace(/\/+$/, "");
|
|
169014
|
+
if (path122 === normalizedBasePath || path122.startsWith(`${normalizedBasePath}/`)) {
|
|
169015
|
+
return path122;
|
|
169016
|
+
}
|
|
169017
|
+
const normalizedPath = path122.replace(/^\/+/, "");
|
|
169018
|
+
return normalizedPath.length > 0 ? `${normalizedBasePath}/${normalizedPath}` : normalizedBasePath;
|
|
169019
|
+
}
|
|
169020
|
+
function prependBasePathToEndpoints(endpoints, basePath) {
|
|
169021
|
+
if (basePath == null || basePath === "/") {
|
|
169022
|
+
return endpoints;
|
|
169023
|
+
}
|
|
169024
|
+
return endpoints.map((endpoint3) => ({
|
|
169025
|
+
...endpoint3,
|
|
169026
|
+
path: prependBasePath(endpoint3.path, basePath)
|
|
169027
|
+
}));
|
|
169028
|
+
}
|
|
169015
169029
|
function getParentSchemaIdsWithNonUnionChildren(schemas, context3) {
|
|
169016
169030
|
const protectedParents = /* @__PURE__ */ new Set();
|
|
169017
169031
|
for (const [schemaId, schema] of Object.entries(schemas)) {
|
|
@@ -169191,7 +169205,7 @@ function parse8({ context: context3, documents, options: options2 }) {
|
|
|
169191
169205
|
source: source2,
|
|
169192
169206
|
namespace: document4.namespace
|
|
169193
169207
|
});
|
|
169194
|
-
ir3 = merge6(ir3, openapiIr, getParseOptions({ options: document4.settings, overrides: options2 }));
|
|
169208
|
+
ir3 = merge6(ir3, openapiIr, getParseOptions({ options: document4.settings, overrides: options2 }), context3);
|
|
169195
169209
|
documentIndex++;
|
|
169196
169210
|
break;
|
|
169197
169211
|
}
|
|
@@ -169388,7 +169402,17 @@ function extractApiNameFromServers(servers) {
|
|
|
169388
169402
|
function hasGroupedServers(servers) {
|
|
169389
169403
|
return servers.some((server) => server.type === "grouped");
|
|
169390
169404
|
}
|
|
169391
|
-
function
|
|
169405
|
+
function mergeBasePath(ir1, ir22, options2, context3) {
|
|
169406
|
+
if (options2?.respectPerSpecBasePath === true && ir1.basePath != null && ir22.basePath != null && ir1.basePath !== ir22.basePath) {
|
|
169407
|
+
context3.failWithoutThrowing(`Conflicting parameterized x-fern-base-path values: '${ir1.basePath}' and '${ir22.basePath}'.`);
|
|
169408
|
+
}
|
|
169409
|
+
return {
|
|
169410
|
+
basePath: ir1.basePath ?? ir22.basePath,
|
|
169411
|
+
basePathParameters: ir1.basePathParameters ?? ir22.basePathParameters
|
|
169412
|
+
};
|
|
169413
|
+
}
|
|
169414
|
+
function merge6(ir1, ir22, options2, context3) {
|
|
169415
|
+
const mergedBasePath = mergeBasePath(ir1, ir22, options2, context3);
|
|
169392
169416
|
const shouldGroupEnvironments = options2?.groupMultiApiEnvironments === true;
|
|
169393
169417
|
if (!shouldGroupEnvironments) {
|
|
169394
169418
|
return {
|
|
@@ -169396,8 +169420,8 @@ function merge6(ir1, ir22, options2) {
|
|
|
169396
169420
|
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
169397
169421
|
title: ir1.title ?? ir22.title,
|
|
169398
169422
|
description: ir1.description ?? ir22.description,
|
|
169399
|
-
basePath:
|
|
169400
|
-
basePathParameters:
|
|
169423
|
+
basePath: mergedBasePath.basePath,
|
|
169424
|
+
basePathParameters: mergedBasePath.basePathParameters,
|
|
169401
169425
|
servers: [...ir1.servers, ...ir22.servers],
|
|
169402
169426
|
websocketServers: [...ir1.websocketServers, ...ir22.websocketServers],
|
|
169403
169427
|
tags: {
|
|
@@ -169539,8 +169563,8 @@ function merge6(ir1, ir22, options2) {
|
|
|
169539
169563
|
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
169540
169564
|
title: ir1.title ?? ir22.title,
|
|
169541
169565
|
description: ir1.description ?? ir22.description,
|
|
169542
|
-
basePath:
|
|
169543
|
-
basePathParameters:
|
|
169566
|
+
basePath: mergedBasePath.basePath,
|
|
169567
|
+
basePathParameters: mergedBasePath.basePathParameters,
|
|
169544
169568
|
// Cast grouped servers to Server[] - buildEnvironments.ts handles the grouped structure
|
|
169545
169569
|
// biome-ignore lint/suspicious/noExplicitAny: Required to preserve grouped server metadata through type system
|
|
169546
169570
|
servers: mergedServers,
|
|
@@ -169594,8 +169618,8 @@ function merge6(ir1, ir22, options2) {
|
|
|
169594
169618
|
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
169595
169619
|
title: ir1.title ?? ir22.title,
|
|
169596
169620
|
description: ir1.description ?? ir22.description,
|
|
169597
|
-
basePath:
|
|
169598
|
-
basePathParameters:
|
|
169621
|
+
basePath: mergedBasePath.basePath,
|
|
169622
|
+
basePathParameters: mergedBasePath.basePathParameters,
|
|
169599
169623
|
servers: dedupeServers([...ir1.servers, ...ir22.servers]),
|
|
169600
169624
|
websocketServers: [...ir1.websocketServers, ...ir22.websocketServers],
|
|
169601
169625
|
tags: {
|
|
@@ -200071,7 +200095,8 @@ var init_getAPIDefinitionSettings = __esm({
|
|
|
200071
200095
|
shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties",
|
|
200072
200096
|
disambiguateRequestNames: "disambiguateRequestNames",
|
|
200073
200097
|
ignoreTags: "ignoreTags",
|
|
200074
|
-
respectParameterContent: "respectParameterContent"
|
|
200098
|
+
respectParameterContent: "respectParameterContent",
|
|
200099
|
+
respectPerSpecBasePath: "respectPerSpecBasePath"
|
|
200075
200100
|
};
|
|
200076
200101
|
}
|
|
200077
200102
|
});
|
|
@@ -264328,7 +264353,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
264328
264353
|
shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"],
|
|
264329
264354
|
disambiguateRequestNames: settings?.["disambiguate-request-names"],
|
|
264330
264355
|
ignoreTags: settings?.["ignore-tags"],
|
|
264331
|
-
respectParameterContent: settings?.["respect-parameter-content"]
|
|
264356
|
+
respectParameterContent: settings?.["respect-parameter-content"],
|
|
264357
|
+
respectPerSpecBasePath: settings?.["respect-per-spec-base-path"]
|
|
264332
264358
|
};
|
|
264333
264359
|
}
|
|
264334
264360
|
function parseAsyncApiDefinitionSettingsSchema(settings) {
|
|
@@ -265196,7 +265222,8 @@ var init_convertGeneratorsConfiguration = __esm({
|
|
|
265196
265222
|
shouldInferDiscriminatedUnionBaseProperties: void 0,
|
|
265197
265223
|
disambiguateRequestNames: void 0,
|
|
265198
265224
|
ignoreTags: void 0,
|
|
265199
|
-
respectParameterContent: void 0
|
|
265225
|
+
respectParameterContent: void 0,
|
|
265226
|
+
respectPerSpecBasePath: void 0
|
|
265200
265227
|
};
|
|
265201
265228
|
}
|
|
265202
265229
|
});
|
|
@@ -345486,13 +345513,21 @@ var require_swagger2openapi = __commonJS({
|
|
|
345486
345513
|
});
|
|
345487
345514
|
|
|
345488
345515
|
// ../workspace/lazy-fern-workspace/lib/utils/convertOpenAPIV2ToV3.js
|
|
345489
|
-
async function convertOpenAPIV2ToV3(openAPI) {
|
|
345516
|
+
async function convertOpenAPIV2ToV3(openAPI, options2) {
|
|
345517
|
+
let strictError;
|
|
345490
345518
|
try {
|
|
345491
345519
|
const conversionResult = await (0, import_swagger2openapi.convertObj)(openAPI, {});
|
|
345492
345520
|
return conversionResult.openapi;
|
|
345493
|
-
} catch (
|
|
345521
|
+
} catch (error50) {
|
|
345522
|
+
strictError = error50;
|
|
345523
|
+
}
|
|
345524
|
+
try {
|
|
345525
|
+
const conversionResult = await (0, import_swagger2openapi.convertObj)(openAPI, { patch: true });
|
|
345526
|
+
options2?.context?.logger.warn(`OpenAPI v2 (Swagger) document is not strictly valid and was converted in lenient (patch) mode: ${strictError instanceof Error ? strictError.message : String(strictError)}`);
|
|
345527
|
+
return conversionResult.openapi;
|
|
345528
|
+
} catch {
|
|
345494
345529
|
throw new CliError({
|
|
345495
|
-
message: `Failed to convert OpenAPI v2 (Swagger) spec to OpenAPI v3: ${
|
|
345530
|
+
message: `Failed to convert OpenAPI v2 (Swagger) spec to OpenAPI v3: ${strictError instanceof Error ? strictError.message : String(strictError)}`,
|
|
345496
345531
|
code: CliError.Code.ParseError
|
|
345497
345532
|
});
|
|
345498
345533
|
}
|
|
@@ -346401,7 +346436,7 @@ var init_OpenAPILoader = __esm({
|
|
|
346401
346436
|
if (!openAPI.schemes || openAPI.schemes.length === 0) {
|
|
346402
346437
|
openAPI.schemes = ["https"];
|
|
346403
346438
|
}
|
|
346404
|
-
const convertedOpenAPI = await convertOpenAPIV2ToV3(openAPI);
|
|
346439
|
+
const convertedOpenAPI = await convertOpenAPIV2ToV3(openAPI, { context: context3 });
|
|
346405
346440
|
return {
|
|
346406
346441
|
type: "openapi",
|
|
346407
346442
|
value: convertedOpenAPI,
|
|
@@ -694858,7 +694893,12 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
|
|
|
694858
694893
|
* back to a string.
|
|
694859
694894
|
* Defaults to false.
|
|
694860
694895
|
*/
|
|
694861
|
-
"respect-parameter-content": external_exports.boolean().optional()
|
|
694896
|
+
"respect-parameter-content": external_exports.boolean().optional(),
|
|
694897
|
+
/**
|
|
694898
|
+
* If true, apply each OpenAPI document's plain `x-fern-base-path` to that document's endpoints.
|
|
694899
|
+
* Defaults to false.
|
|
694900
|
+
*/
|
|
694901
|
+
"respect-per-spec-base-path": external_exports.boolean().optional()
|
|
694862
694902
|
});
|
|
694863
694903
|
|
|
694864
694904
|
// ../config/lib/schemas/specs/OpenApiSpecSchema.js
|
|
@@ -703447,7 +703487,7 @@ var AccessTokenPosthogManager = class {
|
|
|
703447
703487
|
properties: {
|
|
703448
703488
|
...event,
|
|
703449
703489
|
...event.properties,
|
|
703450
|
-
version: "5.
|
|
703490
|
+
version: "5.104.1",
|
|
703451
703491
|
usingAccessToken: true,
|
|
703452
703492
|
...getRunIdProperties()
|
|
703453
703493
|
}
|
|
@@ -703513,7 +703553,7 @@ var UserPosthogManager = class {
|
|
|
703513
703553
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
703514
703554
|
event: "CLI",
|
|
703515
703555
|
properties: {
|
|
703516
|
-
version: "5.
|
|
703556
|
+
version: "5.104.1",
|
|
703517
703557
|
...event,
|
|
703518
703558
|
...event.properties,
|
|
703519
703559
|
usingAccessToken: false,
|
|
@@ -710330,7 +710370,8 @@ var LegacyApiSpecAdapter = class {
|
|
|
710330
710370
|
shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties,
|
|
710331
710371
|
disambiguateRequestNames: settings["disambiguate-request-names"],
|
|
710332
710372
|
ignoreTags: settings["ignore-tags"],
|
|
710333
|
-
respectParameterContent: settings["respect-parameter-content"]
|
|
710373
|
+
respectParameterContent: settings["respect-parameter-content"],
|
|
710374
|
+
respectPerSpecBasePath: settings["respect-per-spec-base-path"]
|
|
710334
710375
|
};
|
|
710335
710376
|
const hasSettings = Object.values(result).some((v3) => v3 != null);
|
|
710336
710377
|
return hasSettings ? result : void 0;
|
|
@@ -884895,7 +884936,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
884895
884936
|
var LOGS_FOLDER_NAME = "logs";
|
|
884896
884937
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
884897
884938
|
function getCliSource() {
|
|
884898
|
-
const version7 = "5.
|
|
884939
|
+
const version7 = "5.104.1";
|
|
884899
884940
|
return `cli@${version7}`;
|
|
884900
884941
|
}
|
|
884901
884942
|
var DebugLogger = class {
|
|
@@ -910981,7 +911022,7 @@ var LegacyDocsPublisher = class {
|
|
|
910981
911022
|
previewId,
|
|
910982
911023
|
disableTemplates: void 0,
|
|
910983
911024
|
skipUpload,
|
|
910984
|
-
cliVersion: "5.
|
|
911025
|
+
cliVersion: "5.104.1",
|
|
910985
911026
|
loginCommand: "fern auth login"
|
|
910986
911027
|
});
|
|
910987
911028
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -978352,7 +978393,7 @@ function getAutomationContextFromEnv() {
|
|
|
978352
978393
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
978353
978394
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
978354
978395
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
978355
|
-
cli_version: "5.
|
|
978396
|
+
cli_version: "5.104.1"
|
|
978356
978397
|
};
|
|
978357
978398
|
}
|
|
978358
978399
|
function isAutomationMode() {
|
|
@@ -979184,7 +979225,7 @@ var CliContext = class _CliContext {
|
|
|
979184
979225
|
if (false) {
|
|
979185
979226
|
this.logger.error("CLI_VERSION is not defined");
|
|
979186
979227
|
}
|
|
979187
|
-
return "5.
|
|
979228
|
+
return "5.104.1";
|
|
979188
979229
|
}
|
|
979189
979230
|
getCliName() {
|
|
979190
979231
|
if (false) {
|
package/package.json
CHANGED