@fern-api/fern-api-dev 4.86.0 → 4.86.1-1-g47cb77c4674
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 +97 -14
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -506239,6 +506239,7 @@ __export(generators_yml_exports, {
|
|
|
506239
506239
|
Language: () => Language4,
|
|
506240
506240
|
MessageNamingSettingsSchema: () => MessageNamingSettingsSchema,
|
|
506241
506241
|
ModelProvider: () => ModelProvider,
|
|
506242
|
+
MultiServerStrategy: () => MultiServerStrategy,
|
|
506242
506243
|
OPENAPI_LOCATION_KEY: () => OPENAPI_LOCATION_KEY,
|
|
506243
506244
|
OPENAPI_OVERRIDES_LOCATION_KEY: () => OPENAPI_OVERRIDES_LOCATION_KEY,
|
|
506244
506245
|
PathParameterOrder: () => PathParameterOrder,
|
|
@@ -506419,6 +506420,7 @@ __export(generators_exports, {
|
|
|
506419
506420
|
FormParameterEncoding: () => FormParameterEncoding,
|
|
506420
506421
|
Language: () => Language4,
|
|
506421
506422
|
MessageNamingSettingsSchema: () => MessageNamingSettingsSchema,
|
|
506423
|
+
MultiServerStrategy: () => MultiServerStrategy,
|
|
506422
506424
|
PathParameterOrder: () => PathParameterOrder,
|
|
506423
506425
|
RemoveDiscriminantsFromSchemas: () => RemoveDiscriminantsFromSchemas,
|
|
506424
506426
|
UnionSettingsSchema: () => UnionSettingsSchema
|
|
@@ -506470,6 +506472,12 @@ var MessageNamingSettingsSchema = {
|
|
|
506470
506472
|
V2: "v2"
|
|
506471
506473
|
};
|
|
506472
506474
|
|
|
506475
|
+
// ../configuration/lib/generators-yml/schemas/api/resources/generators/types/MultiServerStrategy.js
|
|
506476
|
+
var MultiServerStrategy = {
|
|
506477
|
+
EnvironmentPerServer: "environment-per-server",
|
|
506478
|
+
UrlsPerEnvironment: "urls-per-environment"
|
|
506479
|
+
};
|
|
506480
|
+
|
|
506473
506481
|
// ../configuration/lib/generators-yml/schemas/api/resources/generators/types/PathParameterOrder.js
|
|
506474
506482
|
var PathParameterOrder = {
|
|
506475
506483
|
UrlOrder: "url-order",
|
|
@@ -506579,6 +506587,7 @@ __export(serialization_exports4, {
|
|
|
506579
506587
|
MessageNamingSettingsSchema: () => MessageNamingSettingsSchema2,
|
|
506580
506588
|
ModelName: () => ModelName,
|
|
506581
506589
|
ModelProvider: () => ModelProvider2,
|
|
506590
|
+
MultiServerStrategy: () => MultiServerStrategy2,
|
|
506582
506591
|
NamespacedApiConfigurationSchema: () => NamespacedApiConfigurationSchema,
|
|
506583
506592
|
NpmOutputLocationSchema: () => NpmOutputLocationSchema,
|
|
506584
506593
|
NugetOutputLocationSchema: () => NugetOutputLocationSchema,
|
|
@@ -508551,6 +508560,7 @@ __export(generators_exports2, {
|
|
|
508551
508560
|
GraphQlSpecSchema: () => GraphQlSpecSchema,
|
|
508552
508561
|
Language: () => Language5,
|
|
508553
508562
|
MessageNamingSettingsSchema: () => MessageNamingSettingsSchema2,
|
|
508563
|
+
MultiServerStrategy: () => MultiServerStrategy2,
|
|
508554
508564
|
NamespacedApiConfigurationSchema: () => NamespacedApiConfigurationSchema,
|
|
508555
508565
|
OpenApiExampleGenerationSchema: () => OpenApiExampleGenerationSchema,
|
|
508556
508566
|
OpenApiFilterSchema: () => OpenApiFilterSchema,
|
|
@@ -508584,6 +508594,9 @@ var ApiDefinitionPathSchema = schemas_exports8.string();
|
|
|
508584
508594
|
// ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/MessageNamingSettingsSchema.js
|
|
508585
508595
|
var MessageNamingSettingsSchema2 = schemas_exports8.enum_(["v1", "v2"]);
|
|
508586
508596
|
|
|
508597
|
+
// ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/MultiServerStrategy.js
|
|
508598
|
+
var MultiServerStrategy2 = schemas_exports8.enum_(["environment-per-server", "urls-per-environment"]);
|
|
508599
|
+
|
|
508587
508600
|
// ../configuration/lib/generators-yml/schemas/serialization/resources/generators/types/PathParameterOrder.js
|
|
508588
508601
|
var PathParameterOrder2 = schemas_exports8.enum_(["url-order", "spec-order"]);
|
|
508589
508602
|
|
|
@@ -508605,6 +508618,7 @@ var ApiDefinitionSettingsSchema = schemas_exports8.object({
|
|
|
508605
508618
|
"wrap-references-to-nullable-in-optional": schemas_exports8.boolean().optional(),
|
|
508606
508619
|
"coerce-optional-schemas-to-nullable": schemas_exports8.boolean().optional(),
|
|
508607
508620
|
"group-environments-by-host": schemas_exports8.boolean().optional(),
|
|
508621
|
+
"multi-server-strategy": MultiServerStrategy2.optional(),
|
|
508608
508622
|
"remove-discriminants-from-schemas": RemoveDiscriminantsFromSchemas2.optional(),
|
|
508609
508623
|
"path-parameter-order": PathParameterOrder2.optional()
|
|
508610
508624
|
});
|
|
@@ -508670,6 +508684,7 @@ var BaseApiSettingsSchema = schemas_exports8.object({
|
|
|
508670
508684
|
"wrap-references-to-nullable-in-optional": schemas_exports8.boolean().optional(),
|
|
508671
508685
|
"coerce-optional-schemas-to-nullable": schemas_exports8.boolean().optional(),
|
|
508672
508686
|
"group-environments-by-host": schemas_exports8.boolean().optional(),
|
|
508687
|
+
"multi-server-strategy": MultiServerStrategy2.optional(),
|
|
508673
508688
|
"remove-discriminants-from-schemas": RemoveDiscriminantsFromSchemas2.optional(),
|
|
508674
508689
|
"path-parameter-order": PathParameterOrder2.optional(),
|
|
508675
508690
|
"resolve-schema-collisions": schemas_exports8.boolean().optional(),
|
|
@@ -509244,6 +509259,7 @@ var DEFAULT_CONVERT_OPENAPI_OPTIONS = {
|
|
|
509244
509259
|
wrapReferencesToNullableInOptional: false,
|
|
509245
509260
|
coerceOptionalSchemasToNullable: false,
|
|
509246
509261
|
groupEnvironmentsByHost: false,
|
|
509262
|
+
multiServerStrategy: generators_yml_exports.MultiServerStrategy.EnvironmentPerServer,
|
|
509247
509263
|
removeDiscriminantsFromSchemas: generators_yml_exports.RemoveDiscriminantsFromSchemas.Always,
|
|
509248
509264
|
inferDefaultEnvironment: true
|
|
509249
509265
|
};
|
|
@@ -517395,7 +517411,8 @@ function getEndpointNamespace(sdkName, namespaceOverride) {
|
|
|
517395
517411
|
function buildChannel({ channel: channel3, context: context3, declarationFile }) {
|
|
517396
517412
|
const firstServer = channel3.servers[0];
|
|
517397
517413
|
const hasSingleWebsocketServerOnly = context3.ir.servers.length === 0 && context3.ir.websocketServers.length <= 1;
|
|
517398
|
-
const
|
|
517414
|
+
const resolvedUrlIdFromMap = firstServer != null ? context3.getUrlId(firstServer.url) : void 0;
|
|
517415
|
+
const urlId = firstServer != null && !hasSingleWebsocketServerOnly ? resolvedUrlIdFromMap ?? (context3.options.groupEnvironmentsByHost ? generateWebsocketUrlId(firstServer.name, firstServer.url, true) : firstServer.name) : void 0;
|
|
517399
517416
|
context3.logger.debug(`[buildChannel] Channel path="${channel3.path}", server name="${firstServer?.name}", server url="${firstServer?.url}", resolved urlId="${urlId}" (from collision map: ${context3.getUrlId(firstServer?.url ?? "") != null})`);
|
|
517400
517417
|
let convertedPath = channel3.path;
|
|
517401
517418
|
for (const pathParameter of channel3.handshake.pathParameters) {
|
|
@@ -517568,6 +517585,22 @@ function extractUrlsFromEnvironmentSchema(record22) {
|
|
|
517568
517585
|
return acc;
|
|
517569
517586
|
}, {});
|
|
517570
517587
|
}
|
|
517588
|
+
function mergeWebsocketUrlsWithoutOverwriting(urls, websocketUrls, context3) {
|
|
517589
|
+
for (const [wsName, wsUrl] of Object.entries(websocketUrls)) {
|
|
517590
|
+
if (wsUrl == null) {
|
|
517591
|
+
continue;
|
|
517592
|
+
}
|
|
517593
|
+
if (urls[wsName] != null && urls[wsName] !== wsUrl) {
|
|
517594
|
+
const wsProtocol = getProtocol(wsUrl);
|
|
517595
|
+
const dedupedName = wsProtocol != null ? `${wsName}_${wsProtocol}` : `${wsName}_ws`;
|
|
517596
|
+
urls[dedupedName] = wsUrl;
|
|
517597
|
+
context3.setUrlId(wsUrl, dedupedName);
|
|
517598
|
+
} else {
|
|
517599
|
+
urls[wsName] = wsUrl;
|
|
517600
|
+
context3.setUrlId(wsUrl, wsName);
|
|
517601
|
+
}
|
|
517602
|
+
}
|
|
517603
|
+
}
|
|
517571
517604
|
function buildEnvironments(context3) {
|
|
517572
517605
|
if (context3.environmentOverrides != null) {
|
|
517573
517606
|
for (const [environment2, environmentDeclaration] of Object.entries(context3.environmentOverrides.environments ?? {})) {
|
|
@@ -517983,7 +518016,7 @@ function buildEnvironments(context3) {
|
|
|
517983
518016
|
const endpointServerNamesSet = new Set(apiToUrls.keys());
|
|
517984
518017
|
const topLevelServerNamesSet = new Set(Object.keys(topLevelServersWithName));
|
|
517985
518018
|
const endpointServersReferenceTopLevel = endpointServerNamesSet.size > 0 && [...endpointServerNamesSet].every((name2) => topLevelServerNamesSet.has(name2));
|
|
517986
|
-
if (apiToUrls.size > 0 && endpointServersReferenceTopLevel) {
|
|
518019
|
+
if (context3.options.multiServerStrategy === "urls-per-environment" && apiToUrls.size > 0 && endpointServersReferenceTopLevel) {
|
|
517987
518020
|
const entries23 = Object.entries(topLevelServersWithName);
|
|
517988
518021
|
const firstEntry = entries23[0];
|
|
517989
518022
|
if (firstEntry) {
|
|
@@ -518007,7 +518040,7 @@ function buildEnvironments(context3) {
|
|
|
518007
518040
|
}
|
|
518008
518041
|
}
|
|
518009
518042
|
if (hasWebsocketServersWithName) {
|
|
518010
|
-
|
|
518043
|
+
mergeWebsocketUrlsWithoutOverwriting(urls, extractUrlsFromEnvironmentSchema(websocketServersWithName), context3);
|
|
518011
518044
|
}
|
|
518012
518045
|
context3.builder.addEnvironment({
|
|
518013
518046
|
name: envName,
|
|
@@ -523631,6 +523664,7 @@ var BaseOpenAPIWorkspace = class extends AbstractAPIWorkspace {
|
|
|
523631
523664
|
inlineAllOfSchemas;
|
|
523632
523665
|
resolveAliases;
|
|
523633
523666
|
groupEnvironmentsByHost;
|
|
523667
|
+
multiServerStrategy;
|
|
523634
523668
|
inferDefaultEnvironment;
|
|
523635
523669
|
removeDiscriminantsFromSchemas;
|
|
523636
523670
|
defaultIntegerFormat;
|
|
@@ -523653,6 +523687,7 @@ var BaseOpenAPIWorkspace = class extends AbstractAPIWorkspace {
|
|
|
523653
523687
|
this.inlineAllOfSchemas = args.inlineAllOfSchemas;
|
|
523654
523688
|
this.resolveAliases = args.resolveAliases;
|
|
523655
523689
|
this.groupEnvironmentsByHost = args.groupEnvironmentsByHost;
|
|
523690
|
+
this.multiServerStrategy = args.multiServerStrategy;
|
|
523656
523691
|
this.inferDefaultEnvironment = args.inferDefaultEnvironment;
|
|
523657
523692
|
this.removeDiscriminantsFromSchemas = args.removeDiscriminantsFromSchemas;
|
|
523658
523693
|
this.defaultIntegerFormat = args.defaultIntegerFormat;
|
|
@@ -535679,6 +535714,7 @@ var FIELD_MAPPINGS = {
|
|
|
535679
535714
|
resolveAliases: "resolveAliases",
|
|
535680
535715
|
groupMultiApiEnvironments: "groupMultiApiEnvironments",
|
|
535681
535716
|
groupEnvironmentsByHost: "groupEnvironmentsByHost",
|
|
535717
|
+
multiServerStrategy: "multiServerStrategy",
|
|
535682
535718
|
inferDefaultEnvironment: "inferDefaultEnvironment",
|
|
535683
535719
|
wrapReferencesToNullableInOptional: "wrapReferencesToNullableInOptional",
|
|
535684
535720
|
coerceOptionalSchemasToNullable: "coerceOptionalSchemasToNullable",
|
|
@@ -544469,6 +544505,7 @@ var UNDEFINED_API_DEFINITION_SETTINGS = {
|
|
|
544469
544505
|
resolveAliases: void 0,
|
|
544470
544506
|
groupMultiApiEnvironments: void 0,
|
|
544471
544507
|
groupEnvironmentsByHost: void 0,
|
|
544508
|
+
multiServerStrategy: void 0,
|
|
544472
544509
|
inferDefaultEnvironment: void 0,
|
|
544473
544510
|
wrapReferencesToNullableInOptional: void 0,
|
|
544474
544511
|
coerceOptionalSchemasToNullable: void 0,
|
|
@@ -544544,6 +544581,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
544544
544581
|
resolveAliases: settings?.["resolve-aliases"],
|
|
544545
544582
|
groupMultiApiEnvironments: settings?.["group-multi-api-environments"],
|
|
544546
544583
|
groupEnvironmentsByHost: settings?.["group-environments-by-host"],
|
|
544584
|
+
multiServerStrategy: settings?.["multi-server-strategy"],
|
|
544547
544585
|
defaultIntegerFormat: settings?.["default-integer-format"],
|
|
544548
544586
|
pathParameterOrder: settings?.["path-parameter-order"]
|
|
544549
544587
|
};
|
|
@@ -544565,6 +544603,7 @@ function parseBaseApiDefinitionSettingsSchema(settings) {
|
|
|
544565
544603
|
wrapReferencesToNullableInOptional: settings?.["wrap-references-to-nullable-in-optional"],
|
|
544566
544604
|
coerceOptionalSchemasToNullable: settings?.["coerce-optional-schemas-to-nullable"],
|
|
544567
544605
|
groupEnvironmentsByHost: settings?.["group-environments-by-host"],
|
|
544606
|
+
multiServerStrategy: settings?.["multi-server-strategy"],
|
|
544568
544607
|
inferDefaultEnvironment: settings?.["infer-default-environment"],
|
|
544569
544608
|
groupMultiApiEnvironments: settings != null && "group-multi-api-environments" in settings ? settings["group-multi-api-environments"] : void 0,
|
|
544570
544609
|
removeDiscriminantsFromSchemas: parseRemoveDiscriminantsFromSchemas(settings?.["remove-discriminants-from-schemas"]),
|
|
@@ -549046,7 +549085,7 @@ function maybeCreateAndStoreExample({ key: key2, displayName, request: request7,
|
|
|
549046
549085
|
}
|
|
549047
549086
|
return false;
|
|
549048
549087
|
}
|
|
549049
|
-
function generateEndpointExample2({ endpoint: endpoint3, ir: ir10, skipOptionalRequestProperties }) {
|
|
549088
|
+
function generateEndpointExample2({ endpoint: endpoint3, ir: ir10, skipOptionalRequestProperties, logger: logger4 }) {
|
|
549050
549089
|
const userResults = {};
|
|
549051
549090
|
const autoResults = {};
|
|
549052
549091
|
const exampleStore = /* @__PURE__ */ new Map();
|
|
@@ -549069,7 +549108,8 @@ function generateEndpointExample2({ endpoint: endpoint3, ir: ir10, skipOptionalR
|
|
|
549069
549108
|
firstAutoRequestExample,
|
|
549070
549109
|
userResults,
|
|
549071
549110
|
autoResults,
|
|
549072
|
-
exampleStore
|
|
549111
|
+
exampleStore,
|
|
549112
|
+
logger: logger4
|
|
549073
549113
|
});
|
|
549074
549114
|
createExamplesForRemainingUserRequests({
|
|
549075
549115
|
endpoint: endpoint3,
|
|
@@ -549097,7 +549137,7 @@ function generateEndpointExample2({ endpoint: endpoint3, ir: ir10, skipOptionalR
|
|
|
549097
549137
|
autoFullExamples: autoResults
|
|
549098
549138
|
};
|
|
549099
549139
|
}
|
|
549100
|
-
function createExamplesForResponseStatusCodes({ endpoint: endpoint3, userRequestExamples, baseRequestExample, firstUserRequestName, firstUserRequestExample, firstAutoRequestName, firstAutoRequestExample, userResults, autoResults, exampleStore }) {
|
|
549140
|
+
function createExamplesForResponseStatusCodes({ endpoint: endpoint3, userRequestExamples, baseRequestExample, firstUserRequestName, firstUserRequestExample, firstAutoRequestName, firstAutoRequestExample, userResults, autoResults, exampleStore, logger: logger4 }) {
|
|
549101
549141
|
const endpointResponseArray = endpoint3.v2Responses?.responses ?? [endpoint3.response];
|
|
549102
549142
|
const requestExamplesUsed = /* @__PURE__ */ new Set();
|
|
549103
549143
|
for (const response of endpointResponseArray) {
|
|
@@ -549119,6 +549159,9 @@ function createExamplesForResponseStatusCodes({ endpoint: endpoint3, userRequest
|
|
|
549119
549159
|
requestExampleToUse = firstAutoRequestExample;
|
|
549120
549160
|
key2 = createExampleKey(firstAutoRequestName, name2, response?.statusCode);
|
|
549121
549161
|
} else {
|
|
549162
|
+
if (Object.keys(userRequestExamples).length > 0) {
|
|
549163
|
+
logger4?.warn(`Response example "${name2}" on ${endpoint3.method.toUpperCase()} ${endpoint3.fullPath.head} has no matching request example with the same summary. Falling back to a base request with no body. To pair them, set the request and response example summary fields to the same value.`);
|
|
549164
|
+
}
|
|
549122
549165
|
requestExampleToUse = baseRequestExample;
|
|
549123
549166
|
key2 = createExampleKey("base", name2, response?.statusCode);
|
|
549124
549167
|
}
|
|
@@ -549244,7 +549287,7 @@ function injectAutogeneratedExamples({ ir: ir10, exampleGeneration }) {
|
|
|
549244
549287
|
}
|
|
549245
549288
|
return ir10;
|
|
549246
549289
|
}
|
|
549247
|
-
function injectAutogeneratedV2Examples({ ir: ir10, exampleGeneration }) {
|
|
549290
|
+
function injectAutogeneratedV2Examples({ ir: ir10, exampleGeneration, logger: logger4 }) {
|
|
549248
549291
|
const genOptions = {
|
|
549249
549292
|
disabled: exampleGeneration.disabled,
|
|
549250
549293
|
includeOptionalRequestPropertyExamples: exampleGeneration.includeOptionalRequestPropertyExamples ?? false,
|
|
@@ -549262,7 +549305,8 @@ function injectAutogeneratedV2Examples({ ir: ir10, exampleGeneration }) {
|
|
|
549262
549305
|
const { userFullExamples, autoFullExamples } = generateEndpointExample2({
|
|
549263
549306
|
endpoint: endpoint3,
|
|
549264
549307
|
ir: ir10,
|
|
549265
|
-
skipOptionalRequestProperties: genOptions.includeOptionalRequestPropertyExamples ? false : true
|
|
549308
|
+
skipOptionalRequestProperties: genOptions.includeOptionalRequestPropertyExamples ? false : true,
|
|
549309
|
+
logger: logger4
|
|
549266
549310
|
});
|
|
549267
549311
|
if (Object.keys(endpoint3.v2Examples.userSpecifiedExamples).length > 0) {
|
|
549268
549312
|
if (Object.values(endpoint3.v2Examples.userSpecifiedExamples).some((example) => example.request != null || example.response != null)) {
|
|
@@ -594697,7 +594741,7 @@ var AbstractSpecConverter = class extends AbstractConverter {
|
|
|
594697
594741
|
ir10 = this.filterIrForAudiences(ir10);
|
|
594698
594742
|
}
|
|
594699
594743
|
const exampleGeneration = this.context.exampleGenerationArgs;
|
|
594700
|
-
const irWithV2Examples = injectAutogeneratedV2Examples({ ir: ir10, exampleGeneration });
|
|
594744
|
+
const irWithV2Examples = injectAutogeneratedV2Examples({ ir: ir10, exampleGeneration, logger: this.context.logger });
|
|
594701
594745
|
if (this.context.generateV1Examples) {
|
|
594702
594746
|
const irWithV1Examples = injectAutogeneratedExamples({ ir: ir10, exampleGeneration });
|
|
594703
594747
|
return {
|
|
@@ -606265,6 +606309,7 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
|
|
|
606265
606309
|
})(),
|
|
606266
606310
|
exampleGeneration: specs[0]?.settings?.exampleGeneration,
|
|
606267
606311
|
groupEnvironmentsByHost: specs.some((spec) => spec.settings?.groupEnvironmentsByHost),
|
|
606312
|
+
multiServerStrategy: specs.find((spec) => spec.settings?.multiServerStrategy != null)?.settings?.multiServerStrategy,
|
|
606268
606313
|
inferDefaultEnvironment: collapseSpecBooleanSetting(specs, (s8) => s8?.inferDefaultEnvironment),
|
|
606269
606314
|
defaultIntegerFormat: specs[0]?.settings?.defaultIntegerFormat,
|
|
606270
606315
|
pathParameterOrder: specs[0]?.settings?.pathParameterOrder,
|
|
@@ -607632,6 +607677,7 @@ __export(schemas_exports13, {
|
|
|
607632
607677
|
MessageNamingVersionSchema: () => MessageNamingVersionSchema,
|
|
607633
607678
|
MetadataConfigSchema: () => MetadataConfigSchema2,
|
|
607634
607679
|
MetadataSchema: () => MetadataSchema,
|
|
607680
|
+
MultiServerStrategySchema: () => MultiServerStrategySchema,
|
|
607635
607681
|
MultipleBaseUrlsEnvironmentSchema: () => MultipleBaseUrlsEnvironmentSchema3,
|
|
607636
607682
|
NavbarLinkSchema: () => NavbarLinkSchema2,
|
|
607637
607683
|
NavigationConfigSchema: () => NavigationConfigSchema4,
|
|
@@ -607696,6 +607742,9 @@ var AiConfigSchema = external_exports.object({
|
|
|
607696
607742
|
model: external_exports.string()
|
|
607697
607743
|
});
|
|
607698
607744
|
|
|
607745
|
+
// ../config/lib/schemas/settings/MultiServerStrategySchema.js
|
|
607746
|
+
var MultiServerStrategySchema = external_exports.enum(["environmentPerServer", "urlsPerEnvironment"]);
|
|
607747
|
+
|
|
607699
607748
|
// ../config/lib/schemas/settings/PathParameterOrderSchema.js
|
|
607700
607749
|
var PathParameterOrderSchema = external_exports.enum(["urlOrder", "specOrder"]);
|
|
607701
607750
|
|
|
@@ -607735,6 +607784,16 @@ var BaseApiSettingsSchema2 = external_exports.object({
|
|
|
607735
607784
|
* - Add protocol if still collision (e.g., "prod: wss://api.com/foo" -> "foo_wss", only for non-HTTPS protocols)
|
|
607736
607785
|
*/
|
|
607737
607786
|
groupEnvironmentsByHost: external_exports.boolean().optional(),
|
|
607787
|
+
/**
|
|
607788
|
+
* Controls how multiple top-level OpenAPI servers are mapped to environments in the generated
|
|
607789
|
+
* Fern definition, when those servers each declare an `x-fern-server-name` and endpoint-level
|
|
607790
|
+
* `servers:` overrides reference those names.
|
|
607791
|
+
* - `environmentPerServer`: emit one environment per top-level server (each `x-fern-server-name`
|
|
607792
|
+
* becomes its own environment constant in generated SDKs). This is the default.
|
|
607793
|
+
* - `urlsPerEnvironment`: collapse all top-level servers into a single environment with each
|
|
607794
|
+
* server exposed as a named URL.
|
|
607795
|
+
*/
|
|
607796
|
+
multiServerStrategy: MultiServerStrategySchema.optional(),
|
|
607738
607797
|
/**
|
|
607739
607798
|
* If `always`, remove discriminant properties from schemas when generating types, unless the schema is also used outside of a discriminated union.
|
|
607740
607799
|
* If `never`, keep discriminant properties in schemas when generating types.
|
|
@@ -614773,7 +614832,7 @@ var AccessTokenPosthogManager = class {
|
|
|
614773
614832
|
properties: {
|
|
614774
614833
|
...event,
|
|
614775
614834
|
...event.properties,
|
|
614776
|
-
version: "4.86.
|
|
614835
|
+
version: "4.86.1-1-g47cb77c4674",
|
|
614777
614836
|
usingAccessToken: true
|
|
614778
614837
|
}
|
|
614779
614838
|
});
|
|
@@ -614827,7 +614886,7 @@ var UserPosthogManager = class {
|
|
|
614827
614886
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
614828
614887
|
event: "CLI",
|
|
614829
614888
|
properties: {
|
|
614830
|
-
version: "4.86.
|
|
614889
|
+
version: "4.86.1-1-g47cb77c4674",
|
|
614831
614890
|
...event,
|
|
614832
614891
|
...event.properties,
|
|
614833
614892
|
usingAccessToken: false,
|
|
@@ -620070,6 +620129,7 @@ var LegacyApiSpecAdapter = class {
|
|
|
620070
620129
|
optionalAdditionalProperties: settings.optionalAdditionalProperties,
|
|
620071
620130
|
shouldUseIdiomaticRequestNames: settings.idiomaticRequestNames,
|
|
620072
620131
|
groupEnvironmentsByHost: settings.groupEnvironmentsByHost,
|
|
620132
|
+
multiServerStrategy: this.adaptMultiServerStrategy(settings.multiServerStrategy),
|
|
620073
620133
|
removeDiscriminantsFromSchemas: this.adaptRemoveDiscriminantsFromSchemas(settings.removeDiscriminantsFromSchemas),
|
|
620074
620134
|
pathParameterOrder: this.adaptPathParameterOrder(settings.pathParameterOrder),
|
|
620075
620135
|
// OpenAPI-specific settings
|
|
@@ -620109,6 +620169,7 @@ var LegacyApiSpecAdapter = class {
|
|
|
620109
620169
|
optionalAdditionalProperties: settings.optionalAdditionalProperties,
|
|
620110
620170
|
shouldUseIdiomaticRequestNames: settings.idiomaticRequestNames,
|
|
620111
620171
|
groupEnvironmentsByHost: settings.groupEnvironmentsByHost,
|
|
620172
|
+
multiServerStrategy: this.adaptMultiServerStrategy(settings.multiServerStrategy),
|
|
620112
620173
|
removeDiscriminantsFromSchemas: this.adaptRemoveDiscriminantsFromSchemas(settings.removeDiscriminantsFromSchemas),
|
|
620113
620174
|
pathParameterOrder: this.adaptPathParameterOrder(settings.pathParameterOrder),
|
|
620114
620175
|
// AsyncAPI-specific settings
|
|
@@ -620131,6 +620192,19 @@ var LegacyApiSpecAdapter = class {
|
|
|
620131
620192
|
return void 0;
|
|
620132
620193
|
}
|
|
620133
620194
|
}
|
|
620195
|
+
adaptMultiServerStrategy(value2) {
|
|
620196
|
+
if (value2 == null) {
|
|
620197
|
+
return void 0;
|
|
620198
|
+
}
|
|
620199
|
+
switch (value2) {
|
|
620200
|
+
case "environmentPerServer":
|
|
620201
|
+
return generators_yml_exports.MultiServerStrategy.EnvironmentPerServer;
|
|
620202
|
+
case "urlsPerEnvironment":
|
|
620203
|
+
return generators_yml_exports.MultiServerStrategy.UrlsPerEnvironment;
|
|
620204
|
+
default:
|
|
620205
|
+
return void 0;
|
|
620206
|
+
}
|
|
620207
|
+
}
|
|
620134
620208
|
adaptPathParameterOrder(value2) {
|
|
620135
620209
|
if (value2 == null) {
|
|
620136
620210
|
return void 0;
|
|
@@ -828902,6 +828976,7 @@ var SETTINGS_KEY_MAP = {
|
|
|
828902
828976
|
"optional-additional-properties": "optionalAdditionalProperties",
|
|
828903
828977
|
"idiomatic-request-names": "idiomaticRequestNames",
|
|
828904
828978
|
"group-environments-by-host": "groupEnvironmentsByHost",
|
|
828979
|
+
"multi-server-strategy": "multiServerStrategy",
|
|
828905
828980
|
"remove-discriminants-from-schemas": "removeDiscriminantsFromSchemas",
|
|
828906
828981
|
"path-parameter-order": "pathParameterOrder",
|
|
828907
828982
|
"coerce-consts-to": "coerceConstsTo",
|
|
@@ -828929,6 +829004,10 @@ var PATH_PARAMETER_ORDER_MAP = {
|
|
|
828929
829004
|
"url-order": "urlOrder",
|
|
828930
829005
|
"spec-order": "specOrder"
|
|
828931
829006
|
};
|
|
829007
|
+
var MULTI_SERVER_STRATEGY_MAP = {
|
|
829008
|
+
"environment-per-server": "environmentPerServer",
|
|
829009
|
+
"urls-per-environment": "urlsPerEnvironment"
|
|
829010
|
+
};
|
|
828932
829011
|
var FORM_ENCODING_MAP = {
|
|
828933
829012
|
form: "form",
|
|
828934
829013
|
json: "json"
|
|
@@ -828956,6 +829035,10 @@ function convertOpenApiSpecSettings(legacySettings) {
|
|
|
828956
829035
|
settings[newKey] = PATH_PARAMETER_ORDER_MAP[value2] ?? value2;
|
|
828957
829036
|
continue;
|
|
828958
829037
|
}
|
|
829038
|
+
if (key2 === "multi-server-strategy" && typeof value2 === "string") {
|
|
829039
|
+
settings[newKey] = MULTI_SERVER_STRATEGY_MAP[value2] ?? value2;
|
|
829040
|
+
continue;
|
|
829041
|
+
}
|
|
828959
829042
|
if (key2 === "default-form-parameter-encoding" && typeof value2 === "string") {
|
|
828960
829043
|
settings[newKey] = FORM_ENCODING_MAP[value2] ?? value2;
|
|
828961
829044
|
continue;
|
|
@@ -832325,7 +832408,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
832325
832408
|
var LOGS_FOLDER_NAME = "logs";
|
|
832326
832409
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
832327
832410
|
function getCliSource() {
|
|
832328
|
-
const version7 = "4.86.
|
|
832411
|
+
const version7 = "4.86.1-1-g47cb77c4674";
|
|
832329
832412
|
return `cli@${version7}`;
|
|
832330
832413
|
}
|
|
832331
832414
|
var DebugLogger = class {
|
|
@@ -843978,7 +844061,7 @@ var LegacyDocsPublisher = class {
|
|
|
843978
844061
|
previewId,
|
|
843979
844062
|
disableTemplates: void 0,
|
|
843980
844063
|
skipUpload,
|
|
843981
|
-
cliVersion: "4.86.
|
|
844064
|
+
cliVersion: "4.86.1-1-g47cb77c4674"
|
|
843982
844065
|
});
|
|
843983
844066
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
843984
844067
|
return { success: false };
|
|
@@ -919366,7 +919449,7 @@ var CliContext = class _CliContext {
|
|
|
919366
919449
|
if (false) {
|
|
919367
919450
|
this.logger.error("CLI_VERSION is not defined");
|
|
919368
919451
|
}
|
|
919369
|
-
return "4.86.
|
|
919452
|
+
return "4.86.1-1-g47cb77c4674";
|
|
919370
919453
|
}
|
|
919371
919454
|
getCliName() {
|
|
919372
919455
|
if (false) {
|
package/package.json
CHANGED