@fern-api/fern-api-dev 5.23.3-2058-gc1e30e885d3 → 5.23.3-2065-g5f3baad88ba
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 +253 -26
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -25708,6 +25708,116 @@ var init_addPrefixToString = __esm({
|
|
|
25708
25708
|
}
|
|
25709
25709
|
});
|
|
25710
25710
|
|
|
25711
|
+
// ../../commons/core-utils/lib/anyOfPresenceConstraint.js
|
|
25712
|
+
function isRecord(value2) {
|
|
25713
|
+
return typeof value2 === "object" && value2 != null && !Array.isArray(value2);
|
|
25714
|
+
}
|
|
25715
|
+
function isObjectTypeOrAbsent(type7) {
|
|
25716
|
+
if (type7 == null) {
|
|
25717
|
+
return true;
|
|
25718
|
+
}
|
|
25719
|
+
if (typeof type7 === "string") {
|
|
25720
|
+
return type7 === "object";
|
|
25721
|
+
}
|
|
25722
|
+
if (Array.isArray(type7)) {
|
|
25723
|
+
const nonNull = type7.filter((entry) => entry !== "null");
|
|
25724
|
+
return nonNull.length === 1 && nonNull[0] === "object";
|
|
25725
|
+
}
|
|
25726
|
+
return false;
|
|
25727
|
+
}
|
|
25728
|
+
function restatesSiblingSubschema(branchSubschema, siblingSubschema) {
|
|
25729
|
+
if (branchSubschema === true) {
|
|
25730
|
+
return true;
|
|
25731
|
+
}
|
|
25732
|
+
if (!isRecord(branchSubschema)) {
|
|
25733
|
+
return false;
|
|
25734
|
+
}
|
|
25735
|
+
const sibling2 = isRecord(siblingSubschema) ? siblingSubschema : void 0;
|
|
25736
|
+
for (const [keyword, value2] of Object.entries(branchSubschema)) {
|
|
25737
|
+
if (ANNOTATION_KEYWORDS.has(keyword)) {
|
|
25738
|
+
continue;
|
|
25739
|
+
}
|
|
25740
|
+
if (sibling2 == null || !(keyword in sibling2) || !deepEquals(value2, sibling2[keyword])) {
|
|
25741
|
+
return false;
|
|
25742
|
+
}
|
|
25743
|
+
}
|
|
25744
|
+
return true;
|
|
25745
|
+
}
|
|
25746
|
+
function deepEquals(a3, b5) {
|
|
25747
|
+
if (a3 === b5) {
|
|
25748
|
+
return true;
|
|
25749
|
+
}
|
|
25750
|
+
if (Array.isArray(a3) && Array.isArray(b5)) {
|
|
25751
|
+
return a3.length === b5.length && a3.every((entry, index3) => deepEquals(entry, b5[index3]));
|
|
25752
|
+
}
|
|
25753
|
+
if (isRecord(a3) && isRecord(b5)) {
|
|
25754
|
+
const aKeys = Object.keys(a3).sort();
|
|
25755
|
+
const bKeys = Object.keys(b5).sort();
|
|
25756
|
+
return aKeys.length === bKeys.length && aKeys.every((key2, index3) => key2 === bKeys[index3]) && aKeys.every((key2) => deepEquals(a3[key2], b5[key2]));
|
|
25757
|
+
}
|
|
25758
|
+
return false;
|
|
25759
|
+
}
|
|
25760
|
+
function isPresenceConstraintBranch(branch, siblingProperties) {
|
|
25761
|
+
if (!isRecord(branch) || "$ref" in branch) {
|
|
25762
|
+
return false;
|
|
25763
|
+
}
|
|
25764
|
+
if (branch.allOf != null || branch.oneOf != null || branch.anyOf != null || branch.additionalProperties != null || !isObjectTypeOrAbsent(branch.type)) {
|
|
25765
|
+
return false;
|
|
25766
|
+
}
|
|
25767
|
+
const branchProperties = isRecord(branch.properties) ? branch.properties : {};
|
|
25768
|
+
const branchRequired = Array.isArray(branch.required) ? branch.required : [];
|
|
25769
|
+
if (Object.keys(branchProperties).length === 0 && branchRequired.length === 0) {
|
|
25770
|
+
return false;
|
|
25771
|
+
}
|
|
25772
|
+
for (const name2 of branchRequired) {
|
|
25773
|
+
if (typeof name2 !== "string" || !(name2 in siblingProperties)) {
|
|
25774
|
+
return false;
|
|
25775
|
+
}
|
|
25776
|
+
}
|
|
25777
|
+
for (const [name2, subschema] of Object.entries(branchProperties)) {
|
|
25778
|
+
if (!(name2 in siblingProperties)) {
|
|
25779
|
+
return false;
|
|
25780
|
+
}
|
|
25781
|
+
if (!restatesSiblingSubschema(subschema, siblingProperties[name2])) {
|
|
25782
|
+
return false;
|
|
25783
|
+
}
|
|
25784
|
+
}
|
|
25785
|
+
return true;
|
|
25786
|
+
}
|
|
25787
|
+
function anyOfIsPresenceConstraint(schema) {
|
|
25788
|
+
const anyOf = schema.anyOf;
|
|
25789
|
+
if (!Array.isArray(anyOf) || anyOf.length === 0) {
|
|
25790
|
+
return false;
|
|
25791
|
+
}
|
|
25792
|
+
if (schema.oneOf != null || schema.allOf != null) {
|
|
25793
|
+
return false;
|
|
25794
|
+
}
|
|
25795
|
+
if (!isRecord(schema.properties) || Object.keys(schema.properties).length === 0) {
|
|
25796
|
+
return false;
|
|
25797
|
+
}
|
|
25798
|
+
const siblingProperties = schema.properties;
|
|
25799
|
+
return anyOf.every((branch) => isPresenceConstraintBranch(branch, siblingProperties));
|
|
25800
|
+
}
|
|
25801
|
+
var ANNOTATION_KEYWORDS;
|
|
25802
|
+
var init_anyOfPresenceConstraint = __esm({
|
|
25803
|
+
"../../commons/core-utils/lib/anyOfPresenceConstraint.js"() {
|
|
25804
|
+
"use strict";
|
|
25805
|
+
ANNOTATION_KEYWORDS = /* @__PURE__ */ new Set([
|
|
25806
|
+
"title",
|
|
25807
|
+
"description",
|
|
25808
|
+
"default",
|
|
25809
|
+
"deprecated",
|
|
25810
|
+
"example",
|
|
25811
|
+
"examples",
|
|
25812
|
+
"readOnly",
|
|
25813
|
+
"writeOnly",
|
|
25814
|
+
"externalDocs",
|
|
25815
|
+
"xml",
|
|
25816
|
+
"$comment"
|
|
25817
|
+
]);
|
|
25818
|
+
}
|
|
25819
|
+
});
|
|
25820
|
+
|
|
25711
25821
|
// ../../../node_modules/.pnpm/jsonpath-plus@10.4.0/node_modules/jsonpath-plus/dist/index-node-esm.js
|
|
25712
25822
|
function push(arr, item) {
|
|
25713
25823
|
arr = arr.slice();
|
|
@@ -34611,12 +34721,31 @@ var init_removeSuffix = __esm({
|
|
|
34611
34721
|
});
|
|
34612
34722
|
|
|
34613
34723
|
// ../../commons/core-utils/lib/replaceEnvVars.js
|
|
34724
|
+
function getDeferredEnvVars() {
|
|
34725
|
+
const raw = process.env[DEFERRED_ENV_VARS_ENV_VAR];
|
|
34726
|
+
if (raw == null) {
|
|
34727
|
+
return /* @__PURE__ */ new Set();
|
|
34728
|
+
}
|
|
34729
|
+
return new Set(raw.split(/[,\s]+/).filter((name2) => /^\w+$/.test(name2)));
|
|
34730
|
+
}
|
|
34731
|
+
function deferredPlaceholder(name2, before, after) {
|
|
34732
|
+
const placeholder = `${DEFERRED_PLACEHOLDER_PREFIX}${name2}`;
|
|
34733
|
+
if (/:\/\/$/.test(before)) {
|
|
34734
|
+
return placeholder;
|
|
34735
|
+
}
|
|
34736
|
+
const isUrl3 = URL_POSITION_REGEX.test(before) || before === "" && (after === "" || after.startsWith("/"));
|
|
34737
|
+
return isUrl3 ? `https://${placeholder}` : placeholder;
|
|
34738
|
+
}
|
|
34614
34739
|
function replaceEnvVariables(content5, context3, options2 = {}) {
|
|
34615
34740
|
if (typeof content5 === "string") {
|
|
34741
|
+
const deferred2 = getDeferredEnvVars();
|
|
34616
34742
|
let transformed2 = content5.replace(ESCAPED_ENV_VAR_REGEX, (_substring, varName) => {
|
|
34617
34743
|
return `${PLACEHOLDER_PREFIX}${varName}\0`;
|
|
34618
34744
|
});
|
|
34619
|
-
transformed2 = transformed2.replace(ENV_VAR_REGEX, (
|
|
34745
|
+
transformed2 = transformed2.replace(ENV_VAR_REGEX, (substring, envVarName, offset2, whole) => {
|
|
34746
|
+
if (deferred2.has(envVarName)) {
|
|
34747
|
+
return deferredPlaceholder(envVarName, whole.slice(0, offset2), whole.slice(offset2 + substring.length));
|
|
34748
|
+
}
|
|
34620
34749
|
if (options2.substituteAsEmpty) {
|
|
34621
34750
|
return "";
|
|
34622
34751
|
}
|
|
@@ -34638,7 +34767,7 @@ function replaceEnvVariables(content5, context3, options2 = {}) {
|
|
|
34638
34767
|
const transformed = mapValues2(content5, (value2) => replaceEnvVariables(value2, context3, options2));
|
|
34639
34768
|
return transformed;
|
|
34640
34769
|
}
|
|
34641
|
-
var ENV_VAR_REGEX, ESCAPED_ENV_VAR_REGEX, PLACEHOLDER_PREFIX;
|
|
34770
|
+
var ENV_VAR_REGEX, ESCAPED_ENV_VAR_REGEX, PLACEHOLDER_PREFIX, DEFERRED_ENV_VARS_ENV_VAR, DEFERRED_PLACEHOLDER_PREFIX, URL_POSITION_REGEX;
|
|
34642
34771
|
var init_replaceEnvVars = __esm({
|
|
34643
34772
|
"../../commons/core-utils/lib/replaceEnvVars.js"() {
|
|
34644
34773
|
"use strict";
|
|
@@ -34647,6 +34776,9 @@ var init_replaceEnvVars = __esm({
|
|
|
34647
34776
|
ENV_VAR_REGEX = /\$\{(\w+)\}/g;
|
|
34648
34777
|
ESCAPED_ENV_VAR_REGEX = /\\\$\\\{(\w+)\\}/g;
|
|
34649
34778
|
PLACEHOLDER_PREFIX = "\0ESCAPED_ENV_VAR\0";
|
|
34779
|
+
DEFERRED_ENV_VARS_ENV_VAR = "FERN_RUNTIME_ENV_VARS";
|
|
34780
|
+
DEFERRED_PLACEHOLDER_PREFIX = "FERN_SELF_HOSTED_ENV_";
|
|
34781
|
+
URL_POSITION_REGEX = /(\]\(|\b(?:href|src|url|action|content)\s*[=:]\s*["']?)$/i;
|
|
34650
34782
|
}
|
|
34651
34783
|
});
|
|
34652
34784
|
|
|
@@ -44668,6 +44800,7 @@ __export(lib_exports, {
|
|
|
44668
44800
|
SKIP_MARKER: () => SKIP_MARKER,
|
|
44669
44801
|
SymbolRegistry: () => SymbolRegistry,
|
|
44670
44802
|
addPrefixToString: () => addPrefixToString,
|
|
44803
|
+
anyOfIsPresenceConstraint: () => anyOfIsPresenceConstraint,
|
|
44671
44804
|
applyOpenAPIOverlay: () => applyOpenAPIOverlay,
|
|
44672
44805
|
assert: () => assert2,
|
|
44673
44806
|
assertDefined: () => assertDefined,
|
|
@@ -44688,6 +44821,7 @@ __export(lib_exports, {
|
|
|
44688
44821
|
isGitAvailable: () => isGitAvailable,
|
|
44689
44822
|
isNonNullish: () => isNonNullish,
|
|
44690
44823
|
isPlainObject: () => isPlainObject4,
|
|
44824
|
+
isPresenceConstraintBranch: () => isPresenceConstraintBranch,
|
|
44691
44825
|
keys: () => keys2,
|
|
44692
44826
|
mapValues: () => mapValues2,
|
|
44693
44827
|
mergeWithOverrides: () => mergeWithOverrides,
|
|
@@ -44715,6 +44849,7 @@ var init_lib4 = __esm({
|
|
|
44715
44849
|
"../../commons/core-utils/lib/index.js"() {
|
|
44716
44850
|
"use strict";
|
|
44717
44851
|
init_addPrefixToString();
|
|
44852
|
+
init_anyOfPresenceConstraint();
|
|
44718
44853
|
init_applyOpenAPIOverlay();
|
|
44719
44854
|
init_assert();
|
|
44720
44855
|
init_delay();
|
|
@@ -131102,6 +131237,7 @@ var init_OpenApiSettingsSchema2 = __esm({
|
|
|
131102
131237
|
"type-dates-as-strings": schemas_exports8.boolean().optional(),
|
|
131103
131238
|
"preserve-single-schema-oneof": schemas_exports8.boolean().optional(),
|
|
131104
131239
|
"preserve-one-of-in-all-of": schemas_exports8.boolean().optional(),
|
|
131240
|
+
"any-of-sibling-properties-as-object": schemas_exports8.boolean().optional(),
|
|
131105
131241
|
"inline-all-of-schemas": schemas_exports8.boolean().optional(),
|
|
131106
131242
|
"resolve-aliases": ResolveAliases.optional(),
|
|
131107
131243
|
"group-multi-api-environments": schemas_exports8.boolean().optional(),
|
|
@@ -152960,6 +153096,7 @@ var init_options2 = __esm({
|
|
|
152960
153096
|
typeDatesAsStrings: false,
|
|
152961
153097
|
preserveSingleSchemaOneOf: false,
|
|
152962
153098
|
preserveOneOfInAllOf: false,
|
|
153099
|
+
anyOfSiblingPropertiesAsObject: false,
|
|
152963
153100
|
inlineAllOfSchemas: false,
|
|
152964
153101
|
resolveAliases: false,
|
|
152965
153102
|
groupMultiApiEnvironments: false,
|
|
@@ -156619,6 +156756,12 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
|
|
|
156619
156756
|
}
|
|
156620
156757
|
}
|
|
156621
156758
|
if (schema.anyOf != null && schema.anyOf.length > 0) {
|
|
156759
|
+
if (context3.options.anyOfSiblingPropertiesAsObject && anyOfIsPresenceConstraint(schema)) {
|
|
156760
|
+
context3.logger.debug(`Treating the anyOf at ${breadcrumbs.join(".")} as an "at least one of" constraint over its sibling properties rather than a union, and converting the schema as an object.`);
|
|
156761
|
+
const { anyOf: _constraint, ...schemaWithoutAnyOf } = schema;
|
|
156762
|
+
const convertedSchema = convertSchema2(schemaWithoutAnyOf, wrapAsOptional, wrapAsNullable, context3, breadcrumbs, source2, namespace, referencedAsRequest);
|
|
156763
|
+
return maybeInjectDescriptionOrGroupName(convertedSchema, description, namespace, groupName);
|
|
156764
|
+
}
|
|
156622
156765
|
if (schema.anyOf.length === 1 && schema.anyOf[0] != null) {
|
|
156623
156766
|
const convertedSchema = convertSchema2(schema.anyOf[0], wrapAsOptional, wrapAsNullable, context3, breadcrumbs, source2, namespace, referencedAsRequest);
|
|
156624
156767
|
return maybeInjectDescriptionOrGroupName(convertedSchema, description, namespace, groupName);
|
|
@@ -157229,6 +157372,7 @@ var SCHEMA_REFERENCE_PREFIX, globalTitleCollisionTracker;
|
|
|
157229
157372
|
var init_convertSchemas = __esm({
|
|
157230
157373
|
"../api-importers/openapi/openapi-ir-parser/lib/schema/convertSchemas.js"() {
|
|
157231
157374
|
"use strict";
|
|
157375
|
+
init_lib4();
|
|
157232
157376
|
init_lib13();
|
|
157233
157377
|
init_lib6();
|
|
157234
157378
|
init_lodash();
|
|
@@ -200180,6 +200324,7 @@ var init_getAPIDefinitionSettings = __esm({
|
|
|
200180
200324
|
typeDatesAsStrings: "typeDatesAsStrings",
|
|
200181
200325
|
preserveSingleSchemaOneOf: "preserveSingleSchemaOneOf",
|
|
200182
200326
|
preserveOneOfInAllOf: "preserveOneOfInAllOf",
|
|
200327
|
+
anyOfSiblingPropertiesAsObject: "anyOfSiblingPropertiesAsObject",
|
|
200183
200328
|
inlineAllOfSchemas: "inlineAllOfSchemas",
|
|
200184
200329
|
resolveAliases: "resolveAliases",
|
|
200185
200330
|
groupMultiApiEnvironments: "groupMultiApiEnvironments",
|
|
@@ -264801,6 +264946,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
264801
264946
|
typeDatesAsStrings: settings?.["type-dates-as-strings"],
|
|
264802
264947
|
preserveSingleSchemaOneOf: settings?.["preserve-single-schema-oneof"],
|
|
264803
264948
|
preserveOneOfInAllOf: settings?.["preserve-one-of-in-all-of"],
|
|
264949
|
+
anyOfSiblingPropertiesAsObject: settings?.["any-of-sibling-properties-as-object"],
|
|
264804
264950
|
inlineAllOfSchemas: settings?.["inline-all-of-schemas"],
|
|
264805
264951
|
resolveAliases: settings?.["resolve-aliases"],
|
|
264806
264952
|
groupMultiApiEnvironments: settings?.["group-multi-api-environments"],
|
|
@@ -265663,6 +265809,7 @@ var init_convertGeneratorsConfiguration = __esm({
|
|
|
265663
265809
|
typeDatesAsStrings: void 0,
|
|
265664
265810
|
preserveSingleSchemaOneOf: void 0,
|
|
265665
265811
|
preserveOneOfInAllOf: void 0,
|
|
265812
|
+
anyOfSiblingPropertiesAsObject: void 0,
|
|
265666
265813
|
inlineAllOfSchemas: void 0,
|
|
265667
265814
|
resolveAliases: void 0,
|
|
265668
265815
|
groupMultiApiEnvironments: void 0,
|
|
@@ -343829,7 +343976,7 @@ var require_oas_kit_common = __commonJS({
|
|
|
343829
343976
|
function allSame(array3) {
|
|
343830
343977
|
return new Set(array3).size <= 1;
|
|
343831
343978
|
}
|
|
343832
|
-
function
|
|
343979
|
+
function deepEquals2(obj1, obj2) {
|
|
343833
343980
|
function _equals(obj12, obj22) {
|
|
343834
343981
|
return sjs.stringify(obj12) === sjs.stringify(Object.assign({}, obj12, obj22));
|
|
343835
343982
|
}
|
|
@@ -343839,7 +343986,7 @@ var require_oas_kit_common = __commonJS({
|
|
|
343839
343986
|
let result = [];
|
|
343840
343987
|
for (let candidate of arr) {
|
|
343841
343988
|
let dupe = result.find(function(e2, i5, a3) {
|
|
343842
|
-
return
|
|
343989
|
+
return deepEquals2(e2, candidate);
|
|
343843
343990
|
});
|
|
343844
343991
|
if (!dupe) result.push(candidate);
|
|
343845
343992
|
}
|
|
@@ -346297,7 +346444,7 @@ async function parseOverlayFile(absoluteFilePathToOverlay, context3) {
|
|
|
346297
346444
|
}
|
|
346298
346445
|
}
|
|
346299
346446
|
function validateOverlay(overlay, context3) {
|
|
346300
|
-
if (!
|
|
346447
|
+
if (!isRecord2(overlay)) {
|
|
346301
346448
|
context3.logger.error("Overlay file must be a YAML or JSON object");
|
|
346302
346449
|
return false;
|
|
346303
346450
|
}
|
|
@@ -346306,7 +346453,7 @@ function validateOverlay(overlay, context3) {
|
|
|
346306
346453
|
return false;
|
|
346307
346454
|
}
|
|
346308
346455
|
const info = overlay.info;
|
|
346309
|
-
if (!
|
|
346456
|
+
if (!isRecord2(info) || typeof info.title !== "string" || info.title.length === 0 || typeof info.version !== "string" || info.version.length === 0) {
|
|
346310
346457
|
context3.logger.error("Overlay file missing required 'info.title' or 'info.version' field");
|
|
346311
346458
|
return false;
|
|
346312
346459
|
}
|
|
@@ -346317,7 +346464,7 @@ function validateOverlay(overlay, context3) {
|
|
|
346317
346464
|
}
|
|
346318
346465
|
for (let i5 = 0; i5 < actions.length; i5++) {
|
|
346319
346466
|
const action = actions[i5];
|
|
346320
|
-
if (!
|
|
346467
|
+
if (!isRecord2(action) || !action.target) {
|
|
346321
346468
|
context3.logger.error(`Overlay action at index ${i5} missing required 'target' field`);
|
|
346322
346469
|
return false;
|
|
346323
346470
|
}
|
|
@@ -346328,7 +346475,7 @@ function validateOverlay(overlay, context3) {
|
|
|
346328
346475
|
}
|
|
346329
346476
|
return true;
|
|
346330
346477
|
}
|
|
346331
|
-
function
|
|
346478
|
+
function isRecord2(value2) {
|
|
346332
346479
|
return typeof value2 === "object" && value2 != null && !Array.isArray(value2);
|
|
346333
346480
|
}
|
|
346334
346481
|
var import_promises28, import_path36, import_tmp_promise6, tempDir;
|
|
@@ -351674,6 +351821,7 @@ var TYPE_INVARIANT_KEYS, SchemaConverter;
|
|
|
351674
351821
|
var init_SchemaConverter = __esm({
|
|
351675
351822
|
"../api-importers/v3-importer-commons/lib/converters/schema/SchemaConverter.js"() {
|
|
351676
351823
|
"use strict";
|
|
351824
|
+
init_lib4();
|
|
351677
351825
|
init_lib9();
|
|
351678
351826
|
init_lib30();
|
|
351679
351827
|
init_CreateTypeReferenceFromFernType();
|
|
@@ -351747,6 +351895,10 @@ var init_SchemaConverter = __esm({
|
|
|
351747
351895
|
if (maybeConvertedTypeArraySchema != null) {
|
|
351748
351896
|
return maybeConvertedTypeArraySchema;
|
|
351749
351897
|
}
|
|
351898
|
+
const maybeConvertedSiblingAnyOfConstraint = this.tryConvertSiblingAnyOfConstraint();
|
|
351899
|
+
if (maybeConvertedSiblingAnyOfConstraint != null) {
|
|
351900
|
+
return maybeConvertedSiblingAnyOfConstraint;
|
|
351901
|
+
}
|
|
351750
351902
|
const maybeConvertedOneOfAnyOfSchema = this.tryConvertOneOfAnyOfSchema();
|
|
351751
351903
|
if (maybeConvertedOneOfAnyOfSchema != null) {
|
|
351752
351904
|
return maybeConvertedOneOfAnyOfSchema;
|
|
@@ -352087,6 +352239,50 @@ var init_SchemaConverter = __esm({
|
|
|
352087
352239
|
}
|
|
352088
352240
|
return void 0;
|
|
352089
352241
|
}
|
|
352242
|
+
/**
|
|
352243
|
+
* A schema may declare `properties` alongside an `anyOf` whose branches only
|
|
352244
|
+
* re-declare some of those same properties as required, for example:
|
|
352245
|
+
*
|
|
352246
|
+
* type: object
|
|
352247
|
+
* properties: { a: {...}, b: {...} }
|
|
352248
|
+
* anyOf:
|
|
352249
|
+
* - { properties: { a: {...} }, required: [a] }
|
|
352250
|
+
* - { properties: { b: {...} }, required: [b] }
|
|
352251
|
+
*
|
|
352252
|
+
* Per JSON Schema an instance must satisfy both keywords, so the `anyOf` here
|
|
352253
|
+
* is a validation constraint -- "at least one of a, b" -- and not a set of
|
|
352254
|
+
* variants. Converting it as a union discards the sibling `properties`
|
|
352255
|
+
* entirely and makes the variants mutually exclusive, so a body carrying both
|
|
352256
|
+
* `a` and `b` silently loses one on the wire.
|
|
352257
|
+
*
|
|
352258
|
+
* Drop the `anyOf` and convert the schema as the object it declares. The "at
|
|
352259
|
+
* least one" constraint is not expressible in the IR and is not enforced.
|
|
352260
|
+
*
|
|
352261
|
+
* This only applies when every branch is an inline object whose properties are
|
|
352262
|
+
* a subset of the sibling `properties`. A branch that introduces a property,
|
|
352263
|
+
* or is a reference, is a genuine variant and is left to the union converter.
|
|
352264
|
+
*
|
|
352265
|
+
* Gated behind the `any-of-sibling-properties-as-object` setting.
|
|
352266
|
+
*/
|
|
352267
|
+
tryConvertSiblingAnyOfConstraint() {
|
|
352268
|
+
if (!this.context.settings.anyOfSiblingPropertiesAsObject) {
|
|
352269
|
+
return void 0;
|
|
352270
|
+
}
|
|
352271
|
+
if (!anyOfIsPresenceConstraint(this.schema)) {
|
|
352272
|
+
return void 0;
|
|
352273
|
+
}
|
|
352274
|
+
this.context.logger.debug(`Treating the anyOf at ${this.breadcrumbs.join(".")} as an "at least one of" constraint over its sibling properties rather than a union, and converting the schema as an object.`);
|
|
352275
|
+
const { anyOf: _constraint, ...schemaWithoutAnyOf } = this.schema;
|
|
352276
|
+
return new _SchemaConverter({
|
|
352277
|
+
id: this.id,
|
|
352278
|
+
context: this.context,
|
|
352279
|
+
breadcrumbs: this.breadcrumbs,
|
|
352280
|
+
schema: schemaWithoutAnyOf,
|
|
352281
|
+
inlined: this.inlined,
|
|
352282
|
+
nameOverride: this.nameOverride,
|
|
352283
|
+
visitedRefs: this.visitedRefs
|
|
352284
|
+
}).convert();
|
|
352285
|
+
}
|
|
352090
352286
|
tryConvertOneOfAnyOfSchema() {
|
|
352091
352287
|
if (this.schema.oneOf != null || this.schema.anyOf != null) {
|
|
352092
352288
|
const oneOfConverter = new OneOfSchemaConverter({
|
|
@@ -374099,6 +374295,8 @@ var init_OSSWorkspace = __esm({
|
|
|
374099
374295
|
// This avoids running buf generate twice when both toFernWorkspace() and
|
|
374100
374296
|
// validateOSSWorkspace() need the same OpenAPI specs.
|
|
374101
374297
|
openApiSpecsCache = /* @__PURE__ */ new Map();
|
|
374298
|
+
/** Guards the orphaned-`auth-schemes` warning so one command warns once. */
|
|
374299
|
+
hasWarnedOrphanedAuthSchemes = false;
|
|
374102
374300
|
constructor({ allSpecs, specs, ...superArgs }) {
|
|
374103
374301
|
const openapiSpecs = specs.filter((spec) => spec.type === "openapi" && spec.source.type === "openapi");
|
|
374104
374302
|
super({
|
|
@@ -374238,10 +374436,7 @@ var init_OSSWorkspace = __esm({
|
|
|
374238
374436
|
const specs = await this.getOpenAPISpecsCached({ context: context3 });
|
|
374239
374437
|
const documents = await this.loader.loadDocuments({ context: context3, specs });
|
|
374240
374438
|
let authOverrides = this.generatorsConfiguration?.api?.auth != null ? { ...this.generatorsConfiguration?.api } : void 0;
|
|
374241
|
-
|
|
374242
|
-
if (orphanedAuthSchemeWarning != null) {
|
|
374243
|
-
context3.logger.warn(orphanedAuthSchemeWarning);
|
|
374244
|
-
}
|
|
374439
|
+
this.warnOnOrphanedAuthSchemes(context3);
|
|
374245
374440
|
if (authOverrides == null) {
|
|
374246
374441
|
authOverrides = await getAuthFromOverrideFiles(specs);
|
|
374247
374442
|
}
|
|
@@ -374420,7 +374615,29 @@ var init_OSSWorkspace = __esm({
|
|
|
374420
374615
|
}
|
|
374421
374616
|
return results;
|
|
374422
374617
|
}
|
|
374618
|
+
/**
|
|
374619
|
+
* Emit the orphaned-`auth-schemes` warning, at most once per workspace.
|
|
374620
|
+
*
|
|
374621
|
+
* Called from BOTH `toFernWorkspace` and `getIntermediateRepresentation`,
|
|
374622
|
+
* because they are different entry points: `fern generate` and plain
|
|
374623
|
+
* `fern check` go through the former, and only `fern check --from-openapi`
|
|
374624
|
+
* reaches the latter (see `validateWorkspaces.ts`, where that branch is
|
|
374625
|
+
* gated on `directFromOpenapi`). Warning from only one of them meant the
|
|
374626
|
+
* customer who hits this bug — silently, on `fern generate` — saw nothing,
|
|
374627
|
+
* which is the entire failure mode.
|
|
374628
|
+
*/
|
|
374629
|
+
warnOnOrphanedAuthSchemes(context3) {
|
|
374630
|
+
if (this.hasWarnedOrphanedAuthSchemes) {
|
|
374631
|
+
return;
|
|
374632
|
+
}
|
|
374633
|
+
const warning = getOrphanedAuthSchemeWarning(this.generatorsConfiguration?.api);
|
|
374634
|
+
if (warning != null) {
|
|
374635
|
+
this.hasWarnedOrphanedAuthSchemes = true;
|
|
374636
|
+
context3.logger.warn(warning);
|
|
374637
|
+
}
|
|
374638
|
+
}
|
|
374423
374639
|
async toFernWorkspace({ context: context3 }, settings, specsOverride) {
|
|
374640
|
+
this.warnOnOrphanedAuthSchemes(context3);
|
|
374424
374641
|
if (specsOverride != null) {
|
|
374425
374642
|
return this.createWorkspaceWithSpecsOverride({ context: context3 }, specsOverride, settings);
|
|
374426
374643
|
}
|
|
@@ -696635,6 +696852,14 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
|
|
|
696635
696852
|
* Defaults to false.
|
|
696636
696853
|
*/
|
|
696637
696854
|
preserveOneOfInAllOf: external_exports.boolean().optional(),
|
|
696855
|
+
/**
|
|
696856
|
+
* When a schema declares `properties` alongside an `anyOf` that only marks
|
|
696857
|
+
* some of those same properties required, the `anyOf` is a constraint rather
|
|
696858
|
+
* than a set of variants. Set to true to convert such a schema as an object.
|
|
696859
|
+
* Defaults to false, converting it to a union, which drops the sibling
|
|
696860
|
+
* `properties`.
|
|
696861
|
+
*/
|
|
696862
|
+
anyOfSiblingPropertiesAsObject: external_exports.boolean().optional(),
|
|
696638
696863
|
/**
|
|
696639
696864
|
* Whether to inline allOf schemas. If false, allOf schemas will be
|
|
696640
696865
|
* extended in the code generation.
|
|
@@ -705279,7 +705504,7 @@ var AccessTokenPosthogManager = class {
|
|
|
705279
705504
|
properties: {
|
|
705280
705505
|
...event,
|
|
705281
705506
|
...event.properties,
|
|
705282
|
-
version: "5.23.3-
|
|
705507
|
+
version: "5.23.3-2065-g5f3baad88ba",
|
|
705283
705508
|
usingAccessToken: true,
|
|
705284
705509
|
...getRunIdProperties()
|
|
705285
705510
|
}
|
|
@@ -705345,7 +705570,7 @@ var UserPosthogManager = class {
|
|
|
705345
705570
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
705346
705571
|
event: "CLI",
|
|
705347
705572
|
properties: {
|
|
705348
|
-
version: "5.23.3-
|
|
705573
|
+
version: "5.23.3-2065-g5f3baad88ba",
|
|
705349
705574
|
...event,
|
|
705350
705575
|
...event.properties,
|
|
705351
705576
|
usingAccessToken: false,
|
|
@@ -712154,6 +712379,7 @@ var LegacyApiSpecAdapter = class {
|
|
|
712154
712379
|
typeDatesAsStrings: settings.typeDatesAsStrings,
|
|
712155
712380
|
preserveSingleSchemaOneOf: settings.preserveSingleSchemaOneof,
|
|
712156
712381
|
preserveOneOfInAllOf: settings.preserveOneOfInAllOf,
|
|
712382
|
+
anyOfSiblingPropertiesAsObject: settings.anyOfSiblingPropertiesAsObject,
|
|
712157
712383
|
inlineAllOfSchemas: settings.inlineAllOfSchemas,
|
|
712158
712384
|
resolveAliases: settings.resolveAliases,
|
|
712159
712385
|
groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
|
|
@@ -885110,6 +885336,7 @@ var SETTINGS_KEY_MAP = {
|
|
|
885110
885336
|
"type-dates-as-strings": "typeDatesAsStrings",
|
|
885111
885337
|
"preserve-single-schema-oneof": "preserveSingleSchemaOneof",
|
|
885112
885338
|
"preserve-one-of-in-all-of": "preserveOneOfInAllOf",
|
|
885339
|
+
"any-of-sibling-properties-as-object": "anyOfSiblingPropertiesAsObject",
|
|
885113
885340
|
"inline-all-of-schemas": "inlineAllOfSchemas",
|
|
885114
885341
|
"resolve-aliases": "resolveAliases",
|
|
885115
885342
|
"group-multi-api-environments": "groupMultiApiEnvironments",
|
|
@@ -887019,7 +887246,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
887019
887246
|
var LOGS_FOLDER_NAME = "logs";
|
|
887020
887247
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
887021
887248
|
function getCliSource() {
|
|
887022
|
-
const version7 = "5.23.3-
|
|
887249
|
+
const version7 = "5.23.3-2065-g5f3baad88ba";
|
|
887023
887250
|
return `cli@${version7}`;
|
|
887024
887251
|
}
|
|
887025
887252
|
var DebugLogger = class {
|
|
@@ -913983,7 +914210,7 @@ var LegacyDocsPublisher = class {
|
|
|
913983
914210
|
previewId,
|
|
913984
914211
|
disableTemplates: void 0,
|
|
913985
914212
|
skipUpload,
|
|
913986
|
-
cliVersion: "5.23.3-
|
|
914213
|
+
cliVersion: "5.23.3-2065-g5f3baad88ba",
|
|
913987
914214
|
loginCommand: "fern auth login"
|
|
913988
914215
|
});
|
|
913989
914216
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -930460,16 +930687,16 @@ var TestClass = class extends Node5 {
|
|
|
930460
930687
|
};
|
|
930461
930688
|
|
|
930462
930689
|
// ../../../generators/csharp/codegen/lib/context/filesystem-nuget-publish-target.js
|
|
930463
|
-
function
|
|
930690
|
+
function isRecord3(value2) {
|
|
930464
930691
|
return typeof value2 === "object" && value2 != null;
|
|
930465
930692
|
}
|
|
930466
930693
|
function getFilesystemNugetPublishTarget(ir3) {
|
|
930467
930694
|
const publishConfig = ir3.publishConfig;
|
|
930468
|
-
if (!
|
|
930695
|
+
if (!isRecord3(publishConfig) || publishConfig.type !== "filesystem") {
|
|
930469
930696
|
return void 0;
|
|
930470
930697
|
}
|
|
930471
930698
|
const publishTarget = publishConfig.publishTarget;
|
|
930472
|
-
if (!
|
|
930699
|
+
if (!isRecord3(publishTarget) || publishTarget.type !== "nuget") {
|
|
930473
930700
|
return void 0;
|
|
930474
930701
|
}
|
|
930475
930702
|
return {
|
|
@@ -973158,11 +973385,11 @@ function getFirstUrlSegment({ path: path122 }) {
|
|
|
973158
973385
|
}
|
|
973159
973386
|
|
|
973160
973387
|
// ../docs-importers/mintlify/lib/MintlifyImporter.js
|
|
973161
|
-
function
|
|
973388
|
+
function isRecord4(value2) {
|
|
973162
973389
|
return typeof value2 === "object" && value2 != null && !Array.isArray(value2);
|
|
973163
973390
|
}
|
|
973164
973391
|
function hasNavigationArray(value2) {
|
|
973165
|
-
return
|
|
973392
|
+
return isRecord4(value2) && Array.isArray(value2.navigation);
|
|
973166
973393
|
}
|
|
973167
973394
|
var MintlifyImporter = class extends DocsImporter {
|
|
973168
973395
|
documentationTab = void 0;
|
|
@@ -980903,7 +981130,7 @@ function getAutomationContextFromEnv() {
|
|
|
980903
981130
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
980904
981131
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
980905
981132
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
980906
|
-
cli_version: "5.23.3-
|
|
981133
|
+
cli_version: "5.23.3-2065-g5f3baad88ba"
|
|
980907
981134
|
};
|
|
980908
981135
|
}
|
|
980909
981136
|
function isAutomationMode() {
|
|
@@ -981735,7 +981962,7 @@ var CliContext = class _CliContext {
|
|
|
981735
981962
|
if (false) {
|
|
981736
981963
|
this.logger.error("CLI_VERSION is not defined");
|
|
981737
981964
|
}
|
|
981738
|
-
return "5.23.3-
|
|
981965
|
+
return "5.23.3-2065-g5f3baad88ba";
|
|
981739
981966
|
}
|
|
981740
981967
|
getCliName() {
|
|
981741
981968
|
if (false) {
|
|
@@ -994951,7 +995178,7 @@ function upsertServerInJsonConfig({
|
|
|
994951
995178
|
includeTransportType
|
|
994952
995179
|
}) {
|
|
994953
995180
|
const config5 = parseJsonConfig(existingContents);
|
|
994954
|
-
const mcpServers =
|
|
995181
|
+
const mcpServers = isRecord5(config5.mcpServers) ? config5.mcpServers : {};
|
|
994955
995182
|
config5.mcpServers = {
|
|
994956
995183
|
...mcpServers,
|
|
994957
995184
|
[MCP_SERVER_NAME]: {
|
|
@@ -994968,12 +995195,12 @@ function parseJsonConfig(existingContents) {
|
|
|
994968
995195
|
return {};
|
|
994969
995196
|
}
|
|
994970
995197
|
const parsed = JSON.parse(existingContents);
|
|
994971
|
-
if (!
|
|
995198
|
+
if (!isRecord5(parsed)) {
|
|
994972
995199
|
throw new Error("Expected the config to contain a JSON object");
|
|
994973
995200
|
}
|
|
994974
995201
|
return parsed;
|
|
994975
995202
|
}
|
|
994976
|
-
function
|
|
995203
|
+
function isRecord5(value2) {
|
|
994977
995204
|
return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
|
|
994978
995205
|
}
|
|
994979
995206
|
var CODEX_SERVER_TABLE_PATH = `mcp_servers.${MCP_SERVER_NAME}`;
|
package/package.json
CHANGED